We have Postgres there, but I xs what to do with it (c)

This is a quote from one of my acquaintances who once asked me about Postgres. Then we solved his problem in a couple of days and after thanking me he added: "It's good when there is a DBA friend".

But what if there is no DBA you know? There can be quite a few answer options, ranging from looking for friends among friends and ending with studying the issue on your own. But whatever answer comes to your mind, I have good news for you. In test mode, we launched a recommendation service for Postgres and everything around it. What is it and how did we come to this life

Why is this all?

Postgres is at least not easy, and sometimes very difficult. Depends on the degree of involvement and responsibility.

Those in operations need to make sure that Postgres as a service is working properly and stably - monitor resource utilization, availability, configuration adequacy, periodically update and regularly check health. Those who are in development and write applications, in general terms, need to monitor how the application interacts with the base and that it does not create emergency situations that could bring the base down. If a person is unlucky enough that he is a tech lead / tech lead, then it is important for him that Postgres as a whole works reliably, predictably and does not create problems, while it is advisable not to dive deeply into Postgres for a long time.

In either case, you and Postgres are there. To serve Postgres well, you need to understand and understand how it works. If Postgres is not a direct specialization, then you can spend quite a lot of time learning it. Ideally, when there is time and desire, it is not always clear where to start, how and where to move.

Even if you impose monitoring, which in theory should facilitate operation, the question of expert knowledge remains open. To be able to read and understand graphs, you also need to have a good understanding of how Postgres works. Otherwise, any monitoring turns into sad pictures and spam from alerts at random times of the day.

Weaponry , Postgres. Postgres' .

, .

, . . Weaponry . Weaponry Postgres .

Weaponry , . - , .

- , - , . , Postgres, , . .

. , . , .

Updated 2020-09-16. Getting started.

- . . , , . shell :

psql -c "CREATE ROLE pgscv WITH LOGIN SUPERUSER PASSWORD 'A7H8Wz6XFMh21pwA'"
export PGSCV_PG_PASSWORD=A7H8Wz6XFMh21pwA
curl -s https://dist.weaponry.io/pgscv/install.sh |sudo -E sh -s - 1 6ada7a04-a798-4415-9427-da23f72c14a5

pgbouncer, . pgbouncer . stats_users ( pgbouncer.ini) ( ) auth_file. stats_users pgbouncer.

The install.sh script takes a couple of required arguments that are unique for each project, and through the environment variables it accepts the credentials of the created users. Next, the script starts the agent in bootstrap mode - the agent copies itself to PATH, creates a config with the requisites, a systemd unit and starts up as a systemd service.

This completes the installation. Within a couple of minutes, the DB instance will appear in the list of hosts in the interface and you can already watch the first recommendations. But an important point, many recommendations require a large number of accumulated metrics (at least for a day).




All Articles