Docker with mysql not starting

How to check what happend. I add that docker logs -f container_name | container id neither does work. The solution for me is to remove the actual container (condition that it has some persistent storage) and run new one with entrypoint parameter replaced: Was: docker run -v /dockers_persistent/data/database_1:/var/lib/mysql -v \ MYSQL_ROOT_PASSWORD=’*******’ -d f44353327cb6 To be: […]

Read more...

boost performance for bulk insert operation into large table.

I have encountered some performance issues while migrating data from SSD pure Linux environment (no virtualization) into hybrid paravirtualized multi-tier stuff. I used docker containers and bCache hybrid storage. Frontend consists of NVMe (fusionIO) 400G RAID1 and backend is EMC VNX5200 SAS RAID6. In my case the process of mass inserts was not stable – […]

Read more...

Docker: get relation between container and interface veth

The idea is to receive the index of the next interface. # Get veth interface: MY_CONTAINER_NAME=”mysql_server_1″ LINK_INDEX=`docker exec -it $MY_CONTAINER_NAME ip a l eth0 | awk -F “:” ‘{if (NR==1) print $1+1}’` ip link ls | grep “^$LINK_INDEX” | awk -F”:” ‘{ gsub (” “, “”, $2); print $2}’ Now you can easily observe the […]

Read more...

Plesk, spamassassin and bayes

spamd[8917]: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create lockfile user@domain.pl/.spamassassin/bayes.mutex: No such file or directory How to fix: mkdir /var/qmail/bayes chown popuser:popuser /var/qmail/bayes chmod 770 /var/qmail/bayes mkdir /var/spamassassin chown popuser:popuser /var/spamassassin chmod 770 /var/spamassassin

Read more...

One line helpers

# Analyze all but INSERTS from mysql’s general log grep -E ‘^.*[0-9]{1,}\sQuery’ /your-path/to/file.log | awk ‘{$1=$2=””; print toupper($0)}’ | sed ‘s/\s+/ /g’ | grep -Ev “^\s*INSERT” | sed -r ‘s/^(.*)(\sSET\s).*(\sWHERE.*)/\1\3/g’ | sed -r ‘s/^(.*SELECT).*(\sFROM)(\s.*)/\1\3/g’ | sed “s/’//g” | sed -r ‘s/=\s\w+/ /g’ | sort | uniq -c # Change ls result and execute it. ls […]

Read more...

How to read FIO results

Terminology: fio = https://github.com/axboe/fio/ us = microsecond = (1 / 1 000 000) second stdev = standard deviation Quick explanation: 1. Latency: 2. IOps Detailed information are available in FIO’s How-To (ยง 6.0 Interpreting the output) Example of my configuration (random writes): [global] bs=4k ioengine=libaio iodepth=4 # was 1g size=1g direct=1 runtime=60 # directory=/bcache directory=/emcpower […]

Read more...

Bcache & EMC Powerpath (powermt). Multipath causing multi bcache devices.

I encountered the problem that after I chose backend device as /dev/emcpowera3 I have seen 16+1 bcache-devices (bcache0-bcache16). It reflected from the fact that bcache saw all links (reading the bcache signatures). The solution apears to be very simple: vi /usr/lib/udev/rules.d/69-bcache.rules was: KERNEL==”fd*|sr*”, GOTO=”bcache_end” should be: KERNEL==”fd*|sr*|sd*”, GOTO=”bcache_end” How it looked before I changed udev […]

Read more...

Bcache, CentOS 7.1 (w/kernel >= 3.10)

Bcache is not enabled by default in CentOS 7.1. However, you do not need to recompile whole kernel. It is sufficient to compile module and add it to existing kernel. yum groupinstall “Development Tools” -y yum install kernel-headers -y Unfortunately, kernel headers do not include all you need. You have to download adequate kernel sources […]

Read more...

NVMe, software raid disappears after reboot

# Annoying… mdadm –create /dev/md3 –level=1 –raid-disks=2 /dev/nvme0n1p3 /dev/nvme1n1p3 [root@db7 ~]# parted /dev/nvme0n1 p Model: Unknown (unknown) Disk /dev/nvme0n1: 400GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 40.0GB 40.0GB primary raid 2 40.0GB 80.0GB 40.0GB mysql raid 3 80.0GB 84.0GB 4000MB xd raid […]

Read more...

Docker (>= 1.8), swappiness

docker run -it -v /host_storage/mms_condor:/storage_inside_docker \ –name=”condor_swap_30″ –memory-swappiness=”30″ \ –oom-kill-disable=true -c=1024 -m 64M 7322fbe74aa5 –oom-kill-disable=true|false: Whether to disable OOM Killer for the container or not. –memory-swappiness=””: Tune a container’s memory swappiness behavior. Accepts an integer between 0 and 100. –memory-swap=””: Total memory limit (memory + swap, format: , where unit = b, k, m or […]

Read more...