Install Redis Cache on CentOS 7

Install Redis Cache pada CentOS 7

  • Update repository package & install repository epel
yum update -y && yum install epel-release nano wget -y
  • Install Redis cache
yum install redis -y
  • Setting kernel overcommit memory, tambahkan baris berikut pada bagian bawah: vm.overcommit_memory = 1
nano /etc/sysctl.conf
sysctl vm.overcommit_memory=1

  • Konfigurasi Resdis cache, tambahkan bind IP private: bind 127.0.0.1 10.123.210.20 , default port 6379
cp /etc/redis.conf /etc/redis.conf.orig
nano /etc/redis.conf 
  • Restart service redis
systemctl start redis
systemctl enable redis
systemctl status redis
  • Cek interface dan listening port redis
netstat -tulpn | grep 6379

tcp        0      0 10.123.210.20:6379      0.0.0.0:*               LISTEN      830/redis-server 12
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      830/redis-server 12
  • Jika menggunakan firewalld harus allow port 6379
firewall-cmd --permanent --zone=public --add-port=6379/tcp 
firewall-cmd  --reload
  • Test Redis cache
redis-cli

127.0.0.1:6379> client list
id=3 addr=127.0.0.1:36172 fd=6 name= age=34 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
127.0.0.1:6379>

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.