前端之家收集整理的这篇文章主要介绍了
ubuntu16.04安装redis,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
sudo tar -zxvf redis-3.2.8.tar.gz
sudo apt-get install gcc
cd redis-3.2.8
sudo make
sudo make install
sudo mkdir /etc/redis
sudo cp /home/wms/redis-stable/redis.conf /etc/redis
sudo vim /etc/redis/redis.conf
supervised systemd
dir /var/lib/redis
sudo vim /etc/systemd/system/redis.service
[Unit]
Description=Redis In-Memory 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
sudo adduser --system --group --no-create-home redis
sudo mkdir /var/lib/redis
sudo chown redis:redis /var/lib/redis
sudo chmod 770 /var/lib/redis
sudo systemctl start redis
sudo systemctl enable redis
sudo systemctl restart redis
redis-cli
原文链接:https://www.f2er.com/ubuntu/352672.html