Skip to content


smartctl -x на RAID-контроллере HP Smart Array E200i

Как-то раз на просторах ынтернета попался мне совет запустить smartctl с параметром -x.

Я, конечно, как всякий homo sapiens, сначала почитал man:

-x, --xall
     Prints all SMART and non-SMART information about the device. For ATA
     devices this is equivalent to ´-H -i -g all -c -A -f brief
     -l xerror,error -l xselftest,selftest -l selective -l directory
     -l scttemp -l scterc -l devstat -l sataphy´.
     and for SCSI, this is equivalent to
     ´-H -i -A -l error -l selftest -l background -l sasphy´.

Не увидев там ничего стрёмного, выполнил вот такую командочку:

# smartctl -x -a -d cciss,0 /dev/cciss/c0d0
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-642.13.1.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
 
/dev/cciss/c0d0 [cciss_disk_00] [SCSI]: Device open changed type from 'sat,auto' to 'cciss'
Vendor:               SEAGATE 
Product:              ST91000640SS    
Revision:             0001
User Capacity:        1,000,204,886,016 bytes [1.00 TB]
Logical block size:   512 bytes
Logical Unit id:      0x5000c50025fd7283
Serial number:        9XG02CLM00009126234W
Device type:          disk
Transport protocol:   SAS
Local Time is:        Tue Jan 31 15:29:39 2017 UTC
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK
 
Current Drive Temperature:     22 C
Drive Trip Temperature:        68 C
Manufactured in week  of year 20
Specified cycle count over device lifetime:  10000
Accumulated start-stop cycles:  36
Specified load-unload count over device lifetime:  300000
Accumulated load-unload cycles:  36
Elements in grown defect list: 3
Vendor (Seagate) cache information
  Blocks sent to initiator = 791069177
  Blocks received from initiator = 8147385
  Blocks read from cache and sent to initiator = 6510918
  Number of read and write commands whose size <= segment size = 1294551
  Number of read and write commands whose size > segment size = 0
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 37972.70
  number of minutes until next internal SMART test = 12
 
Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:    8169902        0         0   8169902          0       2604.051           0
write:         0        0         0         0          0          4.359           0
 
Non-medium error count:        1
 
[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
No self-tests have been logged
Long (extended) Self Test duration: 12198 seconds [203.3 minutes]
Segmentation fault (core dumped)

И... консолька замерла, связь с сервером пропала, пинга нет. Слава Хэнку, что сервер был не из production-кластера. И через пару минут самостоятельно поднялся.

При этом стоит отметить, что командочка smartctl -a -d cciss,0 /dev/cciss/c0d0 (то же самое, но без -x) там же пару минут ранее выполнялась несколько раз без каких-либо проблем. OS – CentOS 6.8 x86_64, RAID-контроллер HP Smart Array E200i.

Мораль: будьте осторожны со smartctl. Я предупредил.

Posted in *nix.

Tagged with , .


Elasticsearch: уменьшение занятого места на диске

удаление indices в elasticsearch

Как отключить marvel-plugin в elasticsearch


В один прекрасный день SMS от nagios-а известила меня, что на сервере закончилось место. Как оказалось, место закончилось в основном по той причине, что директория /var/lib/elasticsearch/my-elasticsearch/nodes/0/indices разрозслась до неприличных размеров (около 100ГБ). Заглянув вовнутрь, я обнаружил кучу директорий с именами вида:

122M    .marvel-2016.04.01
127M    .marvel-2016.04.02
132M    .marvel-2016.04.03
140M    .marvel-2016.04.04
144M    .marvel-2016.04.05
149M    .marvel-2016.04.06
154M    .marvel-2016.04.07
158M    .marvel-2016.04.08
164M    .marvel-2016.04.09

Этак за пару годиков около 100ГБ и насобиралось. Дядька гугл подсказал, что файлы эти создаются с целью сбора статистики по работе elasticsearch. Так как эта статистика в моем случае никому нафиг не сдалась, я решил от них избавиться. Делается это простым HTTP-запросом, например, с помощью curl:

$ curl -XDELETE 127.0.0.1:9200/.marvel-2016.03*
{"acknowledged":true}

Данная командочка удалит все поддиректории в дире indices за март 2016-го года, тем самым освободив нам около 4ГБ дискового пространства.

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

$ sudo /usr/share/elasticsearch/bin/plugin --remove marvel
-> Removing marvel...
Removed marvel
$ sudo /sbin/service elasticsearch restart
Stopping elasticsearch:            [  OK  ]
Starting elasticsearch:            [  OK  ]

Posted in *nix, Howto.


Умный дом: у каждой пылинки свой IP

Зачетный каммент сегодня попался на глаза в статье про новый DHCP-сервер на OpenNet :)

Ржака про умный дом

Лучший каммент про DHCP

Posted in *nix, Развлекуха.


RT и Perl modules hell

Что делать с perl-модулями при установке RT

Установка RT

