安装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学习笔记#0:Centos7安装Redis并设置为后台启动

启动

./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-cli -p 6379 shutdown

 

相关文章:

  • 2021-11-05
  • 2021-06-10
  • 2022-12-23
  • 2021-06-13
  • 2021-10-05
  • 2022-02-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-05
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案