Nothing Special   »   [go: up one dir, main page]

Skip to content
mike edited this page Dec 25, 2017 · 2 revisions

Pinus-daemon provides a daemon service for distributed deployment of pinus application and collecting RPC logs of servers.

Installation

$ npm install -g pinus-daemon

Usage

Starting Pinus Server Cluster

  • 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.

Collecting RPC Logs

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.

Clone this wiki locally