Наверняка каждый, кто сталкивался с установкой RT (Request Tracker) от BestPractical, вспоминал "незлим тихим словом" того, кто придумал такое огромное количество зависимостей данного программного продукта от разнообразных perl-модулей. Многие десятки их! И я, естественно, не смог устоять перед соблазном установить часть их с помощью yum (дело было под 6-ой CentOS), так как это намного быстрее, чем через CPAN. Те, что не нашлись yum-ом, ставил CPAN-ом, попивая чаек и краем глаза поглядывая на многие экраны сообщений от него в консоли. Да, CPAN – сцуко многословный.

Когда количество нехватающих модулей снизилось до четырех вот этих с пометкой MISSING

# perl sbin/rt-test-dependencies
perl:
 >=5.10.1(5.10.1) ...found
users:
 rt group (rt) ...found
 bin owner (root) ...found
 libs owner (root) ...found
 libs group (bin) ...found
 web owner (apache) ...found
 web group (apache) ...found
CLI dependencies:
CORE dependencies:   
 HTML::FormatText::WithLinks::AndTables ...MISSING
 HTML::Mason::PSGIHandler >= 0.52 ...MISSING
 HTML::FormatText::WithLinks >= 0.14 ...MISSING
 Plack::Handler::Starlet ...MISSING
DASHBOARDS dependencies:
GD dependencies:
GPG dependencies:
GRAPHVIZ dependencies:
ICAL dependencies:
MAILGATE dependencies:
SMIME dependencies:
USERLOGO dependencies:
 
SOME DEPENDENCIES WERE MISSING.
CORE missing dependencies:
 HTML::FormatText::WithLinks >= 0.14 ...MISSING
 HTML::Mason::PSGIHandler >= 0.52 ...MISSING
 HTML::FormatText::WithLinks::AndTables ...MISSING
 Plack::Handler::Starlet ...MISSING
 
Perl library path for /usr/bin/perl:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5

я с прискорбием осознал, что дальше дело не двигается. Yum-ом их найти не удалось, а perl -MCPAN -e shell ругался малопонятными матюками и тоже отказывался что-либо устанавливать. Так, модуль Plack::Handler::Starlet хотел Server::Starter, Server::Starter хотел Net::EmptyPort, Net::EmptyPort хотел IO::Socket::IP, а IO::Socket::IP при попытке установки выдавал грусть-печальное

Socket version 1.97 required--this is only version 1.82 at /root/.cpan/build/IO-Socket-IP-0.37-nWpYmj/blib/lib/IO/Socket/IP.pm line 30.

Ушел гуглить и таки понял, что я не единственный, к счастью, кто столкнулся с такой бедой. Тадам! Запомните эту магическую командочку:

perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

Судя по man-у, оно делает рекомпиляцию динамически загружаемых модулей CPAN-а, что-то там попутно обновляя. Колбасило долго, где-то с пол-часа, и в конце концов выдало не шибко оптимистичную простыню:

Running install for module 'Thread'
The most recent version "3.04" of the module "Thread"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Thread   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Tie::Array'
The most recent version "1.06" of the module "Tie::Array"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Tie::Array   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Tie::Hash'
The most recent version "1.05" of the module "Tie::Hash"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Tie::Hash   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Tie::Hash::NamedCapture'
The most recent version "0.09" of the module "Tie::Hash::NamedCapture"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Tie::Hash::NamedCapture   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Tie::Scalar'
The most recent version "1.04" of the module "Tie::Scalar"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Tie::Scalar   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Tie::StdHandle'
The most recent version "4.4" of the module "Tie::StdHandle"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Tie::StdHandle   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Time::Zone is up to date (2.24).
Tree::Simple::Visitor is up to date (1.29).
Running install for module 'UNIVERSAL'
The most recent version "1.13" of the module "UNIVERSAL"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install UNIVERSAL   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'Unicode::UCD'
The most recent version "0.64" of the module "Unicode::UCD"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install Unicode::UCD   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'XML::Parser::Expat'
Running make for T/TO/TODDR/XML-Parser-2.44.tar.gz
  Has already been unwrapped into directory /home/avz/.cpan/build/XML-Parser-2.44-TDESRf   
