作者:Dfsk刘海_368 | 来源:互联网 | 2014-05-29 22:06
1、安装 EPEL Repo
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
2、安装 Memcache
yum -y install memcached
安装过程中可能会出现如下问题:
--> Missing Dependency: perl(Net::SSLeay) >= 1.33 is needed by package perl-AnyEvent-5.240-1.el5.rf.noarch (rpmforge)
Error: Missing Dependency: perl(Net::SSLeay) >= 1.33 is needed by package perl-AnyEvent-5.240-1.el5.rf.noarch (rpmforge)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
这个问题是因为CentOS的 yum没有memcached需要的最新的 perl-Net-SSLeay 和 perl-IO-Socket-SSL包.
解决办法也很简单,删除旧的包,安装新的包。
查看旧版本的包
rpm -qa | grep perl-Net-SSLeay
rpm -qa | grep perl-IO-Socket-SSL
移除并安装新包
rpm-e perl-Net-SSLeay-1.30-4.fc6
rpm -e perl-IO-Socket-SSL-1.01-1.fc6
wget http://packages.sw.be/perl-Net-SSLeay/perl-Net-SSLeay-1.36-1.el5.rfx.i386.rpm
wget http://packages.sw.be/perl-Net-SSLeay/perl-Net-SSLeay-1.36-1.el5.rfx.x86_64.rpm
wget http://packages.sw.be/perl-IO-Socket-SSL/perl-IO-Socket-SSL-1.34-1.el5.rfx.noarch.rpm
rpm -i perl-Net-SSLeay-1.36-1.el5.rfx.x86_64.rpm
rpm -i perl-Net-SSLeay-1.36-1.el5.rfx.i386.rpm
rpm -i perl-IO-Socket-SSL-1.34-1.el5.rfx.noarch.rpm
然后再执行安装命令
yum -y install memcached
即可安装成功
3、设置为开机启动
chkconfig --level 2345 memcached on
4、启动和停止
/etc/init.d/memcached start|stop
-------------------------------------------------------------
常见问题:
(1).尝试安装memcached失败,因缺少EPEL扩展包。
[root@njdyw ~]# yum install memcached
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
No package memcached available.
Nothing to do
(2).repolist检查
[root@njdyw ~]# yum repolist
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
repolist: 0
(3).安装EPEL扩展包(Extra Packages for Enterprise Linux)
[root@njdyw ~]# rpm -ivh http://dl.Fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
warning: /var/tmp/rpm-xfer.Bw4fvR: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
(4).repolist再次检查
[root@njdyw ~]# yum repolist
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
epel | 3.7 kB 00:00
epel/primary_db | 3.8 MB 00:16
repo id repo name status
epel Extra Packages for Enterprise Linux 5 - x86_64 enabled: 7,228
repolist: 7,228
(5).再次安装memcached成功
[root@njdyw ~]# yum install memcached
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package memcached.x86_64 0:1.4.5-1.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================
Installing:
memcached x86_64 1.4.5-1.el5 epel 72 k
Transaction Summary
====================================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 72 k
Is this ok [y/N]: y
Downloading Packages:
memcached-1.4.5-1.el5.x86_64.rpm | 72 kB 00:01
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
epel/gpgkey | 1.7 kB 00:00
Importing GPG key 0x217521F6 "Fedora EPEL " from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : memcached 1/1
Installed:
memcached.x86_64 0:1.4.5-1.el5
Complete!