Tuesday, August 31, 2021

.::: How To Install Database Redis on Centos 7 :::.



1. Enable repository

[root@teguhth data]# yum -y install epel-release yum-utils
[root@teguhth data]# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@teguhth data]# yum-config-manager --enable remi
[root@teguhth data]# 

2. Install redis 
[root@teguhth data]# yum install redis -y
[root@teguhth data]# rpm -qa | grep redis
redis-6.2.5-1.el7.remi.x86_64
[root@teguhth data]# 


3. Enable booting & start 
[root@teguhth data]# systemctl start redis
[root@teguhth data]# systemctl enable redis
Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.
[root@teguhth data]# 

4. Konfigurasi Remote Access Redis

Temukan baris yang dimulai dengan bind 127.0.0.1 :: 1 dan ganti 127.0.0.1 dengan 0.0.0.0.

[root@teguhth data]# cat /etc/redis/redis.conf | grep 0.0.0.0
# 1g => 1000000000 bytes
bind 0.0.0.0::1
[root@teguhth data]# 
[root@teguhth data]# 

5. restart redist
[root@teguhth data]# systemctl restart redis
[root@teguhth data]#

6. testing 
[root@teguhth data]# redis-cli -h localhost ping
PONG
[root@teguhth data]# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> ping hahaha
"hahaha"
127.0.0.1:6379> 

127.0.0.1:6379> set test "redist is working"
OK
127.0.0.1:6379> get test
"redist is working"
127.0.0.1:6379> 

No comments:

Post a Comment

Popular Posts