Could not make: Unknown error
Warning (usually harmless): 'YAML' not installed, will not store persistent state
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'attributes'
The most recent version "0.27" of the module "attributes"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install attributes   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
autodie::exception is up to date (2.29).
autodie::exception::system is up to date (2.29).
autodie::hints is up to date (2.29).
bigint is up to date (0.43).
bigrat is up to date (0.43).
Running install for module 'blib'
The most recent version "1.06" of the module "blib"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install blib   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'bytes'
The most recent version "1.05" of the module "bytes"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install bytes   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'charnames'
The most recent version "1.43" of the module "charnames"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install charnames   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'diagnostics'
The most recent version "1.34" of the module "diagnostics"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install diagnostics   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'feature'
The most recent version "1.42" of the module "feature"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install feature   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
fields is up to date (2.23).
Running install for module 'filetest'
The most recent version "1.03" of the module "filetest"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install filetest   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'integer'
The most recent version "1.01" of the module "integer"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install integer   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'less'
The most recent version "0.03" of the module "less"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install less   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'locale'
The most recent version "1.09" of the module "locale"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install locale   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'mro'
The most recent version "1.18" of the module "mro"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install mro   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'open'
The most recent version "1.10" of the module "open"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install open   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'overload'
The most recent version "1.26" of the module "overload"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install overload   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'overloading'
The most recent version "0.02" of the module "overloading"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install overloading   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 're'
The most recent version "0.32" of the module "re"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install re   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'sigtrap'
The most recent version "1.08" of the module "sigtrap"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install sigtrap   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'sort'
The most recent version "2.02" of the module "sort"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install sort   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'strict'
The most recent version "1.11" of the module "strict"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install strict   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'subs'
The most recent version "1.02" of the module "subs"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install subs   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'utf8'
The most recent version "1.19" of the module "utf8"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install utf8   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'vars'
The most recent version "1.03" of the module "vars"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install vars   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'vmsish'
The most recent version "1.04" of the module "vmsish"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install vmsish   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'warnings'
The most recent version "1.36" of the module "warnings"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install warnings   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Running install for module 'warnings::register'
The most recent version "1.04" of the module "warnings::register"
is part of the perl-5.24.0 distribution. To install that, you need to run
  force install warnings::register   --or--
  install R/RJ/RJBS/perl-5.24.0.tar.gz
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Could not read '/home/avz/.cpan/build/Mouse-v2.4.5-gtPyV1/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/Crypt-SSLeay-0.72-ypNjbf/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/DateTime-TimeZone-Local-Win32-1.94-knZrvf/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/GD-2.56-KfYkXO/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/multidimensional-0.012-GF5S2z/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/bareword-filehandles-0.004-AL8LD9/META.yml'. Falling back to other methods to determine prerequisites
Could not read '/home/avz/.cpan/build/GD-2.53-R0PZ76/META.yml'. Falling back to other methods to determine prerequisite

И хотя, на первый взгляд, все эти "Can't test", "Could not make: Unknown error" и "Could not read" выглядят весьма депрессивно, на деле оказалось, что появился некоторый прогресс. Так, теперь вместо сообщений об ошибках процесс установки модуля Server::Starter тупо зависал с сообщением "received TERM, sending TERM to all workers:1125" на консоли:

t/04-starter-dir.t ..... ok
t/05-killolddelay.t .... start_server (pid:1038) starting now...
starting new worker 1039
t/05-killolddelay.t .... 5/28 received HUP, spawning a new worker
starting new worker 1125
new worker is now running, sending TERM to old workers:1039
sleeping 3 secs before killing old workers
t/05-killolddelay.t .... 6/28 killing old workers
old worker 1039 died, status:0
t/05-killolddelay.t .... 7/28 received TERM, sending TERM to all workers:1125
 
^C  KAZUHO/Server-Starter-0.32.tar.gz
  ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports KAZUHO/Server-Starter-0.32.tar.gz
Failed during this command:
 KAZUHO/Server-Starter-0.32.tar.gz            : make_test NO

Спустя минут 5 созерцания этой красоты у меня сложилось впечатление, что это таки делает мне нервы, и нажал Ctrl-C. Так как тут речь идет о выполнении каких-то тестов, решил попробовать запустить в CPAN-shell вместо "install Server::Starter" команду "notest install Server::Starter". И шо вы думаете? Таки помогло!

cpan[5]> notest install Server::Starter 
Running install for module 'Server::Starter'
  KAZUHO/Server-Starter-0.32.tar.gz
  Has already been unwrapped into directory /home/avz/.cpan/build/Server-Starter-0.32-0
  KAZUHO/Server-Starter-0.32.tar.gz
  Has already been prepared
  KAZUHO/Server-Starter-0.32.tar.gz
  Has already been made
  KAZUHO/Server-Starter-0.32.tar.gz
  Skipping test because of notest pragma
Running Build install
Building Server-Starter
Installing /usr/local/share/man/man1/start_server.1
Installing /usr/local/share/perl5/Server/Starter.pm
Installing /usr/local/share/perl5/Server/Starter/Guard.pm
Installing /usr/local/share/man/man3/Server::Starter.3pm
Installing /usr/local/bin/start_server
  KAZUHO/Server-Starter-0.32.tar.gz
  ./Build install  -- OK

Ну а далее perl -MCPAN -e shell далее все четыре недостающих модуля установил без сучка и задоринки и взору предстала вожделенная картина:

# perl sbin/rt-test-dependencies
perl:
 >=5.10.1(5.10.1) ...found
users:
 rt group (rt) ...found
 bin owner (root) ...found
 libs owner (root) ...found
 libs group (bin) ...found
 web owner (apache) ...found
 web group (apache) ...found
CLI dependencies:
CORE dependencies:
DASHBOARDS dependencies:
GD dependencies:
GPG dependencies:
GRAPHVIZ dependencies:
ICAL dependencies:
MAILGATE dependencies:
SMIME dependencies:
USERLOGO dependencies:
 
All dependencies have been found.

Перемога!

Posted in *nix, Howto.

Tagged with , , .