Archive for the ‘ Uncategorized ’ Category

How to check a device is rotational

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

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...

bcache

Necessity_is_the_mother_of_invention I needed some cheap solution for my slow HDDs in one of MySQL node. The box was limited to 4 HDD slots and the actual configuration w/o RAID 1 stopped working 🙂 At the same time I read about Fedora 20 and found some pretty io mechanism called bcache. It works in a similar […]

Read more...

Proxmox customization

How to change default settings and make software raid (mirror and stripe) with GPT. While booting installation: linux ext4 hdsize=10 maxroot=5 swapsize=1 maxvz=1 http://www.jamescoyle.net/how-to/261-proxmox-advanced-install-settings In case your partitions were used with raid you should wipe them (dry :]): wipefs -a /dev/sdb1 # or mdadm –zero-superblock /dev/sdb[1-4] apt-get -y update apt-get -y dist-upgrade START_AT=`parted /dev/sda p […]

Read more...

Sphinx replication II

Four years ago I presented the first version of the replication for Sphinx Search. Since that time I have introduced many modifications of the structure: partitioning of delta indices, introducing the distrubuted index. Additionaly, I have changed the system environment from CentOs into LXC (Debian). The storage has been divided into shardes conform to the […]

Read more...

Failed to remove cgroup when lxc-start failed

Solution: cat /cgroup/sph-slave/tasks 24077 kill -9 24077

Read more...

Git (many scripts on many boxes)

This post describes the situation when you keep different scripts on many servers and the aim is to aggregate them into one project as well as to ensure the versioning feature. Create a repository [e.g. sdiserverapps]. Create a branch [e.g. srv2]. You have to ensure that the option “–single-branch” is available, in contrary compile git: […]

Read more...

NFS4

I used Fedora (F16) with SELinux. On the start I advice to disable the firewall on the box where the exports are shared. I made chcon to all my exported directories: chcon -t nfs_t /home chcon -t nfs_t /home/phos # -R means reccurence chcon -R -t nfs_t /home/phos/www And encountered the following problems: 1. Cannot […]

Read more...

Syslog & Mysql

Add to the configuration file in the section mysqld_safe [mysqld_safe] syslog Restart your rdbms and check whether your mysqld logs to your syslog file. In the contrary remove in the starting script redirecting output and background at the executing mysqld_safe $bindir/mysqld_safe –datadir=”$datadir” –pid-file=”$mysqld_pid_file_path” $other_args # >/dev/null 2>&1 & Do you see the following message? “Can’t […]

Read more...