开启&关闭各种服务

开启&关闭

Mac版

查找被占用的8080端口,根据pid杀掉进程

查找8080端口 losf -i:8080
根据pid杀掉进程 kill -9 pid

iMac:~ acui$ lsof -i:8080
COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
java    62948 ting   93u  IPv6 0x6697d67f7b95e1c1      0t0  TCP *:glrpc (LISTEN)
iMac:~ acui$ kill -9 62948

启动和关闭zookeeper服务

启动服务 ./zkServer.sh start
关闭服务 ./zkServer.sh stop

iMac:~ acui$ cd zookeeper-3.4.13/bin
# 启动服务
iMac:bin acui$ ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /Users/acui/zookeeper-3.4.13/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
# 关闭服务
iMac:bin acui$ ./zkServer.sh stop
ZooKeeper JMX enabled by default
Using config: /Users/acui/zookeeper-3.4.13/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED

参考:ZooKeeper Getting Started Guide

启动和关闭redis服务

iMac:~ acui$ cd /usr/local/redis-3.2.12/src
iMac:src acui$ redis-server
3354:C 18 Feb 18:45:47.391 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
3354:M 18 Feb 18:45:47.393 * Increased maximum number of open files to 10032 (it was originally set to 256).
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.2.12 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 3354
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

3354:M 18 Feb 18:45:47.398 # Server started, Redis version 3.2.12
3354:M 18 Feb 18:45:47.398 * The server is now ready to accept connections on port 6379

# 强行关闭
iMac:~ acui$ ps axu|grep redis
acui              3599   0.3  0.0  2442020   1936 s002  S+    6:53下午   0:00.00 grep redis
acui              3354   0.0  0.0  2462204   3188 s001  S+    6:45下午   0:00.30 redis-server *:6379
iMac:~ acui$ kill -9 3354

# 命令关闭

参考:mac下redis安装、设置、启动停止

启动activemq服务

iMac:~ acui$ sudo activemq start
Password:
INFO: Loading '/usr/local/Cellar/activemq/5.15.8/libexec//bin/env'
INFO: Using java '/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/java'
INFO: Starting - inspect logfiles specified in logging.properties and log4j.properties to get details
INFO: pidfile created : '/usr/local/Cellar/activemq/5.15.8/libexec//data/activemq.pid' (pid '4195')

参考:mac 使用Homebrew安装ActiveMQ

Linux版

猜你喜欢

转载自www.cnblogs.com/acuii/p/10398933.html
今日推荐