DisplayAdd1

TechnoTechDB is a platform, which will help to grow your carrier in Information sector. Having 15 years of Experience in Oracle/MongoDB/Postgres/Mysql databases, along with having good expertise level of knowledge in Scripting to automate database task. Our goal to start with zero to hero level expertise in Database. You can access/refer my some blogs on https://mrorcldba.blogspot.com link and post your comments and your suggestion to motive us.

Saturday, 6 August 2022

Restarting (1) 9 seconds ago while running docker-compose up -d for bitnami/postgresql-repmgr:12.11.0 image.

 Hello Guys, 


This is blog is related to issue of bitnami/postgresql-repmgr:12.11.0  docker image setup. While I was performing setup of bitnami/postgresql-repmgr image, I was facing below error and docker was running Restarting mode.





INFO  ==> ** Starting PostgreSQL with Replication Manager setup **
INFO  ==> Validating settings in REPMGR_* env vars...
ERROR ==> The node name does not follow the required format. Valid format: ^.*+-[0-9]+$

$ docker ps 
CONTAINER ID   IMAGE                               COMMAND                  CREATED         STATUS                          PORTS     NAMES
f9be9b16b283   bitnami/postgresql-repmgr:12.11.0   "/opt/bitnami/script…"   5 minutes ago   Restarting (1) 42 seconds ago             instance-1-a1

Solution : In my case below docker-compose.yml was used and  found recommendation was do not use  container/service/rep name like instance-1-a1, mean don't use double (-). 
Same updated and fixed my issue.

Original Creating problem:
------------------------------------
version: "3.0"
services:
  instance-1-a1:
    image: bitnami/postgresql-repmgr:12.11.0
    container_name: instance-1-a1
    restart: always
    networks:
      - database
    ports:
      - 5432:5432
    volumes:
      - ./instance-1-a1/conf/:/bitnami/repmgr/conf/
      - ./instance-1-a1/logs/:/opt/bitnami/postgresql/logs/
    environment:
      - POSTGRESQL_PASSWORD=XXXXXXXXXX
      - POSTGRESQL_POSTGRES_PASSWORD=XXXXXXXXX
      - POSTGRESQL_USERNAME=postgres
      - POSTGRESQL_DATABASE=pg-db
      - REPMGR_NODE_NETWORK_NAME=host1
      - REPMGR_NODE_ID=1
      - REPMGR_PASSWORD=xxxxxxxxx
      - REPMGR_PRIMARY_HOST=host1
      - REPMGR_PRIMARY_PORT=5432
      - REPMGR_PARTNER_NODES=host1,host2:5432,host3:5432
      - REPMGR_NODE_NAME=instance-1-a1
      - REPMGR_LOG_LEVEL=DEBUG
      - REPMGR_PORT_NUMBER=5432
networks:
  database:
    external: true


Updated docker-compose.yml which fixed the problem:
--------------------------------------------------------------------

version: "3.0"
services:
  instance-1:
    image: bitnami/postgresql-repmgr:12.11.0
    container_name: instance-1
    restart: always
    networks:
      - database
    ports:
      - 5432:5432
    volumes:
      - ./instance-1-a1/conf/:/bitnami/repmgr/conf/
      - ./instance-1-a1/logs/:/opt/bitnami/postgresql/logs/
    environment:
      - POSTGRESQL_PASSWORD=XXXXXXXXXX
      - POSTGRESQL_POSTGRES_PASSWORD=XXXXXXXXX
      - POSTGRESQL_USERNAME=postgres
      - POSTGRESQL_DATABASE=pg-db
      - REPMGR_NODE_NETWORK_NAME=host1
      - REPMGR_NODE_ID=1
      - REPMGR_PASSWORD=xxxxxxxxx
      - REPMGR_PRIMARY_HOST=host1
      - REPMGR_PRIMARY_PORT=5432
      - REPMGR_PARTNER_NODES=host1,host2:5432,host3:5432
      - REPMGR_NODE_NAME=instance-1
      - REPMGR_LOG_LEVEL=DEBUG
      - REPMGR_PORT_NUMBER=5432

networks:
  database:

    external: true


Note: Updated parameter marked in bold above, do not change hostname or any folder name.

$docker-compose down -v 

$docker-compose up -d 

$  docker ps

CONTAINER ID   IMAGE                               COMMAND                  CREATED          STATUS          PORTS                                       NAMES

c5ad890ff90b   bitnami/postgresql-repmgr:12.11.0   "/opt/bitnami/script…"   37 minutes ago   Up 37 minutes   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp   instance-1


Thanks !!!

No comments:

Post a Comment

Steps to Rename Host in Oracle RESTART (ASM) in Linux

  oracle@localhost ] asmcmd ASMCMD> lsdg State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_...