Grafana in digitalocean is an open-source data visualization and monitoring tool that integrates with complex data.
As part of our Digitalocean managed service, Bobcares responds to all inquiries, no matter how big or small.
Let’s take a closer look at Grafana in digitalocean’s specifics.
Grafana in digitalocean
Grafana is a free data visualisation and monitoring tool that works with complicated data from Prometheus, InfluxDB, Graphite, and ElasticSearch. This allows us to build alerts, notifications, and ad-hoc filters for our data, as well as facilitating collaboration with our colleagues via built-in sharing options.
Installing Grafana
- Firstly, use
wget
to download the Grafana GPG key, then pipe the output toapt-key
.wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
- Then, in the APT sources, add the Grafana repository:
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
- To keep our package listings up to date, we need to refresh the APT cache:
sudo apt update
- Then, we can begin the installation:
sudo apt install grafana
- Once Grafana is installed, start the Grafana server with systemctl:
sudo systemctl start grafana-server
- Then, check the status of Grafana to see if it’s up and running:
sudo systemctl status grafana-server
- Finally, set the service to launch Grafana automatically when the server boots up:
sudo systemctl enable grafana-server
Grafana is up and running and ready to use right now. After that, we’ll protect our connection to Grafana with a reverse proxy and an SSL certificate.
Configuring the Reverse Proxy
By encrypting the connection to and from Grafana, an SSL certificate will ensure that our data is secure. However, in order to leverage this connection, we must first configure Nginx as a reverse proxy for Grafana.
- Firstly, go to the Nginx configuration file and open it.
sudo nano /etc/nginx/sites-available/domain_name
- Then, in this
location block
, delete the existingtry_files
line and replace it with the
proxy_pass
option:proxy_pass http://localhost:3000;
- Then, use CTRL+X, Y, and ENTER to save and close the file.
- Now test the modified settings to ensure that everything is working properly:
sudo nginx -t
- Finally, reload Nginx to activate the changes:
sudo systemctl reload nginx
- By typing https://domain_name into our web browser, we can now view the default Grafana login screen. If we can’t connect to Grafana, double-check that our firewall is set to allow traffic on port 443, then retrace the steps above.
Credentials Updating
Because every Grafana installation utilises the same administrative credentials by default, changing our login information as soon as feasible is a smart practise.
- Firstly, open a web browser and go to https://domain_name.
- On the default login screen, the Grafana logo, a form asking for an Email or username and password, a Log in button, and a Forgot our password link will appear.
- Then, in the Email or username and Password fields, type admin.
- Then click on the Log in button.
- On the next screen, we’ll be asked to change the default password to make our account more secure:
- In the New password and Confirm new password fields, type the password we want to use.
- We can either click Submit to save the new information or skip this step by pressing Skip.
- Click Submit to increase the security of our Grafana setup. We’ll go to the Grafana dashboard’s Welcome page.
Disable Grafana Registrations and Anonymous access.
Visitors can create user accounts for themselves and preview dashboards without registering with Grafana. We may want to enable these features when Grafana is not accessible via the internet or when it is working with publicly available data, such as service statuses. However, when working with sensitive data in Grafana online, anonymous access may pose a security risk. Make some changes to our Grafana configuration to resolve this issue.
- Firstly, edit Grafana’s main configuration file:
sudo nano /etc/grafana/grafana.ini
- Then, Under the
[users]
heading, look for theallow_sign_up
directive:... [users] # disable user signup / registration allow_sign_up = false ...
- When this directive is set to
true
, it adds a Sign Up button to the login screen, allowing users to register and access Grafana. By setting this directive tofalse
, we can remove the - Remove the
;
at the beginning of the line to uncomment this directive, and then set the option tofalse
. - Then, under the
[auth.anonymous]
heading, look for theenabled
directive:... [auth.anonymous] # enable anonymous access ;enabled = false ...
- When
enabled
is set totrue
, non-registered users can access our dashboards. When set tofalse
, only registered users can access our dashboards.Remove the
;
at the beginning of the line and set the option tofalse
to uncomment this directive. - Finally, Exit the text editor after saving the file.
- Restart Grafana to see the changes take effect:
sudo systemctl restart grafana-server
- Check Grafana’s service status to make sure everything is working:
sudo systemctl status grafana-server
As before, the output will indicate that Grafana is active (running)
.
[Looking for a solution to another query? We are just a click away.]
Conclusion
To sum up, our Support team went over the specifics of Grafana in digitalocean.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments