Links:
https://www.linuxatemyram.com/
Interpreting /proc/meminfo and free output for Red Hat Enterprise Linux 5, 6 and 7
Red Hat Enterprise Linux Oracle Tuning Guide
How to Check Memory Usage From the Linux Terminal
What Is Swappiness on Linux? (and How to Change It)
https://www.kernel.org/doc/Documentation/filesystems/proc.txt
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
2020/09/04
Linux ate my RAM
2017/03/17
Монтирование OCFS2 перед запуском o2cb
/dev/mapper/maindm1 /data ocfs2 _netdev,x-systemd.requires=o2cb.service,noatime,nointr 0 0Опция _netdev указывается в случае, если файловая система размещена на устройстве, которая требует сетевой доступ. Монтирование файловой системы будет происходить после того как включится сеть. Опция x-systemd.requires необходима для того, чтобы сервис o2cb был запущен перед тем как смонтируется файловая система.
2016/03/14
2014/09/25
Количество физических процессоров и ядер
# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l 4 # cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l 24
В данном примере на 1 сокет приходится 6 ядер.
2012/09/10
Убираем X и выставляем UTC
# vim /etc/inittab id:3:initdefault: # init 3
# vim /etc/sysconfig/clock UTC=true # rm /etc/localtime # ln -s /usr/share/zoneinfo/UTC /etc/localtime
2012/03/19
2011/05/31
Monitoring processes by I/O
FreeBSD: top -m io -o total
Understanding Linux Load Average – Part 1
Understanding Linux Load Average – Part 2
Understanding Linux Load Average – Part 3
2011/05/06
Подключение NAS к Linux (CentOS)
# yum -y install autofs samba-client
Настраиваем autofs и запускаем:
Посмотреть smb shares можно так:
# smbclient -U admin -L //10.0.0.16/
Ссылки:
How to mount remote Windows shares
2010/11/26
2010/09/01
Правильный способ запускать демоны — Ubic
http://blogs.perl.org/mt/mt-search.fcgi?blog_id=310&tag=ubic
# git clone git://github.com/berekuk/Ubic
Пропагандирую в массы ;)
2010/07/01
HP Array Configuration Utility CLI for Linux
Скачиваем HP Array Configuration Utility CLI for Linux (hpacucli-8.25-5.noarch.rpm).
hpacucli ctrl all show config detail
hpacucli help | less
... :)
UPDATE: Visualize your RAID
UPDATE: Wikipedia: RAID
UPDATE: Для убунты доступна hpacucli тут: http://downloads.linux.hp.com/SDR/repo/mcp/Debian/pool/non-free/. Для установки, нужно также не забыть про apt-get install lib32gcc1 lib32stdc++6 libc6-i386 (32 бита).
Драйверы и программное обеспечение для Сервер HP ProLiant DL380 G7: HP ProLiant Support Pack CD for dpkg-based distributions -- комплект для мониторинга RAID путём установки HP Management Agents. В этом случае можно настроить отправку SNMP-трапов, предупреждения на мыло.
2010/06/25
Настройка NTP (для RHEL и Windows)
Настройка NTP на RHEL 5.1:
Убедимся, что у нас установлен пакет ntp на RHEL:
# rpm -qa ntp
ntp-4.2.2p1-7.el5
# chkconfig --list ntpd
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
У нас в сети есть роутер, который синхронизируется со множеством серверов в ру-зоне. Нет смысла ставить сюда тучу серверов взятых с http://www.pool.ntp.org (либо используйте пул ru.pool.ntp.org). Поэтому будем синхронизироваться с роутером в сети. Для данного сервера роутер - 192.168.137.51:
# vim /etc/ntp.conf
server 192.168.137.51
Поставим ntpd-сервис в автозагрузку:
# chkconfig ntpd on
# chkconfig --list ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Проверим, возможно ли синхронизировать время с нашего сервера:
# ntpdate -q 192.168.137.51
server 192.168.137.51, stratum 16, offset 504.722821, delay 0.04134
13 May 04:30:24 ntpdate[14482]: no server suitable for synchronization found
#
Как мы видим stratum = 16, не паникуем, через некоторое время он будет 4 или 2 :) Перед запуском ntpd синхронизируем вручную с NTP-сервером:
# date
Wed May 13 04:35:47 UTC 2009
# ntpdate -u 192.168.137.51
13 May 04:44:19 ntpdate[14810]: step time server 192.168.137.51 offset
504.723138 sec
# date
Wed May 13 04:44:21 UTC 2009
# service ntpd start
Starting ntpd: [ OK ]
#
Проверяем:
# ntpq
ntpq> peers
remote refid st t when poll reach delay offset
jitter
==============================================================================
192.168.137.51 80.93.56.210 3 u 12 64 7 0.136 3.202 2.288
LOCAL(0) .LOCL. 10 l 11 64 7 0.000 0.000 0.001
ntpq>
Еще один пример проверить :)
[root@ntmp ~]# ntptrace -n
127.0.0.1: stratum 4, offset 0.009079, synch distance 0.041345
192.168.137.51: timed out, nothing received
***Request timed out
[root@ntmp ~]#
Лог-файл:
# tail -50 /var/log/messages | grep ntp
May 13 04:44:29 ntmp ntpd[14938]: ntpd 4.2.2p1@1.1570-o Mon Jun 4
15:13:02 UTC 2007 (1)
May 13 04:44:29 ntmp ntpd[14939]: precision = 1.000 usec
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface wildcard, 0.0.0.0#123 Disabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface wildcard, ::#123 Disabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface vmnet8, fe80::250:56ff:fec0:8#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface lo, ::1#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface vmnet1, fe80::250:56ff:fec0:1#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface eth0, fe80::21e:bff:febf:eca#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface lo, 127.0.0.1#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface eth0, 192.168.137.10#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface vmnet1, 172.16.35.1#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: Listening on interface vmnet8, 172.16.12.1#123 Enabled
May 13 04:44:29 ntmp ntpd[14939]: kernel time sync status 0040
May 13 04:44:29 ntmp ntpd[14939]: frequency initialized 0.000 PPM from /var/lib/ntp/drift
May 13 04:47:42 ntmp ntpd[14939]: synchronized to 192.168.137.51, stratum 3
May 13 04:47:42 ntmp ntpd[14939]: kernel time sync enabled 0001
#
Все! Данный сервер в своей сети стал полноценным NTP-сервером. Никаких запретов к обращению на сервер мы не устанавливали, обращаться может любой. Т.е. помимо синхронизации по времени, он также предоставляет теперь NTP-сервис.
Теперь расскажу как настроить Windows-сервер на синхронизацию с NTP-сервером. Мы можем использовать в качестве сервера как наш роутер, так и сервер под названием NTMP, который мы настроили на синхронизацию.
# netstat -anp | grep ntp
udp 0 0 172.16.12.1:123 0.0.0.0:* 14939/ntpd
udp 0 0 172.16.35.1:123 0.0.0.0:* 14939/ntpd
udp 0 0 192.168.137.10:123 0.0.0.0:* 14939/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 14939/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 14939/ntpd
udp 0 0 fe80::21e:bff:febf:eca:123 :::* 14939/ntpd
udp 0 0 fe80::250:56ff:fec0:1:123 :::* 14939/ntpd
udp 0 0 ::1:123 :::* 14939/ntpd
udp 0 0 fe80::250:56ff:fec0:8:123 :::* 14939/ntpd
udp 0 0 :::123 :::* 14939/ntpd
unix 2 [ ] DGRAM 17384822 14939/ntpd
Итак! Настраиваем Windows 2003 Server в качестве NTP-клиента:
Из командной строки:
1-й вариант:
w32tm /config /manualpeerlist:"192.168.137.51" /syncfromflags:MANUAL /reliable:YES /update
2-й вариант:
net time setsntp: "192.168.137.51"
(если серверов несколько, перечисляем через пробел в кавычках)
3-й способ: Набрать в Run или из командной строки: gpedit.msc. Включить "Enable Windows NTP Client", затем установить опцию "Configure Windows NTP Client" с тем сервером, с которым мы хотим синхронизироваться. Обязательно сохраняем в конце 0x1.
Ссылки:
http://www.pool.ntp.org/zone/ru
Как пользоваться пулом NTP?