-
Notifications
You must be signed in to change notification settings - Fork 383
Pinus daemon usage
Pinus-daemon provides a daemon service for distributed deployment of pinus application and collecting RPC logs of servers.
$ npm install -g pinus-daemon
-
Deploy codes on all the servers of the server cluster;
-
Configure servers.json to right host;
-
Add daemon.json configuration file into game-server/config, A sample of daemon.json is shown as follows:
{
"id": "dh37fgj492je",
"key": "agarxhqb98rpajloaxn34ga8xrunpagkjwlaw3ruxnpaagl29w4rxn",
"algorithm": "sha256",
"user": "pinus"
}
Note: pinus-daemon uses hawk to provide authentication between servers.
- Change current directory to game-server;
- Execute the following command in the master server:
pinus-daemon
- In other servers, execute:
pinus-daemon --mode=server
Note: You can use nohup to deploy daemon as follows:
nohup pinus-daemon - mode = server
- Then in the master server run the following command under pinus-daemon client:
start all
- After all above, the pinus server cluster is launched.
pinus-daemon provides a pinus rpc logs collector to synchronize the the rpc logs to mongodb, then it can be analyzed by [pinus-admin-web] (https://github.com/node-pinus/pinus-admin-web).
- Add mongo.json configuration file into game-server/config, A sample of mongo.json is shown as follows:
{
"host": "localhost",
"port": 27017,
"username": "pinus",
"password": "pinus",
"database": "test",
"collection": "cpinus"
}
- Enable pinus-daemon rpc logger collecting by setting
--pattern
parameter to rpc-log:
pinus-daemon --mode=server --log - pattern = rpc-log
Note: RPC logs collected here is only used for debugging in development environment, it is not recommended to enable RPC logs in production environemnt.