IP6M-nodejs server

IP6M-nodejs server

IP6M has a NodeJS based daemon component which provides websocket interface to frontend clients. Websocket creates permanent connection from the web client to the server, allowing bi-directional data communication on a single TCP channel. This is very useful for near real-time data visualisation because the client doesn't have to poll the server with expensive http requests frequently. IP6M uses this mechanism for RRD data graphing and other functions.

The NodeJS server is installed under

/var/www/drupal8/ip6m-nodejs

directory.

The Systemd startup file, that is created by the Ansible plyabook is the following:

[Unit]
Description=IP6M-nodejs
Documentation=https://ip6m.net/documentation
After=network.target

[Service]
Environment=DRUPAL_URL=https://test.ip6m.net/
Environment=NODE_PORT=8082
Environment=RRD_DIRECTORY=/var/www/drupal8/private/rrdbot/db
Environment=TIMEZONE_OFFSET=0
Type=simple
User=www-data
WorkingDirectory=/var/www/drupal8/ip6m-nodejs
StandardOutput=file:/var/log/ip6m-nodejs.sys.log
StandardError=file:/var/log/ip6m-nodejs.error.log
ExecStart=/usr/local/bin/yarn serve
Restart=on-failure

[Install]
WantedBy=multi-user.target

 

The Server can be controlled by the "service" command:

$ sudo service ip6m-nodejs [start|stop|restart|status]

 

thomas Fri, 10/04/2019 - 16:42