Tuesday, 5 August 2014

Как узнать Host ID при работе через FC

через утилиту systool, входящую в пакет sysfsutils (CentOS6)

[root@c1 ~]# systool -c fc_host -v | grep port_name
    port_name           = "0x5001438026682306"
[root@c1 ~]#

Загоны multipath'а

Если мы видим, что multipath загоняет, выдавая нам что-то типа такого:
multipath -ll
mpathr (3600c0ff00012e06d0000000000000000) dm-38
size=5.5T features='1 queue_if_no_path' hwhandler='0' wp=rw
mpathg (360000000000000000000000000000000) dm-8 ,
size=9.3G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=0 status=enabled
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  |- #:#:#:# -   #:# failed faulty running
  `- #:#:#:# -   #:# failed faulty running
[root@c1 ~]# multipath -F
Aug 05 18:24:13 | mpathr: map in use
Aug 05 18:24:13 | mpathg: map in use


причем, мы абсолютно уверены, что со стороны хранилища мы уже давно поудаляли все луны и их там просто физически уже нет, то

[root@c1 ~]# rm /etc/multipath/bindings 
rm: remove regular file `/etc/multipath/bindings'? y
[root@c1 ~]# rm /etc/multipath/wwids 
rm: remove regular file `/etc/multipath/wwids'? y
[root@c1 ~]# service ^C
[root@c1 ~]# /etc/init.d/multipathd restart
ok
Stopping multipathd daemon:                                [  OK  ]
Starting multipathd daemon:                                [  OK  ]
[root@c1 ~]# multipath -F
[root@c1 ~]# multipath -v0
[root@c1 ~]# multipath -v4

[root@c1 ~]# multipath -ll
[root@c1 ~]# 

Friday, 28 March 2014

Apache Prefork and Worker

Prefork MPM uses multiple child processes with one thread each and each process handles one connection at a time.
Worker MPM uses multiple child processes with many threads each. Each thread handles one connection at a time.

Friday, 21 March 2014

Полезные алиасы git

git config --global alias.st status
git config --global alias.ci 'commit -v'
git config --global alias.br branch
git config --global alias.co checkout

Monday, 17 March 2014

Bind's statistics channel and selinux


Mar 17 18:58:19 dns01 named[12144]: /etc/named.conf:39: couldn't allocate statistics channel 127.0.0.1#8053: permission denied

# setenforce 0
# semanage port -a -t dns_port_t -p tcp 8053
# setenforce 1

/etc/init.d/named restart

Tuesday, 18 February 2014

Инкрементальные бэкапы с помощью tar



rm -rf /tmp/*

mkdir /tmp/test_filesystem/{a,b,c} -p

echo 1 > /tmp/test_filesystem/a/file1
echo 2 > /tmp/test_filesystem/b/file2
echo 3 > /tmp/test_filesystem/b/file3

tar cvzf /tmp/archive.1.tar.gz --no-check-device --listed-incremental=/tmp/test.snar /tmp/test_filesystem

echo 4 > /tmp/test_filesystem/b/file4
echo 5 > /tmp/test_filesystem/b/file5

tar cvzf /tmp/archive.2.tar.gz --no-check-device --listed-incremental=/tmp/test.snar /tmp/test_filesystem

rm /tmp/test_filesystem/a/file1 -f

tar cvzf /tmp/archive.3.tar.gz --no-check-device --listed-incremental=/tmp/test.snar /tmp/test_filesystem

mkdir /tmp/test-extract



чтобы восстановить состояние файловой системы, восстанавливаем архивы в порядке возрастания номеров архивов:



первым идет полный архив:
tar xvf /tmp/archive.1.tar.gz -C /tmp/test-extract

потом инкрементальные, с указание соответствующей опции:
tar xvf /tmp/archive.2.tar.gz --incremental -C /tmp/test-extract
tar xvf /tmp/archive.3.tar.gz --incremental -C /tmp/test-extract




Sunday, 2 February 2014

Синхронизация реп


yum -y install yum-utils createrepo
yum repolist
repo id        repo name        
base           CentOS-6 - Base  
extras         CentOS-6 - Extras
updates        CentOS-6 - Updates

mkdir -p /media/repos/base
cd /media/repos/base
reposync -r base