安装redis
$ wget http://download.redis.io/releases/redis-5.0.5.tar.gz $ tar xzf redis-5.0.5.tar.gz $ cd redis-5.0.5 $ make
如果遇到错误cc command not found执行下面命令
sudo yum -y install gcc gcc-c++ libstdc++-devel make MALLOC=libc
配置后台运行
vim redis.conf 搜索daemonize 修改为daemonize yes 保存
启动
./redis-server ./redis-cli redis> set foo bar OK redis> get foo "bar"
设置redis日志目录
vim redis.conf
logfile "/home/redis-5.0.5/redis.log"
关闭redis
./redis-cli -p 6379 shutdown