Skip to content

Commit 4716686

Browse files
authored
Merge pull request #4 from maticnetwork/grafana-update
Grafana update
2 parents 213e8b7 + a4c8c53 commit 4716686

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,65 @@ Monitor your Heimdall, Bor and Virtual machine node with Prometheus and Grafana
88

99
**Step 1:**
1010

11+
By default these changes should have already been made as part of your node setup but incase they're not, you can follow the steps below
12+
1113
You will need to change `prometheus` flag to `true` in the `config.toml`.
1214

1315
To access the config.toml here:
1416

15-
**Linux Packages**: `sudo vi /etc/heimdall/config/config.toml`
16-
**Binaries**: `vi ~/.heimdalld/config/config.toml`
17-
18-
By default the prometheus flag is set to `false`.
17+
`vi ~/.heimdalld/config/config.toml`
1918

2019
Make sure that you keep the formatting intact.
2120

2221
**Step 2:**
2322

24-
Once you have made the changes in the `config.toml` you will need to stop Heimdall service and restart it.
23+
Once you have made the changes in the `config.toml` you will need to stop Heimdall service and restart it. Note that you only need to restart Heimdall service if you have made changes to it.
2524

2625
To stop heimdall service:
2726

28-
**Linux Packages**: `sudo service heimdalld stop`
29-
**Binaries**: `pkill heimdalld`
27+
`sudo service heimdalld stop`
3028

3129
To restart heimdall service:
3230

33-
**Linux Packages**: `sudo service heimdalld start`
34-
**Binaries**: `heimdalld start`
31+
`sudo service heimdalld start`
3532

3633
**Step 3:**
3734

3835
You will make changes in the Bor service file. To access the `bor.service` file you can run this command:
3936

40-
`locate bor.service`
37+
`nano /home/ubuntu/node/bor/start.sh`
4138

42-
There would be multiple entries. You will need to edit the file in this system path: `/etc/systemd/system/bor.service`
39+
There would be multiple entries. By default the following parameters should be automatically added, but if they're not added then you can the parameters from below.
4340

44-
To edit the service file you can run the following command:
41+
Now in this you would see multiple paramaters in a list format. Add this in the following format. You can add it anywhere, for example, you can add it after `--maxpeers 150`
4542

46-
`sudo nano /etc/systemd/system/bor.service`
43+
```js
44+
--metrics \
45+
--pprof --pprofport 7071 --pprofaddr '0.0.0.0' \
46+
```
4747

48-
Now in this you would see `ExecStart=/bin/bash` with multiple paramaters in line to it. Add this, `--metrics --pprof --pprofport 7071 --pprofaddr 0.0.0.0` to this line of paramaters. You can add it anywhere, for example, you can add it after `--maxpeers 150`
48+
Note that these parameters should already be added as part of your setup. You only need to add these parameters if they're not already present in the `start.sh` file.
4949

5050
You need to make sure that the spaces and formatting are intact.
5151

5252
Now you will notice that your bor will stop because we made changes to the service file. You will need to stop the bor service and restart it.
5353

5454
To Stop Bor service:
5555

56-
**Linux Packages**: `sudo service bor stop`
57-
**Binaries**: `pkill bor`
56+
`sudo service bor stop`
5857

5958
Note: When you stop the service of Bor you may encounter a warning asking you run `systemctl daemon-reload` to reload units.
6059

6160
You will need to run this as `sudo systemctl daemon-reload`. Once this is successfull you can proceed with starting the Bor service.
6261

6362
To Restart Bor service:
6463

65-
**Linux Packages**: `sudo service bor start`
66-
**Binaries**: `bash start.sh <Your Ethereum wallet address>`
64+
`sudo service bor start`
6765

68-
Note: You will need to use the same Address that you used when you had initially set up your node.
6966

7067
**Step 4:**
7168

72-
Clone the Prometheus repository to your local machine
69+
Clone the Prometheus repository to your remote machine
7370

7471
`git clone https://github.com/maticnetwork/node-prometheus.git`
7572

@@ -81,6 +78,14 @@ Then install Docker by running the following command:
8178

8279
Once Docker is installed then you run docker by running the following command to start Prometheus: `sudo docker-compose up -d`
8380

81+
Note: If you're getting an error after running `docker-compose up -d` please run the following commands on your remote machine
82+
83+
`sudo usermod -aG docker ubuntu`
84+
85+
`newgrp docker`
86+
87+
And then you can run `docker-compose up -d` again.
88+
8489
**Step 5:**
8590

8691
Open Grafana at following URL:
@@ -128,7 +133,7 @@ Grafana uses web based APIs to connect to prometheus server for indexed data. Fo
128133
![Screenshot 2020-04-03 at 4 50 14 PM](https://user-images.githubusercontent.com/31979627/78356289-e856c400-75cc-11ea-86da-e94d742a07f7.png)
129134

130135

131-
3. Change the HTTP url to http://host_ip:9090 and save. After the success message, go to Grafana home:
136+
3. Change the HTTP url to http://host_ip:9090 and save. Make sure `9090` port is open. Click on `Save and Test` button to chek if the connection is a success. After the success message, go to Grafana home:
132137

133138

134139
![Screenshot 2020-04-03 at 5 14 53 PM](https://user-images.githubusercontent.com/31979627/78357564-4dabb480-75cf-11ea-9c9c-f6e8daadec47.png)
@@ -151,4 +156,3 @@ Grafana uses web based APIs to connect to prometheus server for indexed data. Fo
151156

152157
![Screenshot 2020-04-07 at 1 23 18 PM](https://user-images.githubusercontent.com/31979627/78644461-89969080-78d3-11ea-9123-8587653c9d9a.png)
153158

154-

0 commit comments

Comments
 (0)