librelist archives

« back to archive

m2sh control_port使用方法

m2sh control_port使用方法

From:
free
Date:
2012-05-29 @ 07:40
如果修改了正在运行的monserver的配置,可按以下方式通过control port重启 
monserver

free@free:~/dev$ cd monserver
free@free:~/dev/monserver$ m2sh      #启动m2sh到交互模式
monserver> load                                   #加载修改后的config.lua
[WARN] (errno: None) No option --db given, using "config.sqlite" as the 
default.
[WARN] (errno: None) No option --config given, using "config.lua" as the 
default.
load server [lgcms]
load server [xinst]
load server [monitor]
[WARN] (errno: No such file or directory) RETURN:load config success
monserver> control --name monitor     #链接到运行的服务
[INFO] Connecting to control port ipc://.//run/control
m2 [monitor]> reload                             #重新加载服务
[INFO] (src/task/fd.c:151) MAX limits.fdtask_stack=102400
[INFO] (src/superpoll.c:279) Could not force NOFILE higher, you'll need 
to run as root: Operation not permitted
[INFO] (src/superpoll.c:285) MAX open file descriptors is 1024 now.
[INFO] (src/superpoll.c:102) Allowing for 256 hot and 768 idle file 
descriptors (dividend was 4)
msg:  signal sent to server
m2 [monitor]>

m2 [monitor]> help   #下面是可使用的控制命令
name  help
stop  stop the server (SIGINT)
reload  reload the server
help  this command
control_stop  stop control port
kill  kill a connection
status  status, what=['net'|'tasks']
terminate  terminate the server (SIGTERM)
time  the server's time
uuid  the server's uuid
info  information about this server

m2 [monitor]> info  #服务器信息
port:  6770
bind_addr:  0.0.0.0
uuid:  505417b8-1de4-454f-98b6-07eb9225cca3
chroot:  ./
access_log:  logs/access-1.log
error_log:  logs/error-1.log
pid_file:  run/monserver.pid
default_hostname:  monitor
m2 [monitor]>