In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Although the author has launched the docker version, it only needs one button (one command) to complete the construction. But in the spirit of learning, you still have to toss around on your own. One button is good but not clear. The official installation has been written in great detail, but it is still in English. PG watch3 official address: https://github.com/cybertec-postgresql/pgwatch3 system environment: CentOS 7.5IP:192.168.1.2grafana-5.1.4PostgreSQL-10, pg_stat_statements module InfluxDB-1.5.3Python3# close selinux and firewalld. # # install the above applications by yourself! The installation process is not provided in this article! Configure PostgreSQLvi / var/lib/pgsql/10/data/postgresql.confshared_preload_libraries = 'pg_stat_statements'track_io_timing = on# and edit the postgresql.conf configuration file Add the following two lines (premise: install the pg_stat_statements module vi / var/lib/pgsql/10/data/pg_hba.conflocal all all peerhost all all 127.0.0.1 trusthost all all 32 trusthost all all:: 1 trust# 128 trust# modify the authentication mode Users who access through 127.0.0.1 do not need password authentication. For security, please configure it yourself. For details of the pg_hba.conf configuration file, please use Baidu ~ ~
Systemctl restart postgresql-10.service# restarts the database mkdir / app & & cd / appgit clone https://github.com/cybertec-postgresql/pgwatch3.git# clone source repository and there are some things you need to use.
Su-postgrespsql-c "create user pgwatch3_grafana password 'xyz'" psql-c "create database pgwatch3_grafana owner pgwatch3_grafana" psql-c "create user pgwatch3 password' xyz'" psql-c "create database pgwatch3 owner pgwatch3" psql-f / app/pgwatch3/pgwatch3/sql/datastore_setup/config_store.sql pgwatch3psql-f / app/pgwatch3/pgwatch3/sql/datastore_setup/metric_definitions.sql pgwatch3# switch to the postgre user to manipulate the database. # create pgwatch3_grafana and pgwatch3 users and set the password. # create pgwatch3_grafana and pgwatch3 databases and set the master. # Import the data of pgwatch3. Configure InfluxDBvi / etc/influxdb/ roomxdb.conf[ http] enabled = truebind-address = "127.0.0.1 enabled 8086" # modify the configuration file to change the bind-address on https to 127.0.0.because it is used for monitoring, so no authentication is done, but only local address access is allowed. Systemctl start influxdb# starts InfluxDB
InfluxCREATE USER "pgwatch3" WITH PASSWORD 'xyz'CREATE DATABASE pgwatch3use pgwatch3GRANT ALL ON pgwatch3 to "pgwatch3" # creates a pgwatch3 user and a database with the same name, and authorizes it.
3. Configure Grafanavi / etc/grafana/ grafana.ini [database] type = postgreshost = 127.0.0.1:5432name = pgwatch3_grafanauser = pgwatch3_grafanapassword = xyz# to store Grafana data in postgresql http://192.168.1.2:3000# access Grafana web page for configuration # default username and password: admin
# start configuring the dashboard # in the source code repository: all the dashboard contents are under the pgwatch3/grafana_dashboards/v5/ path, and each folder is a dashboard # each folder contains a dashboard.json file, which can be imported # here to show the effect, I will only import one: the one on the db-overview/dashboard.json#github page will be easier to copy. Copy everything in the page: # https://raw.githubusercontent.com/cybertec-postgresql/pgwatch3/master/grafana_dashboards/v5/db-overview/dashboard.json
Configure pgwatch3cd / app/pgwatch3/pip3 install-U-r webpy/requirements.txtcd webpypython3 web.py# to enter the pgwatch directory, and pip installs some dependent libraries # execute web.py
# visit the web page to configure the next step # configure the information of the monitored database. Note that the information of the monitored database is filled in here! # that is, you need to create a user in the corresponding database and authorize it, and then enable the pg_stat_statements module # I only monitor the pgwatch3 database on this machine.
# configure the monitored database # here I will only monitor the pgwatch3 database su-postgrespsql-d pgwatch3-c "CREATE EXTENSION pg_stat_statements;" psql-d pgwatch3-c "CREATE EXTENSION plpythonu "psql-f / app/pgwatch3/pgwatch3/sql/metric_fetching_helpers/stat_activity_wrapper.sql pgwatch3psql-f / app/pgwatch3/pgwatch3/sql/metric_fetching_helpers/stat_statements_wrapper.sql pgwatch3psql-f / app/pgwatch3/pgwatch3/sql/metric_fetching_helpers/cpu_load_plpythonu.sql pgwatch3psql-f / app/pgwatch3/pgwatch3/sql/metric_fetching_helpers/table_bloat_approx.sql pgwatch3# official statement: https://github.com/cybertec-postgresql/ Pgwatch3#steps-to-configure-your-database-for-monitoring
# compile pgwatch3 program yum install go-ycd / app/pgwatch3/pgwatch3./build_gatherer.sh# install the go language environment, enter the pgwatch3 directory, execute build_gatherer.sh to start compilation # this process will be slow, because something will be downloaded on github, be sure to make sure that the computer can ping github# compilation completed will generate a pgwatch3 executable file
. / pgwatch3# runs the pgwatch3 program # because all the account passwords just set are consistent with the default values of the pgwatch3 program, and all can be run directly # if it is inconsistent, please use it yourself. / pgwatch3-- help check help # do not report an error, and then go to Grafana to see the data!
# finally, configure pgwatch3 to start in systemctl mode # paste the following content into / etc/systemd/system/pgwatch3.service# and then start it with systemctl start # Note, starting in this way, all the output information will be in / var/log/ messages [Unit] Description=pgwatch3After=syslog.targetAfter= network.target [service] User=rootRestart=on-failurePIDFile=/tmp/pgwatch3.pidKillMode=control-groupExecStart=/app/pgwatch3/pgwatch3/pgwatch3ExecStop=/bin/kill-SIGTERM $MAINPIDRestartSec=10sTimeoutSec= 0 [install] WantedBy=multi-user.target
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.