Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

The easiest way is to run the RNurse on Linux (and possibly Mac) is to use Docker via the script https://woky.pyr8.io:8080register.rdoctor.rchain-dev.tk/rnurse. This script just setup configuration and data directory for Filebeat and runs it from Docker. The script needs RDOCTOR_API_KEY, RDOCTOR_SESSION_KEY and RNODE_DATA_DIR variables to be set. RNODE_DATA_DIR must point the RNode data directory discussed above.

...

Code Block
curl -O https://woky.pyr8.io:8080register.rdoctor.rchain-dev.tk/rnurse
chmod +x rnurse
# set the following environment variables as described above
export RDOCTOR_API_KEY="...YOUR_API_KEY..."
export RDOCTOR_SESSION_KEY="...YOUR_SESSION_KEY..."
export RNODE_DATA_DIR="...YOUR_DATA_DIR..."
./rnurse

...

You may want to let the RNurse run in the background as system service. To set it up to run as systemd service you can run the following as root:

Code Block
curl -O https://woky.pyr8.io:8080register.rdoctor.rchain-dev.tk/rnurse >/usr/local/bin/rnurse
chmod +x /usr/local/bin/rnurse

mkdir /var/lib/rnurse
touch /var/lib/rnurse/env
chown 600 /var/lib/rnurse/env
cat >/var/lib/rnurse/env <EOF
export RDOCTOR_API_KEY="...YOUR_API_KEY..."
export RDOCTOR_SESSION_KEY="...YOUR_SESSION_KEY..."
export RNODE_DATA_DIR="...YOUR_DATA_DIR..."
EOF

cat >/usr/local/bin/rnurse.wrapper <EOF
#!/bin/sh -e
source /var/lib/rnurse/env
exec /usr/local/bin/rnurse
EOF
chmod +x /usr/local/bin/rnurse.wrapper

cat >/etc/systemd/system/rnurse.service <EOF
[Unit]
After=network.target
[Service]
ExecStart=/usr/local/bin/rnurse
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable rnurse
systemctl start rnurse

RNurse is now running as system daemon and will start and monitor the log file in $RNODE_DATA_DIR you specified on every boot. You may be thinking that systemd's EnvironmentFile could make this clearer and shorter. It could indeed if the systemd project was maintained by adults.

Filebeat


You can run Filebeat manually but you need to make sure the following configuration settings are set in filebeat.yml:

Code Block
setup.template.enabled: false
output.elasticsearch.hosts: ["https://woky.pyr8.io:9200elasticsearch.rdoctor.rchain-dev.tk"]
output.elasticsearch.headers.X-Rdoctor-Api-Key: "...YOUR_API_KEY..."
output.elasticsearch.headers.X-Rdoctor-Session-Key: "...YOUR_SESSION_KEY..."

...

Code Block
setup.template.enabled: false
filebeat.inputs:
- type: log
  multiline:
    pattern: '^.*? \['
    negate: true
    match: after
  paths:
  - /var/lib/rnode/rnode.log # ...YOUR_DATA_DIR...

output.elasticsearch:
  hosts: ["https://woky.pyr8.io:9200elasticsearch.rdoctor.rchain-dev.tk"]
  headers:
    X-Rdoctor-Api-Key: "...YOUR_API_KEY..."
    X-Rdoctor-Session-Key: "...YOUR_SESSION_KEY..."

...