centos 7.6 に redis を構築します
# Update package list
$ sudo yum update -y
# Install redis
$ sudo yum install -y redis
# Show redis.service
$ $ cat /usr/lib/systemd/system/redis.service
[Unit]
Description=Redis persistent key-value database
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop=/usr/libexec/redis-shutdown
Type=notify
User=redis
Group=redis
RuntimeDirectory=redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
# Start redis
$ sudo systemctl start redis
# ping
$ redis-cli -p 6379
127.0.0.1:6379> ping
PONG
$ sudo vi /etc/redis.conf
requirepass <password>
$ sudo systemctl restart redis
$ redis-cli
127.0.0.1:6379> AUTH <password>
OK
127.0.0.1:6379> ping
PONG