Docker, storage isolation >= 1.8

lvcreate -n pool0 -L 20G dockers lvcreate -n pool0meta -L 1G dockers lvconvert –type thin-pool –poolmetadata dockers/pool0meta dockers/pool0 # check how it is working? [root@db7 ~]# docker daemon –storage-opt dm.thinpooldev=/dev/mapper/dockers-pool0 Install to systemctl echo ‘OPTIONS=”–storage-opt dm.thinpooldev=/dev/mapper/dockers-pool0″‘ >> /etc/sysconfig/docker vi /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network.target docker.socket Requires=docker.socket [Service] EnvironmentFile=-/etc/sysconfig/docker Type=notify ExecStart=/usr/bin/docker daemon -H […]

Read more...

Docker, volume sharing

docker run -it -v /host_storage/:/storage_inside_docker –name=”vol1″ –cpu-quota=2 -m 128M 9eb167f08bdd permission denied? http://stackoverflow.com/ Solution: docker run -it -v /host_storage/:/storage_inside_docker:Z –name=”vol1″ –cpu-quota=2 -m 128M 9eb167f08bdd

Read more...

Unusual: MySQL, extremely annoying bug

If your architecture uses MySQL replication and you make some ETL transformations and you observed some incredible values in autoincrement columns (i.e. the value dramatically increases – by hundred of thousands or event millions) – it means you have just experienced a bug. Very clear description is presented on site http://bugs.mysql.com/. However, in my case […]

Read more...

Docker, storage isolation < 1.8

How to isolate Docker containers and stuff… [root@localhost ~]# pvs PV VG Fmt Attr PSize PFree /dev/md0p1 dockers lvm2 a– 37.25g 37.25g /dev/md0p2 mysql lvm2 a– 37.25g 764.00m /dev/sda3 centos lvm2 a– 12.93g 4.00m [root@localhost ~]# echo VG=dockers > “/etc/sysconfig/docker-storage-setup” [root@localhost ~]# docker-storage-setup Rounding up size to full physical extent 40.00 MiB Wiping xfs signature […]

Read more...

Unusual: Mysql, partitioning

### Partitioning: mysql>ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT; ERROR 1005 (HY000): Can’t create table ‘inforia.#sql-7f30_17f4dd0’ (errno: 150) Cannot resolve table name close to …. mysql>alter table clipping3 remove partitioing; mysql>ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT; Query OK, […]

Read more...

How to check a device is rotational

lsblk /dev/sda1 -o rota cat /sys/block/bcache0/queue/rotational

Read more...

Unusual: MySQL

PL/SQL: I wouldn’t recommend to use the following construction: IF EXISTS (SELECT 1 FROM `table_a` WHERE `id` = `_ID`) THEN UPDATE `table_a` SET `value` = 1 WHERE `id` = `_ID`; ELSE INSERT INTO `table_a` […]; END IF; In my case there was a trigger (on table_a) who additionaly modifed “table_b”. When I changed the engine […]

Read more...

Fedora. Fan is working non stop. Dell System Vostro 3450 / 0K8WHD

yum install install i8kutils yum install lm_sensors.x86_64 echo “i8k” > /etc/modules-load.d/i8k.conf # Now, one can manage fan speed. i8kfan 1 1 I run this script into console (as watch command parameter) every 900s. #!/bin/bash SCRIPT_NAME=`basename $0` FILE_TMP=”/tmp/sensors-$SCRIPT_NAME” sensors > $FILE_TMP TEMP4=`grep temp4 $FILE_TMP | sed ‘s/\s//g’ | awk -F “:” ‘{print $2}’ | sed ‘s/[^0-9.]//g’` […]

Read more...

Elasticsearch backup

Install JQ to make Json more human readable. #!/bin/bash # Backup of elasticsearch # Scenario: make backup of every open index once a day function write_to_stderr { echo “$@” 1>&2 } INDEX_TO_EXLUDE=”^_\|SOME_SPECIAL_INDEX” REPOSITORY=”backup” for INDEX_NAME in `curl ‘localhost:9200/_cat/indices?v’ 2>/dev/null | grep “\sopen\s” | awk ‘{print $3}’ `; do INDEX_LOG_FILE=”/tmp/bck.$INDEX_NAME.log” IS_SPECIAL_INDEX=`echo “$INDEX_NAME” | grep -c “$INDEX_TO_EXLUDE” […]

Read more...

Zabbix MySQL Percona Monitoring Plugins – many servers monitored with one plugin

My aim was to avoid installation of any additional software on database servers (PHP). Simultaneously, a plugin for monitoring Mysql server, I needed to install, required PHP. In order to meet my needs I decided modify a bit the Percona plugin and get the data through http. You need some http server, then configure virtual […]

Read more...