Skip to main content
10-Marble
March 8, 2022
Solved

script start_replication.sh fails

  • March 8, 2022
  • 4 replies
  • 4014 views

Hello,

I'm trying to configure a database with replication streaming.

I have three nodes. Red Hat 8.2

Thingworx is version 8.5.4

I'm following this guide https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/ThingWorxHighAvailability/ExampleDeploymentofPostgreSQLHAwithPgpoolII.html#

 

When I run the script /db/bin/start_replication.sh in the first node (master) I get this error:

 

[postgres@MACHINE0 db]$ sh -x /db/bin/start_replication.sh node0
+ cp /db/postgres/postgresql.conf /db/bin/postgresql.conf
+ cp /db/postgres/pg_hba.conf /db/bin/pg_hba.conf
+ rm -rf /db/postgres
+ rm -rf /db/thingworx/install /db/thingworx/PG_9.6_201608131 /db/thingworx/platform-settings.json /db/thingworx/Thingworx.war /db/thingworx/update
+ pg_basebackup -h node0 -D /db/postgres -U replicator --xlog-method=stream -v -P
pg_basebackup: FATAL: no se pudo abrir el archivo de mapeo de relaciones «global/pg_filenode.map»: No existe el fichero o el directorio
+ cp /db/bin/postgresql.conf /db/postgres/postgresql.conf
+ cp /db/bin/pg_hba.conf /db/postgres/pg_hba.conf

 

The database is runing in this node.

 

The /etc/hosts is

10.98.146.20 MACHINE2 node2
10.98.133.93 MACHINE0 node0
10.98.133.94 MACHINE1 node1

 

Can you some suggestion about this error?

 

Error Message Text Translated by Sharon Langley, 10-mar-2022 using Google Translate: 

could not open relationship mapping file 'global/pg_filenode.map': No such file or directory

 

Best answer by slangley

Hi @dgalan

 

It appears the Help Center documentation has been updated.  

 

Regards.

 

--Sharon

4 replies

Community Manager
March 10, 2022

Hi @dg_01_10127178.

 

Here are some things to check:

  • Have you validated there aren't any permissions issues?  Does the postgres user have access to the file?
  • Have you tried restarting the server to ensure a clean startup?
  • Did you check postgresql.conf for any typos?   

Regards.

 

--Sharon

 

  

dgalan10-MarbleAuthor
10-Marble
March 11, 2022
  • Have you validated there aren't any permissions issues?  Does the postgres user have access to the file?

Yes, I did a "chown -R postgres:postgres /db"

 

  • Have you tried restarting the server to ensure a clean startup?

Yes, several times.

  • Did you check postgresql.conf for any typos?   

This file is ok. The database startup ok.

 

The problem is when I exec this command "pg_basebackup -h node0 -D /db/postgres -U replicator --xlog-method=stream -v -P" after exec "rm -rf /db/postgres"

 

16-Pearl
March 21, 2022

Hi David,

 

Can you confirm that the issue is generic to the pg_basebackup command on all nodes ?

Are you getting the same error when running the following command on node01 (it just performs a tar backup of the database in the my_backup folder).

pg_basebackup -h localhost -D my_backup -Ft -z -P -U replicator

 

dgalan10-MarbleAuthor
10-Marble
March 21, 2022

Hello,

I don't want to do a backup with the name "my_backup". If I do those backup, it works fine.

The problem is with the documentation about to configure Postgres HA for Thingworx.

 

The first steps are:

 

# cp /db/postgres/postgresql.conf /db/bin/postgresql.conf
# cp /db/postgres/pg_hba.conf /db/bin/pg_hba.conf
# rm -rf /db/postgres
# rm -rf /db/thingworx/install /db/thingworx/PG_9.6_201608131 /db/thingworx/platform-settings.json /db/thingworx/Thingworx.war /db/thingworx/update
# pg_basebackup -h node0 -D /db/postgres -U replicator --xlog-method=stream -v -P

 

(my database is in /db/postgres and /db/thingworx)

dgalan10-MarbleAuthor
10-Marble
March 21, 2022
Community Manager
April 6, 2022

Hi @dgalan.

 

Per the case, the issue results when attempting to make a backup of node1 while the db is running.  To avoid the issue, need to make the backup from another node.  An internal case has been opened to review and correct the documentation.

 

Regards.

 

--Sharon

slangleyCommunity ManagerAnswer
Community Manager
January 6, 2023

Hi @dgalan

 

It appears the Help Center documentation has been updated.  

 

Regards.

 

--Sharon