Setup and Configure Observability tool – Grafana

Setup and Configure Observability tool – Grafana


1.???? Connect to your AWS EC2 (Ubuntu Linux) instance

?2.???? Use the following command to become the root user on your Ubuntu EC2 instance.

$ sudo su        

?3.???? On the Linux console, use the following commands to install the MySQL database service.

$ apt-get update

$ apt-get install mysql-server        

?4.???? Type below command to access the MySQL command line. If prompted for password (for first time users), enter new password of your choice!

$ mysql -u root -p        

?5.???? Use the following SQL command to create a database named grafana.

CREATE DATABASE grafana CHARACTER SET UTF8 COLLATE UTF8_BIN;        

?6.???? Use the following SQL command to create a database user named grafana with password as Chaos123 (or any other password of your choice).

CREATE USER 'grafana'@'%' IDENTIFIED BY 'Chaos123';        

?7.???? Give the SQL user named grafana permission over the database named grafana.

GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'%';

quit;        

?8.???? On the Linux console, use the following commands to configure the Grafana APT repository.

$ mkdir /downloads/grafana -p

$ cd /downloads/grafana

$ wget https://packages.grafana.com/gpg.key

$ apt-key add gpg.key

$ add-apt-repository 'deb [arch=amd64,i386] https://packages.grafana.com/oss/deb stable main'

$ apt-get update        

?9.???? Use the following command to install Grafana.

$ apt-get install grafana        

?10.? Edit the Grafana configuration file grafana.ini.

$ vi /etc/grafana/grafana.ini        

?11.? Make the following configuration changes under the [Database] and [Session] sections. Please note that you need to change the MySQL username and password to reflect your environment.

[database]

type = mysql

host = 127.0.0.1:3306

name = grafana

user = grafana

password = Chaos123

[session]

provider = mysql

provider_config = grafana:Chaos123@tcp(127.0.0.1:3306)/grafana        

?12.? Use the following command to start the Grafana service.

$ ?service grafana-server start        

?13.? The Grafana service will start listening on TCP port 3000. Use the following command to see Grafana logs and verify if everything is working.

$ cat /var/log/grafana/grafana.log

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing ServerLockService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing UsageStatsService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing UserAuthTokenService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing CleanUpService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing NotificationService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing ProvisioningService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing TracingService" logger=server

t=2022-06-23T01:50:56+0000 lvl=info msg="Initializing Stream Manager"

t=2022-06-23T01:50:56+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=

t=2022-06-23T01:50:57+0000 lvl=info msg="cleanup of expired auth tokens done" logger=auth count=0        

?14.???? Open your browser and enter the Public IP address of your server plus :3000. In my case, the following URL was entered in the browser: https://15.206.250.8:3000/

The Grafana web interface should be launched!

Grafana Launch

15.???? On the prompt screen, enter the Grafana Default Password login information.

? Username: admin

? Password: admin

The system will ask you to change the Grafana default password.

?16.???? After a successful login using the new password, the Grafana dashboard will be launched.

Grafana Homepage


要查看或添加评论,请登录

Vishal Mehta的更多文章

  • Observability in Chaos Engineering

    Observability in Chaos Engineering

    “To acquire knowledge, one must study; but to acquire wisdom, one must observe” - Marilyn vos Savant Before we define…

    2 条评论
  • Fundamentals of Chaos Engineering

    Fundamentals of Chaos Engineering

    "Our real discoveries come from Chaos, from going to place that looks wrong, stupid and foolish" - Chuck Palahniuk…

  • I would never ever give up!

    I would never ever give up!

    'Remember one thing Vishal, it's not how you start the race, nor what happens in the middle of the race, but it's how…

  • Hype the work you do!

    Hype the work you do!

    Lot of times my friends put up questions to me like 'how have you reached to high-ranking position so early in your…

    2 条评论

社区洞察