Amazon-Ec2

在 aws ec2 上需要最新版本的 libmemcached

  • December 22, 2015

aws ec2 實例上可用的 yum 儲存庫只有舊版本的libmemcached:v 1.0.8。

誰能告訴我如何在 aws ec2 實例上安裝更新的版本,如 1.0.18?

我可以添加哪個外部 yum 儲存庫來安裝更新的版本,即使它不受支持?

EC2:yum 資訊 libmemcached

Using username "ec2-user".
Authenticating with public key "imported-openssh-key"

      __|  __|_  )
      _|  (     /   Amazon Linux AMI
     ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2015.09-release-notes/
No packages needed for security; 1 packages available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ yum info libmemcached
Loaded plugins: priorities, update-motd, upgrade-helper
Available Packages
Name        : libmemcached
Arch        : x86_64
Version     : 1.0.8
Release     : 2.6.amzn1
Size        : 246 k
Repo        : amzn-main/2015.09
Summary     : Client library and command line tools for memcached server
URL         : http://libmemcached.org/
License     : BSD
Description : libmemcached is a C/C++ client library and tools for the memcached server
           : (http://memcached.org/). It has been designed to be light on memory
           : usage, and provide full access to server side methods.
           :
           : It also implements several command line tools:
           :
           : memcapable  Checking a Memcached server capibilities and compatibility
           : memcat      Copy the value of a key to standard output
           : memcp       Copy data to a server
           : memdump     Dumping your server
           : memerror    Translate an error code to a string
           : memexist    Check for the existance of a key
           : memflush    Flush the contents of your servers
           : memparse    Parse an option string
           : memping     Test to see if a server is available.
           : memrm       Remove a key(s) from the server
           : memslap     Generate testing loads on a memcached cluster
           : memstat     Dump the stats of your servers to standard output
           : memtouch    Touches a key

EC2:貓 /etc/yum.repos.d/amzn-main.repo

[ec2-user@ip-xxx-xxx-xxx-xxx~]$ cat /etc/yum.repos.d/amzn-main.repo
[amzn-main]
name=amzn-main-Base
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/main/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=1
retries=5
timeout=10
report_instanceid=yes

[amzn-main-debuginfo]
name=amzn-main-debuginfo
mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/main/debuginfo/mirror.list
mirror_expire=300
metadata_expire=300
priority=10
failovermethod=priority
fastestmirror_enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-amazon-ga
enabled=0
retries=5
timeout=10
report_instanceid=yes

謝謝!

正如@Jukka 建議的那樣,我仍在嘗試使用外部儲存庫來獲得解決方案,但在我這樣做之前,我能夠使用以下內容對其進行編譯:

sudo -i 
yum remove libmemcached.x86_64

yum install bzr.x86_64
yum install gcc-c++

mkdir -p /tmp/memcached
cd /tmp/memcached
wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gz
cd /tmp/memcached/
bzr branch lp:libmemcached
cd libmemcached
./bootstrap.sh autoreconf
NOTE YOU GET THE FOLLOWING ERROR BUT CONTINUE ANYWAY: "./bootstrap.sh:315: An attempt was made to set an invalid VENDOR="
cd ../libmemcached-1.0.18
./configure
make
make test
make install

你可以試試 Remi 的 RPM repo。http://blog.remirepo.net/pages/Config-en

請注意,它取決於 EPEL,並且您需要在安裝軟體包時顯式啟用它:

yum --enablerepo=remi install XXX

注意:不確定它是否與 Amazon Linux 兼容。如果沒有,請考慮使用預設為 1.0.16 的 CentOS 7。

引用自:https://serverfault.com/questions/744024