What is Conducting a Transaction? If you have a series of SQL statements that you want to run which involve adding, deleting, or changing data contained in InnoDB or BDB tables, but want to be sure that all SQL statements or transactions are completed successfully before committing them, there is a set of MySQL statements […]
Archives for December 2019
lvremove failing to remove volume after using ‘shred’ command
The Problem When trying to delete volume group by using lvremove, vgremove, pvremove command after executing shred command for physical volume as shown below, fails repeatedly. # shred -vfz -n 3 /dev/sdd # sum -r /dev/sdd 28911 1073741824 When the lvremove command is executed, you will get an error saying that the volume group can […]
How to Configure Network Namespaces in Docker Containers
This post tells how Docker uses network namespace to isolate resources. The following figure is the lab setup to help you understand the steps visually: 1. Create two network namespaces: ns1 and ns2. – Add two new naetwork namespaces: # ip netns add ns1 # ip netns add ns2 The above commands create network space […]
How to change the default IP address of docker bridge
Question: what is the proper procedure to reconfigure the docker interface to use an address range (e.g., > 172.200) for the virtual interfaces it uses? You can reconfigure the default bridge network by providing the bip option along with the desired subnet in the daemon.json (default location at //cdn.thegeekdiary.com/etc/docker/daemon.json ) file as follows: # vi […]
“su: Authentication failure” – in Docker
The Problem In some situations, a normal user within a Docker container cannot run ‘su’ command to switch user. When ‘su’ command is issued, the following error returns. $ su – Password: [entering correct password] su: Authentication failure The Solution The sticky permission may be missing in /usr/bin/su within the container. With root privilege, you […]
How to Pause and Resume Docker Containers
Question: How to Pause and Resume running containers on docker host? This post will help to know about pausing and resuming any running containers on the Docker host. Let’s first start the docker container “memory_test” on the docker host. # docker start memory_test memory_test To stop the pause the docker container: # docker pause memory_test […]
How to find docker storage device and its size (device mapper storage driver)
Question: How to find the running docker storage device when docker is using the device-mapper storage driver and then check the size of it? 1. Please run the “docker info” command to display docker system-wide information which contains the docker storage info. # docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 […]
Understanding “docker stats” Command Output
Question: How to monitor a running docker container performance metrics. For example, CPU,memory, I/O and network stats? The docker stats command can continuously report the basic CPU, memory, network and disk I/O metrics. For example: # docker stats a3f78cb32a8e CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS […]
‘docker images’ command error – “Permission Denied”
The Problem A regular user is not able list images using docker images command. Following error can be observed. user01> docker images Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.27/images/json: dial unix /var/run/docker.sock: connect: permission denied The Solution User is not part of docker group and doesn’t […]
Docker Basics – Expose ports, port binding and docker link
This post illustrates three methods to link Docker containers. Expose ports and port binding Expose ports This method is used for within the same network or the docker host. Containers on the same network can talk to each other over their exposed ports and you can expose the ports by one of the below methods. […]