redis基础操作-连接,启动和停止
- 前提:
- 修改完使用配置文件启动之后,
- 启动:
- [root@localhost bin]# ./redis-server redis.conf
- 查看redis进程:
- [root@localhost bin]# ps aux|grep redis
root 5190 0.1 0.3 33936 1712 ? Ssl 18:23 0:00 ./redis-server *:6379
root 5196 0.0 0.1 4356 728 pts/0 S+ 18:24 0:00 grep redis
- 关闭:
- [root@liyongsong bin]# ./redis-cli shutdown
- [root@liyongsong bin]# ps aux|grep redis
- root 32199 0.0 0.0 6052 760 pts/0 S+ 12:08 0:00 grep redis
- [root@localhost bin]# ./redis-cli
- 默认连接localhost运行在6379端口的redis服务。
- [root@localhost bin]# ./redis-cli -h 192.168.25.128 -p 6379
-h:连接的服务器的地址
-p:服务的端口号

浙公网安备 33010602011771号