pschiffe / docker-pdns

Docker images for PowerDNS
MIT License
270 stars 80 forks source link

pdns new setup #126

Closed hpcmtint closed 7 months ago

hpcmtint commented 7 months ago

I am looking into power dns are replacement for bind.

my yaml is

version: '3.7'

services:
  pdnsdb:
    image: mariadb:latest
    container_name: pdnsdb
    hostname: pdnsdb
    environment:
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_DATABASE=powerdns
      - MYSQL_USER=pdns 
      - MYSQL_PASSWORD=mypdns
    ports:
      - "5307:3306"
    restart: always
    volumes:
      - /home/mtint/pda-mysql:/var/lib/mysql
      - ./initdb:/docker-entrypoint-initdb.d

  pdns:
    image: pschiffe/pdns-mysql
    container_name: pdns
    hostname: pdns
    restart: always
    depends_on:
      - pdnsdb
    ports:
      - "53:53"
      - "53:53/udp"
      - "8081:8081"
    environment:
      - PDNS_gmysql_host=pdnsdb
      - PDNS_gmysql_port=5307
      - PDNS_gmysql_user=pdns
      - PDNS_gmysql_dbname=powerdns
      - PDNS_gmysql_password=mypdns
      - PDNS_master=yes 
      - PDNS_api=yes
      - PDNS_api_key=secret 
      - PDNSCONF_API_KEY=secret 
      - PDNS_webserver=yes 
      - PDNS_webserver-allow-from=127.0.0.1,172.0.0.0/12,192.0.0.0/16,10.0.0.0/8
      - PDNS_webserver_address=0.0.0.0 
      - PDNS_webserver_password=secret2 
      - PDNS_version_string=anonymous 
      - PDNS_default_ttl=1500 
      - PDNS_allow_notify_from=0.0.0.0 
      - PDNS_allow_axfr_ips=127.0.0.1 

  adminer:
    image: adminer:latest
    container_name: adminer
    hostname: adminer
    depends_on:
      - pdnsdb
    environment:
      ADMINER_DEFAULT_SERVER: pdnsdb
    restart: always
    ports:
      - 8080:8080
CONTAINER ID   IMAGE                 COMMAND                  CREATED          STATUS                             PORTS                                                                                                             NAMES
efa3b463d08c   pschiffe/pdns-mysql   "/docker-entrypoint.…"   18 seconds ago   Up 17 seconds (health: starting)   0.0.0.0:53->53/tcp, :::53->53/tcp, 0.0.0.0:8081->8081/tcp, 0.0.0.0:53->53/udp, :::8081->8081/tcp, :::53->53/udp   pdns
08c9aac8d7d5   adminer:latest        "entrypoint.sh php -…"   18 seconds ago   Up 17 seconds                      0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                                                         adminer
a0a9d1c1051f   mariadb:latest        "docker-entrypoint.s…"   19 seconds ago   Up 18 seconds                      0.0.0.0:5307->3306/tcp, :::5307->3306/tcp                                                                         pdnsdb
docker logs efa3b463d08c
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
ERROR 2002 (HY000): Can't connect to MySQL server on 'pdnsdb' (115)
MySQL is unavailable - sleeping
docker logs a0a9d1c1051f
2024-01-31 14:19:47+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.2.2+maria~ubu2204 started.
2024-01-31 14:19:47+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-01-31 14:19:47+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.2.2+maria~ubu2204 started.
2024-01-31 14:19:47+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
2024-01-31 14:19:47 0 [Note] Starting MariaDB 11.2.2-MariaDB-1:11.2.2+maria~ubu2204 source revision 929532a9426d085111c24c63de9c23cc54382259 as process 1
2024-01-31 14:19:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-01-31 14:19:47 0 [Note] InnoDB: Number of transaction pools: 1
2024-01-31 14:19:47 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-01-31 14:19:47 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2024-01-31 14:19:47 0 [Note] InnoDB: Using liburing
2024-01-31 14:19:47 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-01-31 14:19:47 0 [Note] InnoDB: Completed initialization of buffer pool
2024-01-31 14:19:47 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-01-31 14:19:47 0 [Note] InnoDB: End of log at LSN=88363
2024-01-31 14:19:47 0 [Note] InnoDB: Opened 3 undo tablespaces
2024-01-31 14:19:47 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2024-01-31 14:19:47 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-01-31 14:19:47 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-01-31 14:19:47 0 [Note] InnoDB: log sequence number 88363; transaction id 120
2024-01-31 14:19:47 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-01-31 14:19:47 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-01-31 14:19:47 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-01-31 14:19:47 0 [Note] Server socket created on IP: '0.0.0.0'.
2024-01-31 14:19:47 0 [Note] Server socket created on IP: '::'.
2024-01-31 14:19:47 0 [Note] InnoDB: Buffer pool(s) load completed at 240131 14:19:47
2024-01-31 14:19:47 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
2024-01-31 14:19:47 0 [Note] mariadbd: ready for connections.
Version: '11.2.2-MariaDB-1:11.2.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

any idea why I am seeing this

it was working just 4 days ago.

pschiffe commented 7 months ago

Hello @hpcmtint,

PDNS_gmysql_port=5307 must be PDNS_gmysql_port=3306. The section

ports:
      - "5307:3306"

is applicable only for the network outside of the docker (on the host). Within the docker network, pdnsdb service will be still available at port 3306.

hpcmtint commented 7 months ago

Thank you sir, silly me, and I am kind of new to docker compose as well. I changed the ports when I integrated into bigger env.

pschiffe commented 7 months ago

No worries :)