Posts Tagged ‘ system

Path MTU Discovery Black Hole

Эта проблема совсем не нова. Она описана в RFC 2923 в 2000 году. Но тем не менее, продолжает встречаться с завидным упорством у многих провайдеров. А ведь именно провайдер виноват в данной ситуации: не нужно блокировать ICMP тип 3 код 4. Причем слушаться «голоса разума» ( т. е. клиентов, понимающих в чем проблема) они обычно не хотят.

Решение проблемы с PMTU

Не будем звонить в техподдержку, а попробуем решить проблему, исходя из собственных средств.
Разработчики Linux, тоже знающие о ней, предусмотрели специальную опцию в iptables. Цитата из man iptables:

TCPMSS
This target allows to alter the MSS value of TCP SYN packets, to control the maximum size for that connection (usually limiting it to your outgoing interface’s MTU minus 40 for IPv4 or 60 for IPv6, respectively). Of course, it can only be used in conjunction with -p tcp. It is only valid in the mangle table. This target is used to overcome criminally braindead ISPs or servers which block “ICMP Fragmentation Needed” or “ICMPv6 Packet Too Big” packets. The symptoms of this problem are that everything works fine from your Linux firewall/router, but machines behind it can never exchange large packets:
1) Web browsers connect, then hang with no data received.
2) Small mail works fine, but large emails hang.
3) ssh works fine, but scp hangs after initial handshaking.
Workaround: activate this option and add a rule to your firewall configuration like:

iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

Read more

Bind9: balancing by client ip (even/odd)

For some reason i need balancing client’s 50/50 for 2 datacenter’s
But, if client send GET request to datacenter1 (DC1) all following request need redirect to the same DC1. Only if DC1 is down – send to DC2
Simplest way – is share client’s by their ip (odd/even)
So we need two Bind9 services on one server.
First Bind9 will be answered that www.example.org is in DC1, second – in DC2
For example first named.conf:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
};
....

Zone:
Read more

Mysql: Waiting for table metadata lock

In Mysql shell execute:

SHOW ENGINE INNODB STATUS \G

Look for the Section –

 TRANSACTIONS

Find transaction like:
Read more

Install Weathermap in Cacti

For install Weathermap you need have Cacti with Plugin Architecture
For PHP we need GD library

apt-get install php5-gd

Go to Cacti Plugins

cd cacti/plugins
wget http://network-weathermap.com/files/php-weathermap-0.97c.zip
unzip php-weathermap-0.97c.zip

Read more

Upgrade Cacti to 0.8.8g

Very simple to do Cacti upgrade

wget http://www.cacti.net/downloads/cacti-0.8.8g.tar.gz
 
mysqldump -l --add-drop-table cacti > cacti.sql
mv cacti cacti_old
tar xvf cacti-0.8.8g.tar.gz
mv cacti-0.8.8g cacti

Read more

Подсветить диск на контроллере LSI Logic

Перед заменой сбойного диска на сервере желательно сначала его подсветить, чтобі по случайности не вінять “живой” диск
Делается єто так:

/MegaRAID/MegaCli/MegaCli64 -PdLocate -start -PhysDrv [32:1] -a0

где:
32 – Enclosure Device ID: 32
1 – Slot Number: 1
Выключить подсветку:

/MegaRAID/MegaCli/MegaCli64 -PdLocate -stop -PhysDrv [32:1] -a0

Read more

Mysql: purge Master logs

Если у вас настроена репликация Mysql то иногда бинарные логи розрастаются до неймоверных обьемов. В таком случае эти логи можно скормить мастеру Mysql заодно освободив место на файловой системе
Делается это так:

master$ mysql -u root -pMypass -e "PURGE BINARY LOGS TO 'mysql-bin.0066';"

Или так:
Read more

Howto limit speed in browser for test

Sometimes need to shape speed in browser (Firefox) for emulate slow user connections
Using tc :

tc qdisc add dev eth0 root netem delay 2000ms 1000ms

2000ms – original packet timeout
1000ms – deviation
Read more

Openstack: архитектура

1
Вот так незамысловато все устроено 🙂

Update MySQL to 5.7

If you want update Mysql from 5.6 to 5.7 do this steps

https://dev.mysql.com/downloads/repo/apt/

Download mysql-apt-config_0.6.0-1_all.deb

Install apt-sources

dpkg -i mysql-apt-config_0.6.0-1_all.deb

After that you have apt-resources for installing
Update resources

apt-get update

Read more

Mysql: errno: 24 – Too many open files) (1018)

При создании бекапа выскочина ошибка

mysqldump: Couldn't execute 'SHOW TRIGGERS LIKE 'logs'': Can't read dir of './mydatabase/' (errno: 24 - Too many open files) (1018)

Хотя в limits.conf указано значение 30000 и в my.cnf

open-files-limit = 20000

И процесс запущен с правильными параметрами

/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/lib/mysql/error.log --open-files-limit=20000 --pid-file=/var/run/mysql.run  --port=3306

Read more