linux安装redis最新版

1、如果要安装最新的redis,需要安装Remi的软件源

yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

[root@192 local]# yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Loaded plugins: fastestmirror
remi-release-7.rpm                                                                                                                                                      |  20 kB  00:00:00     
Examining /var/tmp/yum-root-jEw2en/remi-release-7.rpm: remi-release-7.7-2.el7.remi.noarch
Marking /var/tmp/yum-root-jEw2en/remi-release-7.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package remi-release.noarch 0:7.7-2.el7.remi will be installed
--> Processing Dependency: epel-release = 7 for package: remi-release-7.7-2.el7.remi.noarch
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
base                                                                                                                                                                    | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                                                                        | 3.5 kB  00:00:00     
extras                                                                                                                                                                  | 2.9 kB  00:00:00     
updates                                                                                                                                                                 | 2.9 kB  00:00:00     
(1/2): docker-ce-stable/x86_64/primary_db                                                                                                                               |  44 kB  00:00:00     
(2/2): updates/7/x86_64/primary_db                                                                                                                                      | 2.1 MB  00:00:01     
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                       Arch                                    Version                                          Repository                                        Size
===============================================================================================================================================================================================
Installing:
 remi-release                                  noarch                                  7.7-2.el7.remi                                   /remi-release-7                                   26 k
Installing for dependencies:
 epel-release                                  noarch                                  7-11                                             extras                                            15 k

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total size: 41 k
Total download size: 15 k
Installed size: 51 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                                            |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                                                    1/2 
  Installing : remi-release-7.7-2.el7.remi.noarch                                                                                                                                          2/2 
  Verifying  : remi-release-7.7-2.el7.remi.noarch                                                                                                                                          1/2 
  Verifying  : epel-release-7-11.noarch                                                                                                                                                    2/2 

Installed:
  remi-release.noarch 0:7.7-2.el7.remi                                                                                                                                                         

Dependency Installed:
  epel-release.noarch 0:7-11                                                                                                                                                                   

Complete!

2、然后可以使用下面的命令安装最新版本的redis:

yum --enablerepo=remi install redis
[root@192 local]# yum --enablerepo=remi install redis
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                                    | 8.0 kB  00:00:00     
 * base: mirrors.ustc.edu.cn
 * epel: mirrors.bfsu.edu.cn
 * extras: mirrors.cn99.com
 * remi: mirror.innosol.asia
 * remi-safe: mirror.innosol.asia
 * updates: mirrors.cn99.com
epel                                                                                                                                                                    | 4.7 kB  00:00:00     
remi                                                                                                                                                                    | 3.0 kB  00:00:00     
remi-safe                                                                                                                                                               | 3.0 kB  00:00:00     
(1/5): epel/x86_64/group_gz                                                                                                                                             |  95 kB  00:00:00     
(2/5): remi-safe/primary_db                                                                                                                                             | 1.7 MB  00:00:01     
(3/5): epel/x86_64/updateinfo                                                                                                                                           | 1.0 MB  00:00:03     
(4/5): remi/primary_db                                                                                                                                                  | 2.7 MB  00:00:03     
(5/5): epel/x86_64/primary_db                                                                                                                                           | 6.8 MB  00:04:41     
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:6.0.4-2.el7.remi will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                    Arch                                        Version                                                Repository                                 Size
===============================================================================================================================================================================================
Installing:
 redis                                      x86_64                                      6.0.4-2.el7.remi                                       remi                                      1.1 M

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package

Total download size: 1.1 M
Installed size: 4.0 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/remi/packages/redis-6.0.4-2.el7.remi.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY                       ]  0.0 B/s | 416 kB  --:--:-- ETA 
Public key for redis-6.0.4-2.el7.remi.x86_64.rpm is not installed
redis-6.0.4-2.el7.remi.x86_64.rpm                                                                                                                                       | 1.1 MB  00:00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
 Userid     : "Remi Collet "
 Fingerprint: 1ee0 4cce 88a4 ae4a a29a 5df5 004e 6f47 00f9 7f56
 Package    : remi-release-7.7-2.el7.remi.noarch (installed)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : redis-6.0.4-2.el7.remi.x86_64                                                                                                                                               1/1 
  Verifying  : redis-6.0.4-2.el7.remi.x86_64                                                                                                                                               1/1 

Installed:
  redis.x86_64 0:6.0.4-2.el7.remi                                                                                                                                                              

Complete!

3、启动redis

[root@192 local]# systemctl start redis
[root@192 local]# systemctl status redis
● redis.service - Redis persistent key-value database
   Loaded: loaded (/usr/lib/systemd/system/redis.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/redis.service.d
           └─limit.conf
   Active: active (running) since Sun 2020-06-07 07:05:01 EDT; 5s ago
 Main PID: 6555 (redis-server)
   Status: "Ready to accept connections"
   CGroup: /system.slice/redis.service
           └─6555 /usr/bin/redis-server 127.0.0.1:6379

Jun 07 07:05:01 192.168.0.107 systemd[1]: Starting Redis persistent key-value database...
Jun 07 07:05:01 192.168.0.107 systemd[1]: Started Redis persistent key-value database.

4、设置redis开机自启

[root@192 local]# systemctl enable redis.service
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.

5、开启远程登录

[root@192 local]# vi /etc/redis.conf 

#bind 127.0.0.1
 bind 0.0.0.0

6、开启服务器的端口或者关闭防火墙

你可能感兴趣的:(安装配置教程,Linux,缓存)