redis相對於memcached,支持更多類型的數據。Mecached只支持string類型的數據,但Redis除了支持string外,還支持hash,set,list,zset(有序集合) redis
wget http://download.redis.io/releases/redis-5.0.3.tar.gz
tar zxf redis-5.0.3.tar.gz
cd redis-5.0.3
make
make installmemcached
cat >>/usr/lib/systemd/system/redis.service <<EOF
[Unit]
Description=Redis
After=network.targetspa
[Service]
Type=forking
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
#use command which redis-server,we can see redis path
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=trueserver
[Install]
WantedBy=multi-user.target
EOFip
ln -s /usr/lib/systemd/system/redis.service /etc/systemd/system/multi-user.target.wants/redis.service
systemctl daemon-reload
systemctl start redisget