zubkov-andrei / pg_profile

Postgres historic workload reports
Other
228 stars 33 forks source link

Not able to Take snapshots in pg_profile 0.3.3 #23

Closed anandkatti closed 3 years ago

anandkatti commented 3 years ago

installed the the pg_profile in public.

anandkatti commented 3 years ago

postgres=# SELECT create_server(‘local’,’host=bos1-vcloud-static-172-134.eng.vmware.com dbname=postgres user=‘perf_mon’ port=5432'); postgres'# select server_connstr('local','dbname=postgres port=5432 user=profile_mon password=pwd_mon'); postgres'# SELECT set_server_size_sampling('local','23:00+03',interval '2 hour',interval '8 hour'); postgres'# SELECT FROM show_servers_size_sampling(); postgres'# SELECT profile.take_sample() postgres'# select snapshots() postgres'# SELECT FROM show_servers_size_sampling(); postgres'#

Here are the commands i executed.

No rows when i quired the DB.

Could you please help

anandkatti commented 3 years ago
Screenshot 2021-08-18 at 9 25 42 AM
anandkatti commented 3 years ago

there is no pg_profile DB created.

anandkatti commented 3 years ago

Here is the outout from each command -

[root@postgres pg_profile]# sudo make USE_PGXS=y install /bin/mkdir -p '/usr/pgsql-10/share/extension' /bin/mkdir -p '/usr/pgsql-10/share/extension' /bin/install -c -m 644 .//pg_profile.control '/usr/pgsql-10/share/extension/' /bin/install -c -m 644 pg_profile--0.3.3.sql pg_profile.control pg_profile--0.3.2--0.3.3.sql '/usr/pgsql-10/share/extension/' [root@postgres pg_profile]#

[root@postgres pg_profile]# make USE_PGXS=y installcheck /usr/pgsql-10/lib/pgxs/src/makefiles/../../src/test/regress/pg_regress --inputdir=./ --bindir='/usr/pgsql-10/bin' --dbname=contrib_regression create_extension server_management samples_and_reports export_import retention_and_baselines drop_extension kcache_create_extension server_management samples_and_reports kcache_stat_avail export_import retention_and_baselines kcache_drop_extension (using postmaster on Unix socket, default port) ============== dropping database "contrib_regression" ============== psql: FATAL: role "root" does not exist command failed: "/usr/pgsql-10/bin/psql" -X -c "DROP DATABASE IF EXISTS \"contrib_regression\"" "postgres" make: *** [installcheck] Error 2 [root@postgres pg_profile]#

[root@postgres pg_profile]# make USE_PGXS=y sqlfile make: Nothing to be done for `sqlfile'. [root@postgres pg_profile]#

zubkov-andrei commented 3 years ago

Hi,

  1. If you are installing pg_profile in database cluster you want to monitor there is no need in calling create_server function. It is needed only for monitoring other clusters from your current cluster (for example, standby from primary)
  2. If you did not any modifications in the extension code, you can easily avoid building an extension from source using make command..
  3. installcheck fails because you are running it from root user which can't connect to the database. But you do not need to do this at all.
  4. sqlfile target of make is intended to obtain extension .sql file used only for manual installation in restricted environments. I think it is not your case too.

So, what you need to do...

  1. Obtain latest release from Releases page. You need only pg_profile--0.3.3.tar.gz file
  2. Follow the guide provided on release page for installing extension files, i.e. extract obtained package in appropriate folder of your postgres installation and create the extension. You might have dblink extension installed in your database otherwise, pg_profile will not be installed
  3. Try to collect the first sample using select take_sample().
  4. If you get any error, correct it. The most often is permissions issue. It is recommended to use OS authentication (peer method in pg_hba.conf)
  5. If you have got a sample successfully, you might setup periodical samples collection using a cron-like tool.

All the above is described in Install and Taking samples sections the documentation.

anandkatti commented 3 years ago

Hi Sir ,

I tried to do that. But none of the samples are getting generated. Which table to i need to verify that snapshots are gettting generated.

anandkatti commented 3 years ago

Waiting for your response. It is urgent.

anandkatti commented 3 years ago

is it possible to have zoom or skype call to fix the things urgently. Could you please help with that. Urgently.

I tried all the options avaliable. But no help.

zubkov-andrei commented 3 years ago

Yes it is possible, zoom

zubkov-andrei commented 3 years ago

I tried to do that. But none of the samples are getting generated. Which table to i need to verify that snapshots are gettting generated.

If the take_sample() function returns a "OK" message you have a sample. You can view collected samples using the function show_samples()

anandkatti commented 3 years ago

postgres=# \dx List of installed extensions Name | Version | Schema | Description
--------------------+---------+------------+-------------------------------------------------------------- dblink | 1.2 | public | connect to other PostgreSQL databases from within a database pg_profile | 0.1.1 | public | PostgreSQL load profile repository and report builder pg_stat_statements | 1.6 | public | track execution statistics of all SQL statements executed plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (4 rows)

postgres=#

zubkov-andrei commented 3 years ago

pg_profile | 0.1.1 | public | PostgreSQL load profile repository and report builder

0.1.1 is a obsolete version. Current version is 0.3.3. I think you need to install the latest version.

anandkatti commented 3 years ago

postgres=# \dx List of installed extensions Name | Version | Schema | Description
--------------------+---------+------------+-------------------------------------------------------------- dblink | 1.2 | public | connect to other PostgreSQL databases from within a database pg_profile | 0.1.1 | public | PostgreSQL load profile repository and report builder pg_stat_statements | 1.6 | public | track execution statistics of all SQL statements executed plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (4 rows)

postgres=# select show_samples(); ERROR: function show_samples() does not exist LINE 1: select show_samples(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. postgres=# select show_sample(); ERROR: function show_sample() does not exist LINE 1: select show_sample(); ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. postgres=#

anandkatti commented 3 years ago

i installed sir .. no error came

anandkatti commented 3 years ago

is it possible to have zoom call or skype so that i can share my screen ?

anandkatti commented 3 years ago

can u gudie me..it is really urgent. Please please ..i really need this extension badly.

zubkov-andrei commented 3 years ago

Yes, I've provided you a link and I'm waiting for you there.

Yes it is possible, zoom