Wednesday, May 12, 2021

#Docker Administration

#Verify dockers log 

If you want to verify the docker containers logs then follow the syntax:

  • docker logs <containerid>

Ex: The below commands will display the log information of container "efca1e07d460" and 
details history. Earlier we installed PostgreSQL 13.2 on this container.


root@worldpgdb:~# docker logs efca1e07d460
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2021-05-11 17:35:32.503 UTC [45] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-05-11 17:35:32.505 UTC [45] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-05-11 17:35:32.519 UTC [46] LOG:  database system was shut down at 2021-05-11 17:35:29 UTC
2021-05-11 17:35:32.531 UTC [45] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

2021-05-11 17:35:32.639 UTC [45] LOG:  received fast shutdown request
waiting for server to shut down....2021-05-11 17:35:32.641 UTC [45] LOG:  aborting any active transactions
2021-05-11 17:35:32.645 UTC [45] LOG:  background worker "logical replication launcher" (PID 52) exited with exit code 1
2021-05-11 17:35:32.646 UTC [47] LOG:  shutting down
2021-05-11 17:35:32.705 UTC [45] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2021-05-11 17:35:32.850 UTC [1] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-05-11 17:35:32.852 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2021-05-11 17:35:32.854 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2021-05-11 17:35:32.871 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-05-11 17:35:32.881 UTC [64] LOG:  database system was shut down at 2021-05-11 17:35:32 UTC
2021-05-11 17:35:32.884 UTC [1] LOG:  database system is ready to accept connections
2021-05-12 07:45:32.835 UTC [254] FATAL:  role "root" does not exist
root@worldpgdb:~# 
  • If you want to do continue stream then use the below command:-"docker logs --follow <containerid>"





  • to shows the logs with timestamp ( nano milliseconds) the syntax as follow:-  "docker logs --timestamp <containerid>"




  • To start the inactive containers, just try "docker start <containerid>"   

Step by Step YugabyteDB 2.11 (Open Source) Distributed DB - Multi-node Cluster Setup on RHEL

Scope - ·        Infrastructure planning and requirement for installation of the multi-node cluster database ·        Prerequisites Software...