查看路径whereis redis

1.修改配置文件

vim /etc/redis.conf

 

 

这三个配置是必须的

修改内容,把 daemonize no 修改为:daemonize yes

 requirepass 123456 // 这个用来修改密码

 bind 0.0.0.0  // 这个用来绑定ip 原来是127.0.0.1

 

1.这是因为配置文件中,以守护进程方式启动,默认是关闭的,这是设置为允许以守护进程方式启动服务

2.启redis-server /etc/redis.conf看redis服务是否启动 另一种启动方式 ./redis-server /etc/redis.conf 

ps aux | grep redis

[root@localhost ~]# ps aux | grep redis
root 3339 0.1 0.5 139524 5208 ? Ssl 18:41 0:00 redis-server 127.0.0.1:6379
root 3343 0.0 0.0 103324 848 pts/0 S+ 18:41 0:00 grep redis

3.这时候再用命令

redis-cli

相关文章:

  • 2021-12-03
  • 2021-11-18
  • 2021-11-22
  • 2021-11-27
  • 2021-11-28
  • 2021-06-16
  • 2021-10-21
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2021-07-15
  • 2021-04-13
  • 2021-12-18
  • 2022-12-23
  • 2021-11-28
相关资源
相似解决方案