highly recommended
https://redis.io/topics/quickstart
#Ubuntu 16.04
#下载压缩包,并解压
make
make install
cp src/redis-server /usr/local/bin/
cp src/redis-cli /usr/local/bin/
mkdir /etc/redis
mkdir /var/redis
cp utils/redis_init_script /etc/init.d/redis_6379
vi /etc/init.d/redis_6379 #修改开机自启脚本,如有必要,修改端口信息
mkdir /var/redis/6379
#修改配置文件
cp redis.conf /etc/redis/6379.conf
vi /etc/redis/6379.conf
#Set daemonize to yes (by default it is set to no).
#Set the pidfile to /var/run/redis_6379.pid (modify the port if needed).
#Change the port accordingly. In our example it is not needed as the default port is already 6379.
#Set your preferred loglevel.
#Set the logfile to /var/log/redis_6379.log
#Set the dir to /var/redis/6379 (very important step!)
#启动开机自启脚本
service redis_6379 start
#CentOS7
chkconfig --add /etc/init.d/redis_6379
chkconfig redis_6379 on
#Ubuntu16.04
service redis_6379 start