Wednesday, July 18, 2018

Cleanup and restart docker-storage-setup

Cleanup and setting up docker-storage-setup

In this example, vdb partition is used.

 vgremove docker-vg

 pvremove /dev/vdb1

 parted /dev/vdb rm 1

 wipefs -af /dev/vdb

 systemctl stop docker

 rm -rf /var/lib/docker

 rm -f   /etc/sysconfig/docker-storage


 systemctl start docker

Thursday, July 5, 2018

docker image - remove old tag and add new tag


# Tag the image as below
# docker tag   e0d6b0ded794   <your_newtag_here>

Where <e0d6b0ded794> is the image id of the image you wish to update.


#remove old tag:

# docker rmi <your_old_tag_here>


# Check the image, you should only see the newtag:

# docker images | grep <your_newtag_here>


Building and running gluster container

Building and running gluster container:

# clone
git clone

cd gluster-containers/CentOS/

# Build using dockerfile
docker build -t glusterfs .

# Now run
docker run -v /etc/glusterfs:/etc/glusterfs:z -v /var/lib/glusterd:/var/lib/glusterd:z -v /var/log/glusterfs:/var/log/glusterfs:z -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d --privileged=true --net=host -v /dev/:/dev  glusterfs

# Now, you can login to the container and check whether glusterd is running

Also, peer probe to other gluster containers using its IP address.

Wednesday, June 27, 2018

Change coredump file location

# verify current setting
sysctl   kernel.core_pattern

You can change default core dump as below:
echo '/var/log/testprogram/core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern

# verify the setting
sysctl   kernel.core_pattern

Now, all the programs if any major faults, will generate coredump in the above directory configured.

Here %e - program name , %p - pid of process

Check, man core for more details.

This article discussed about how to compress the core file generated:

tee command vs redirect symbol

Usually I make use of > to redirect to a file.

We can also redirect using tee command.

Something like:

./test | tee test_output.log
So, here instead of > we are using tee.

What is advantage/ difference?

tee in addition to redirection copies the data to STDOUT.

Also, sometimes we want to see only specific lines with a pattern , we can use like:

./runprogram | tee program.log | grep Error
So, in this example, it logs all output , but displays only those lines with "Error".

Ref: man tee