1 查看服務器上啟動的redis服務
開了兩個redis單機服務,監聽在兩個端口。
開了一個集群,監聽在6個端口。
[root@localhost bin]# ps aux | grep redis | grep -v grep root 22033 0.0 0.0 95432 3804 ? Ssl 2016 6:49 /usr/local/bin/redis3.0.2-server *:7000 [cluster] root 22053 0.0 0.0 95432 2664 ? Ssl 2016 6:44 /usr/local/bin/redis3.0.2-server *:7001 [cluster] root 22057 0.0 0.0 95432 3820 ? Ssl 2016 6:48 /usr/local/bin/redis3.0.2-server *:7002 [cluster] root 22061 0.0 0.0 95432 2640 ? Ssl 2016 6:45 /usr/local/bin/redis3.0.2-server *:7003 [cluster] root 22065 0.0 0.0 95432 3892 ? Ssl 2016 6:44 /usr/local/bin/redis3.0.2-server *:7004 [cluster] root 22069 0.0 0.0 95432 2612 ? Ssl 2016 6:43 /usr/local/bin/redis3.0.2-server *:7005 [cluster] root 30263 0.0 0.7 214112 57336 ? Ssl 2016 48:43 /usr/local/bin/redis-server *:6380 root 30267 0.0 0.0 95328 2232 ? Ssl 2016 7:26 /usr/local/bin/redis-server *:6381
2 按端口起服務
redis的服務端為./src/redis-server。啟動方式為./src/redis-server /path/to/redis.conf
在redis.conf里有指定監聽端口。
[root@redis1-20 redis-3.0.6]# ./src/redis-server 6380.conf [root@redis1-20 redis-3.0.6]# ./src/redis-server 6381.conf [root@redis1-20 ~]# ps aux | grep redis root 2966 0.1 0.1 131248 1912 ? Ssl 15:34 0:00 ./src/redis-server *:6380 root 2995 0.0 0.1 131248 1908 ? Ssl 15:35 0:00 ./src/redis-server *:6379 #conf文件里的port參數修改為想要的端口,daemonize要改為yes。然后指定端口啟動
