redis基础操作-连接,启动和停止

  1. 前提:
    1.   修改完使用配置文件启动之后,
  2. 启动:
    1.   [root@localhost bin]# ./redis-server redis.conf
  3. 查看redis进程:
    1. [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

  4. 关闭:
    1. [root@liyongsong bin]# ./redis-cli shutdown
    2. [root@liyongsong bin]# ps aux|grep redis
      1.     root     32199  0.0  0.0   6052   760 pts/0    S+   12:08   0:00 grep redis
    1. [root@localhost bin]# ./redis-cli
      1.   默认连接localhost运行在6379端口的redis服务。
    2. [root@localhost bin]# ./redis-cli -h 192.168.25.128 -p 6379

 

        -h:连接的服务器的地址

 

        -p:服务的端口号

 

posted @ 2020-03-31 09:00  宥宥美美  阅读(228)  评论(0)    收藏  举报