Install pghero on centos 7 – A performance dashboard for Postgres
In this tutorial I will show you how to install pghero on centos 7.
A performance dashboard for Postgres – health checks, suggested indexes, and more. PgHero 2.0 provides, even more, insight into your database performance with two additional features: query details and space stats.
PgHero makes it easy to see the most time-consuming queries during a given time period, but it’s hard to follow an individual query’s performance over time. When you run into issues, it’s not always easy to uncover what happened. Are the top queries during an incident consistently the most time-consuming, or are they new? Did the number of calls increase or was it the average time?
- Centos 7 must be installed
- Postgres Server must be installed
You might also like: How to install postgres 9.6 on centos 7 /redhat 7
Download pghero for centos 7
In this step we will create pghero repo file and add pghero repo url.
# wget -O /etc/yum.repos.d/pghero.repo \
# yum -y install pghero
We have installed pghero now its time to set it up and get it running.
In this step we will add database that we want to view the performance. I am adding my local postgres database in pghero. You need to replace the user, password, port, hostname and database name with yours.
# pghero config:set DATABASE_URL=postgres://postgres:[email protected]:5432/postgres
Now we have added our database let’s start the pghero.
Start the pghero server
Now we will start our pghero server.
# pghero config:set PORT=3001
# pghero config:set RAILS_LOG_TO_STDOUT=disabled
# pghero scale web=1
View the dashboard
Now we have start the pghero server lets check the dashboard. Go to ipaddress of your server and port 3001.
Management of pghero
Use the following commands to manage the pghero.
Check status of pghero
# service pghero status or systemctl status pghero
# service pghero start or systemctl start pghero
# service pghero stop or systemctl stop pghero
# service pghero restart or systemctl restart pghero
View pghero logs
You can use the following command to view the logs of pghero.
# pghero logs
Yay! we have set up pghero on centos 7.
Read Next: Install pghero on mac with docker – performance dashboard for Postgres
If you have any issue installing pghero on centos 7 please feel free to comment below.
Leave a Reply