码迷,mamicode.com
首页 > 系统相关 > 详细

ubuntu 16.04.1 LTS redis安装配置

时间:2017-10-17 16:39:00      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:chm   star   配置文件   用户和组   sse   status   load   安装   redis安装配置   

编译安装:
apt-get update
apt-get install build-essential tcl
wget http://download.redis.io/redis-stable.tar.gz
tar xf redis-stable.tar.gz
cd redis-stable;make;make install

配置文件:
cp /root/work/redis-stable/redis.conf /etc/redis
vi /etc/redis/redis.conf
supervised systemd
dir /data/redis

启动脚本:
vi /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

用户和组:
adduser --system --group --no-create-home redis

目录和权限:
mkdir /data/redis
chown redis:redis /data/redis
chmod 770 /data/redis

启动和关闭:
systemctl start redis
systemctl status redis
systemctl stop redis
systemctl restart redis

测试redis:
redis-cli
127.0.0.1:6379> ping
PONG

测试都通过后,设置开机启动redis:
systemctl enable redis

ubuntu 16.04.1 LTS redis安装配置

标签:chm   star   配置文件   用户和组   sse   status   load   安装   redis安装配置   

原文地址:http://www.cnblogs.com/zhaojonjon/p/7682172.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!