在centos 6.5上安装Redis

Tol*_*lar 10 centos redis centos6

我正在尝试使用以下行在 centos 6.5 (x64) 上安装 Redis:

yum install redis
Run Code Online (Sandbox Code Playgroud)

但我得到以下屏幕:

[root@NodeJs ~]# yum install redis
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: nl.mirror.eurid.eu
 * epel: nl.mirror.eurid.eu
 * extras: mirror.denit.net
 * updates: nl.mirror.eurid.eu
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:2.8.14-2.el7 will be installed
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: redis-2.8.14-2.el7.x86_64
--> Running transaction check
---> Package jemalloc.x86_64 0:3.6.0-1.el7 will be installed
---> Package redis.x86_64 0:2.8.14-2.el7 will be installed
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Finished Dependency Resolution
Error: Package: redis-2.8.14-2.el7.x86_64 (epel)
           Requires: systemd
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

Mic*_*ton 18

您为 EL7 安装了 EPEL 存储库,但实际上您正在运行 EL6。移除epel-release包,即,sudo yum search epel && sudo yum remove epel-release并用正确的包替换它。

根据此文档, Redis 可以通过发出以下命令安装在 CentOS6 上:

// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install

// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

$ yum --enablerepo=remi,remi-test install redis 
Run Code Online (Sandbox Code Playgroud)


Roc*_*ite 18

下面是我在 CentOS 6.5 上更新 Redis (2.4.10) 的成功经验。

如何在 CentOS 6.5 上更新 Redis

  1. 首先,确保安装了以下存储库EPELREMI

    sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm
    
    Run Code Online (Sandbox Code Playgroud)
  2. REMIrepo 中查看 Redis 的版​​本:(截至 2015 年 6 月,版本为2.8.13

    yum --enablerepo=remi info redis
    
    Run Code Online (Sandbox Code Playgroud)
  3. 然后jemallocEPELrepo安装相关的依赖项 ( ) :

    sudo yum --enablerepo=epel install jemalloc
    
    Run Code Online (Sandbox Code Playgroud)
  4. 在安装之前,您应该停止旧的 Redis 守护进程:

    sudo service redis stop
    
    Run Code Online (Sandbox Code Playgroud)
  5. 然后安装较新版本的Redis:

    sudo yum --enablerepo=remi install redis
    
    Run Code Online (Sandbox Code Playgroud)
  6. 如果需要,编辑 Redis 配置文件:

    sudo vi /etc/redis.conf
    
    Run Code Online (Sandbox Code Playgroud)
  7. 重启 Redis 守护进程,让它在重启时自动启动:

    sudo service redis start
    sudo chkconfig redis on
    
    Run Code Online (Sandbox Code Playgroud)
  8. 最后,检查当前安装的Redis的版本:

    redis-cli info | grep redis_version
    
    Run Code Online (Sandbox Code Playgroud)

完毕!


小智 7

EPEL redis 包有点过时了,在 RHEL6 上你可以使用 Remi 的 Repository:http : //rpms.famillecollet.com/。它们是最新的,还有 3.0 和 2.8 版本的最新版本。

看看这里为最新的软件包的描述。