cd /usr/local/src wget https://github.com/redis/redis/archive/6.2-rc2.tar.gz tar xf 6.2-rc2.tar.gz cd redis-6.2-rc2
groupadd redis adduser --system -g redis --no-create-home redis
mkdir -p /var/lib/redis chown redis: /var/lib/redis chmod 770 /var/lib/redis
mkdir /etc/redis cp /usr/local/src/redis-6.2-rc2/redis.conf /etc/redis/
vi /etc/redis/redis.conf
vi /etc/systemd/system/redis.service
[Unit] [Unit] Description=Redis Data Store After=network.target [Service] User=redis Group=redis ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf ExecStop=/usr/local/bin/redis-cli shutdown Restart=always [Install] WantedBy=multi-user.target
# Bật Redis : systemctl enable redis # Khởi động Redis : systemctl start redis # Kiểm tra trạng thái Redis : systemctl status redis