-
Notifications
You must be signed in to change notification settings - Fork 2
sex pomelo cli man page
- use
- quit
- kill
- exec
- get
- set
- add
- stop
- show
- enable
- disable
- addCron
- removeCron
- blacklist
- run
- execStr
- systemInfo
- nodeInfo
- monitorLog
use another server. takes serverId|all as argument
use {serverId|all}
then you will switch to serverId|all context
your command will be applied to serverId|all server
example: use area-server-1
example: use all
note: context is what your command will be applied to
type quit and you can quit pomelo-cli
kill all servers
example: **kill**
note: be carefull to use this command
exec script files
exec {filepath}
filepath can be relative path to your pomelo-cli pwd path
example : exec xxx.js
equals to : exec pwd/xxx.js
filepath also can be absolute with '/' ahead
example : exec /home/user/xxx.js
script file is executed through vm
vm context is
var context = {
app: this.app,
require: require,
os: require("os"),
fs: require("fs"),
process: process,
util: util
};
execute result is returned through result param
so in script files you should use result to get the return value
getCPUs.js
var cpus = os.cpus();
result = util.inspect(cpus,true,null);
equal to app.get(key)
get {key}
equal to app.set(key, value)
set {key} {value}
note: value must be string or simple value
add server to pomelo clusters
add args are key=value from servers.json config files
example: add host=127.0.0.1 port=3451 serverType=chat id=chat-server-2
example: add host=127.0.0.1 port=3152 serverType=connector id=connector-server-3 clientPort=3012 frontend=true
note: be careful to add server using right full args, otherwise the server will run in bad mode
stop server. takes serverId as argument
stop {serverId}
example: stop area-server-1
show infos like : servers, connections
you can show following informations:
servers, connections, logins, modules, status, proxy, handler, components, settings
example: show servers
example: show connections
example: show proxy
example: show handler
example: show logins
enable an admin console module or enable app settings
enable module {moduleId}
enable app {settings}
example: enable module systemInfo
example: enable app systemMonitor
disable an admin console module or disable app settings
disable module {moduleId}
disable app {settings}
example: disable module systemInfo
example: disable app systemMonitor
add cron for server' addCron args are key=value from crons.json config files
example: addCron id=8 serverId=chat-server-1 'time=0 30 10 * * *' action=chatCron.send
example: addCron id=8 serverType=chat 'time=0 30 10 * * *' action=chatCron.send
remove cron for server',
example: removeCron id=8 serverId=chat-server-1
example: removeCron id=8 serverType=chat
add blacklist for frontend server
example: blacklist 192.168.10.120 192.168.18.60
example: blacklist \b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b
run script in server
example: run app.get("sessionService").getSessionsCount()
example: run app.isMaster()
execStr script string
example: execStr "var cpus = os.cpus();result = util.inspect(cpus,true,null);"
get systemInfo
example: systemInfo
get nodeInfo
example: nodeInfo
get monitor Log
example: monitorLog <logfile prefix> <get line number>
example: monitorLog pomelo 100