cancel
Showing results for 
Search instead for 
Did you mean: 

PEM: reinstall of Repo after corruption

Level 3 Adventurer

PEM: reinstall of Repo after corruption

Hi,

I drop the server by stopping and initdb then adding enterprisedb user a passord. Stopping httpd service

Then I start config-pem-server.sh as root

Option 1

And I get at end this:

-->  [Info] Registering database server with PEM server.
ERROR:  insert or update on table "agent_server_binding" violates foreign key constraint "agent_server_binding_agent_id_fkey"
DETAIL:  Key (agent_id)=(1) is not present in table "agent".
CONTEXT:  SQL statement "INSERT INTO pem.agent_server_binding (agent_id, server_id, server, port, username, database, password) VALUES (agentid, serverid, server_host, server_port, user_name, agent_database, passwd)"
PL/pgSQL function pem.startup(text,text,text,integer,text,integer,text,text,text,integer,text) line 39 at SQL statement

Kind regards,

Polem

6 REPLIES
EDB Team Member

Re: PEM: reinstall of Repo after corruption

Hi  Polem,

 

As you have mentioned that you have cleaned the data directory and re-initialized the database from scratch. 

However, this process will not create the required schema's inside the database which is required for the PEM server to run.

 

Hence, we request you to setup PEM server itself from the scratch. 

Kindly refer below link which will help you to proceed with the setup.

 

Installing Postgres Enterprise Manager

 

Kindly let us know in case of any concerns or issues.

 

Regards,

Dhananjay

 

Level 3 Adventurer

Re: PEM: reinstall of Repo after corruption

Hi,

I was able to recreate successfully PEM server by following this procedure:

  1. stop pemagent and remove cert + config
  2. uninstall WEB server with
    /usr/edb/pem/bin/configure-pem-server.sh -un
    Installation directory: /usr/edb/as10
  3. stop and drop cluster with remove $PGDATA content
  4. create cluster and adapt config to your setup:
    /usr/edb/as10/bin/initdb --pgdata=/opt/postgres/data --no-redwood
  5. start cluster with
    systemctl start edb-as-10
  6. alter user enterprisedb password '<strong password>';
  7. setenforce Permissive
  8. /usr/edb/pem/bin/configure-pem-server.sh with option 1
  9. connect to your PEM server on 8443
  10. recreate all users

Kindly,

Polem

EDB Team Member

Re: PEM: reinstall of Repo after corruption

Hi @Polem

 

Thank you for your response. We will get back to you on same.

 

Thanks,

Ninad

EDB Team Member

Re: PEM: reinstall of Repo after corruption

Hi @Polem

 

We are able to reproduce issue at our end. We will consult with our development panel and get back to you on same.

 

Thanks,

Ninad

EDB Team Member

Re: PEM: reinstall of Repo after corruption

Hi @Polem

 

Our development team was able to reproduce the issue. At time of uninstallation one may need to uninstall PEM packages as well by using "yum erase edb-pem-server". Steps to follow should be as below.

 

  • /usr/edb/pem/bin/configure-pem-server.sh -un
  • yum erase edb-pem-server
  • Drop the pem database. ( DROP DATABASE pem )
  • Move the certificates from /root/.pem/ to other location. ( etc. mv /root/.pem/* /root )
  • Move agent.cfg file from /usr/edb/pem/agent/etc/agent.cfg to some other location. ( etc. mv /usr/edb/pem/agent/etc/agent.cfg /root ).
  • Try to run /usr/edb/pem/bin/configure-pem-server.sh'

This uninstall solution works as expected. Request you to try at your end.

 

Thanks,

Ninad Shah

Highlighted
EDB Team Member

Re: PEM: reinstall of Repo after corruption

Hi @Polem

 

Just an addition to previous response. You may skip second step in case you would not wish to uninstall PEM server installation.

 

Thanks,

Ninad Shah