To install Redis 5.0 on CentOS 7.6Pre-requisite:Install the remi-repo for CentOS 7 http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Enable the remi repo for redis server and also install it - yum --enablerepo=remi install redis
- Enable the redis server
- Enable Network listen for redis Service
- Restart the servcie of redis and check the status
- Test the connection of redis server
InstallationList the contents to view the installed Remi repository. [root@linuxhelp ~]# ll
total 28
-rw-------. 1 root root 2097 Dec 9 2017 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 12 2017 Desktop
drwxr-xr-x. 2 root root 6 Dec 12 2017 Documents
drwxr-xr-x. 2 root root 6 Dec 12 2017 Downloads
-rwxr-xr-x 1 root root 4037 May 21 16:43 ffmpeg-install
-rw-r--r--. 1 root root 2128 Dec 12 2017 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 6 Dec 12 2017 Music
drwxr-xr-x. 2 root root 6 Dec 12 2017 Pictures
drwxr-xr-x. 2 root root 6 Dec 12 2017 Public
-rw-r--r-- 1 root root 16004 Mar 8 13:10 remi-release-7.rpm
drwxr-xr-x. 2 root root 6 Dec 12 2017 Templates
drwxr-xr-x. 2 root root 6 Dec 12 2017 Videos
Enable the remi-repo and install Redis server.
[root@linuxhelp ~]# yum --enablerepo=remi install redis
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.vbctv.in
* epel: sg.fedora.ipserverone.com
* extras: mirror.nbrc.ac.in
* remi: rpms.remirepo.net
* remi-php72: rpms.remirepo.net
* remi-safe: rpms.remirepo.net
* updates: mirror.nbrc.ac.in
remi | 3.0 kB 00:00:00
remi/primary_db | 2.3 MB 00:00:08
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:5.0.5-1.el7.remi will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================
Installing:
redis x86_64 5.0.5-1.el7.remi remi 922 k
Transaction Summary
==============================================================================================================================================
Install 1 Package
Total download size: 922 k
Installed size: 3.0 M
Is this ok [y/d/N]: y
Downloading packages:
redis-5.0.5-1.el7.remi.x86_64.rpm | 922 kB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : redis-5.0.5-1.el7.remi.x86_64 1/1
Verifying : redis-5.0.5-1.el7.remi.x86_64 1/1
Installed:
redis.x86_64 0:5.0.5-1.el7.remi
Complete!
Enable the Redis service as follows.
[root@linuxhelp ~]# systemctl enable --now redis
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
Modify the configuration file of Redis server.
[root@linuxhelp ~]# vim /etc/redis.conf
Bind 0.0.0.0 (61 line)
Restart the service of Redis.
[root@linuxhelp ~]# systemctl restart redis
Check the status of Redis service.
[root@linuxhelp ~]# systemctl status redis
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Tue 2019-05-21 17:03:53 IST; 24s ago
Test the connection of redis-server using the command line interface.
[root@linuxhelp ~]# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> exit
With this, the nstallation of Redis server 5.0 on CentOS 7.6 comes to an end.
原文:https://www.linuxhelp.com/how-to-install-redis-5-on-centos-7-6
|