Services

Systemd

Starting all programs manually is such a pain. So we are going to take a few minutes to create the systemd services.
Creating those services will allow a fully automated process that you will never have to do again if your node reboots.
Please set all the services provided here.

Astar/Shiden node

Prometheus

1
sudo touch /etc/systemd/system/prometheus.service
2
sudo nano /etc/systemd/system/prometheus.service
Copied!
1
[Unit]
2
Description=Prometheus Monitoring
3
Wants=network-online.target
4
After=network-online.target
5
6
[Service]
7
User=prometheus
8
Group=prometheus
9
Type=simple
10
ExecStart=/usr/local/bin/prometheus \
11
--config.file /etc/prometheus/prometheus.yml \
12
--storage.tsdb.path /var/lib/prometheus/ \
13
--web.console.templates=/etc/prometheus/consoles \
14
--web.console.libraries=/etc/prometheus/console_libraries
15
ExecReload=/bin/kill -HUP $MAINPID
16
17
[Install]
18
WantedBy=multi-user.target
Copied!

Node exporter

1
sudo touch /etc/systemd/system/node_exporter.service
2
sudo nano /etc/systemd/system/node_exporter.service
Copied!
1
[Unit]
2
Description=Node Exporter
3
Wants=network-online.target
4
After=network-online.target
5
6
[Service]
7
User=node_exporter
8
Group=node_exporter
9
Type=simple
10
ExecStart=/usr/local/bin/node_exporter
11
12
[Install]
13
WantedBy=multi-user.target
Copied!

Process exporter

1
sudo touch /etc/systemd/system/process-exporter.service
2
sudo nano /etc/systemd/system/process-exporter.service
Copied!
1
[Unit]
2
Description=Process Exporter
3
Wants=network-online.target
4
After=network-online.target
5
6
[Service]
7
User=process-exporter
8
Group=process-exporter
9
Type=simple
10
ExecStart=/usr/local/bin/process-exporter \
11
--config.path /etc/process-exporter/config.yml
12
13
[Install]
14
WantedBy=multi-user.target
Copied!

Alert manager

1
sudo touch /etc/systemd/system/alertmanager.service
2
sudo nano /etc/systemd/system/alertmanager.service
Copied!
1
[Unit]
2
Description=AlertManager Server Service
3
Wants=network-online.target
4
After=network-online.target
5
6
[Service]
7
User=alertmanager
8
Group=alertmanager
9
Type=simple
10
ExecStart=/usr/local/bin/alertmanager \
11
--config.file /etc/alertmanager/alertmanager.yml \
12
--storage.path /var/lib/alertmanager \
13
--web.external-url=http://localhost:9093 \
14
--cluster.advertise-address='0.0.0.0:9093'
15
16
[Install]
17
WantedBy=multi-user.target
Copied!

Grafana

Grafana’s service is automatically created during the extraction of the deb package, you do not need to create it manually.
Now it's getting exciting! We are going to fire up everything. In case of any errors in a file, go back some steps and check if you haven't missed anything.
If you really don't know what's wrong. Join our Discord, where we provide you with support.