November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

How to install redis server on CentOS 7 / RHEL 7

How to install redis server on CentOS 7 / RHEL 7

wget -r –no-parent -A ‘epel-release-*.rpm’ http://dl.fedoraproject.org/pub/epel/7/x86_64/e/
rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-*.rpm

or

yum install epel-release

install redis server

Now use yum command to install redis server

yum install redis

Two important redis server configuration file’s path
1. /etc/redis.conf
2. /etc/redis-sentinel.conf

To start redis server

systemctl start redis.service
To stop redis server

systemctl stop redis.service
To restart redis server

systemctl restart redis.service
To get running status of redis server

systemctl status redis.service
To enable redis server at system’s booting time.

systemctl enable redis.service
To disable redis server at system’s booting time.

systemctl disable redis.service

check its active

systemctl is-active redis.service

[root@clusterserver1 ~]# redis-cli ping
PONG
[root@clusterserver1 ~]#

[root@clusterserver1 ~]# ss -nlp | grep redis
tcp    LISTEN     0      128    127.0.0.1:6379                  *:*                   users:((“redis-server”,pid=10250,fd=4))
[root@clusterserver1 ~]#

 

[root@clusterserver1 ~]# redis-cli
127.0.0.1:6379>
127.0.0.1:6379>
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set mykey somevalue
OK
127.0.0.1:6379> get mykey
“somevalue”

127.0.0.1:6379> set aaa 111
OK
127.0.0.1:6379> get aaa
“111”
127.0.0.1:6379> quit

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>