安装redis centos7.2 redis 3.06

cd /usr/local/src

wget http://download.redis.io/releases/redis-3.0.6.tar.gz

tar -zxvf redis-3.0.6.tar.gz

cp -r redis-3.0.6 /usr/local/redis/

make&&make install

make test

运行redis test

yum install tcl

make install

redis-server /usr/local/redis/redis.conf

redis-cli

sudovim /usr/lib/systemd/system/redis.service

写入如下内容,具体文件路径,各异。

[Unit]

Description=Redis

After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]

Type=forking

PIDFile=/usr/local/redis/redis.pid

ExecStart=/usr/local/redis/src/redis-server /usr/local/redis/redis.conf

ExecReload=/bin/kill-s HUP $MAINPID

ExecStop=/bin/kill-s QUIT $MAINPID

PrivateTmp=true

[Install]

WantedBy=multi-user.target
  1. 重载系统服务

systemctl daemon-reload

  1. 启动redis

systemctl start redis

你可能感兴趣的:(安装redis centos7.2 redis 3.06)