Skip to content


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

удаление indices в elasticsearch

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


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

  1. 122M    .marvel-2016.04.01
  2. 127M    .marvel-2016.04.02
  3. 132M    .marvel-2016.04.03
  4. 140M    .marvel-2016.04.04
  5. 144M    .marvel-2016.04.05
  6. 149M    .marvel-2016.04.06
  7. 154M    .marvel-2016.04.07
  8. 158M    .marvel-2016.04.08
  9. 164M    .marvel-2016.04.09

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

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

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

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

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

Размещено в категории *nix, Howto.

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

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

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

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

Размещено в категории *nix, Развлекуха.

RT и Perl modules hell

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

Установка RT

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

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

  1. # perl sbin/rt-test-dependencies
  2. perl:
  3.  >=5.10.1(5.10.1) ...found
  4. users:
  5.  rt group (rt) ...found
  6.  bin owner (root) ...found
  7.  libs owner (root) ...found
  8.  libs group (bin) ...found
  9.  web owner (apache) ...found
  10.  web group (apache) ...found
  11. CLI dependencies:
  12. CORE dependencies:  
  13.  HTML::FormatText::WithLinks::AndTables ...MISSING
  14.  HTML::Mason::PSGIHandler >= 0.52 ...MISSING
  15.  HTML::FormatText::WithLinks >= 0.14 ...MISSING
  16.  Plack::Handler::Starlet ...MISSING
  17. DASHBOARDS dependencies:
  18. GD dependencies:
  19. GPG dependencies:
  20. GRAPHVIZ dependencies:
  21. ICAL dependencies:
  22. MAILGATE dependencies:
  23. SMIME dependencies:
  24. USERLOGO dependencies:
  25.  
  26. SOME DEPENDENCIES WERE MISSING.
  27. CORE missing dependencies:
  28.  HTML::FormatText::WithLinks >= 0.14 ...MISSING
  29.  HTML::Mason::PSGIHandler >= 0.52 ...MISSING
  30.  HTML::FormatText::WithLinks::AndTables ...MISSING
  31.  Plack::Handler::Starlet ...MISSING
  32.  
  33. Perl library path for /usr/bin/perl:
  34.     /usr/local/lib64/perl5
  35.     /usr/local/share/perl5
  36.     /usr/lib64/perl5/vendor_perl
  37.     /usr/share/perl5/vendor_perl
  38.     /usr/lib64/perl5
  39.     /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 при попытке установки выдавал грусть-печальное

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

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

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

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

  1. Running install for module 'Thread'
  2. The most recent version "3.04" of the module "Thread"
  3. is part of the perl-5.24.0 distribution. To install that, you need to run
  4.   force install Thread   --or--
  5.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  6. Running make test
  7.   Can't test without successful make
  8. Running make install
  9.   Make had returned bad status, install seems impossible
  10. Running install for module 'Tie::Array'
  11. The most recent version "1.06" of the module "Tie::Array"
  12. is part of the perl-5.24.0 distribution. To install that, you need to run
  13.   force install Tie::Array   --or--
  14.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  15. Running make test
  16.   Can't test without successful make
  17. Running make install
  18.   Make had returned bad status, install seems impossible
  19. Running install for module 'Tie::Hash'
  20. The most recent version "1.05" of the module "Tie::Hash"
  21. is part of the perl-5.24.0 distribution. To install that, you need to run
  22.   force install Tie::Hash   --or--
  23.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  24. Running make test
  25.   Can't test without successful make
  26. Running make install
  27.   Make had returned bad status, install seems impossible
  28. Running install for module 'Tie::Hash::NamedCapture'
  29. The most recent version "0.09" of the module "Tie::Hash::NamedCapture"
  30. is part of the perl-5.24.0 distribution. To install that, you need to run
  31.   force install Tie::Hash::NamedCapture   --or--
  32.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  33. Running make test
  34.   Can't test without successful make
  35. Running make install
  36.   Make had returned bad status, install seems impossible
  37. Running install for module 'Tie::Scalar'
  38. The most recent version "1.04" of the module "Tie::Scalar"
  39. is part of the perl-5.24.0 distribution. To install that, you need to run
  40.   force install Tie::Scalar   --or--
  41.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  42. Running make test
  43.   Can't test without successful make
  44. Running make install
  45.   Make had returned bad status, install seems impossible
  46. Running install for module 'Tie::StdHandle'
  47. The most recent version "4.4" of the module "Tie::StdHandle"
  48. is part of the perl-5.24.0 distribution. To install that, you need to run
  49.   force install Tie::StdHandle   --or--
  50.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  51. Running make test
  52.   Can't test without successful make
  53. Running make install
  54.   Make had returned bad status, install seems impossible
  55. Time::Zone is up to date (2.24).
  56. Tree::Simple::Visitor is up to date (1.29).
  57. Running install for module 'UNIVERSAL'
  58. The most recent version "1.13" of the module "UNIVERSAL"
  59. is part of the perl-5.24.0 distribution. To install that, you need to run
  60.   force install UNIVERSAL   --or--
  61.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  62. Running make test
  63.   Can't test without successful make
  64. Running make install
  65.   Make had returned bad status, install seems impossible
  66. Running install for module 'Unicode::UCD'
  67. The most recent version "0.64" of the module "Unicode::UCD"
  68. is part of the perl-5.24.0 distribution. To install that, you need to run
  69.   force install Unicode::UCD   --or--
  70.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  71. Running make test
  72.   Can't test without successful make
  73. Running make install
  74.   Make had returned bad status, install seems impossible
  75. Running install for module 'XML::Parser::Expat'
  76. Running make for T/TO/TODDR/XML-Parser-2.44.tar.gz
  77.   Has already been unwrapped into directory /home/avz/.cpan/build/XML-Parser-2.44-TDESRf  
  78. Could not make: Unknown error
  79. Warning (usually harmless): 'YAML' not installed, will not store persistent state
  80. Running make test
  81.   Can't test without successful make
  82. Running make install
  83.   Make had returned bad status, install seems impossible
  84. Running install for module 'attributes'
  85. The most recent version "0.27" of the module "attributes"
  86. is part of the perl-5.24.0 distribution. To install that, you need to run
  87.   force install attributes   --or--
  88.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  89. Running make test
  90.   Can't test without successful make
  91. Running make install
  92.   Make had returned bad status, install seems impossible
  93. autodie::exception is up to date (2.29).
  94. autodie::exception::system is up to date (2.29).
  95. autodie::hints is up to date (2.29).
  96. bigint is up to date (0.43).
  97. bigrat is up to date (0.43).
  98. Running install for module 'blib'
  99. The most recent version "1.06" of the module "blib"
  100. is part of the perl-5.24.0 distribution. To install that, you need to run
  101.   force install blib   --or--
  102.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  103. Running make test
  104.   Can't test without successful make
  105. Running make install
  106.   Make had returned bad status, install seems impossible
  107. Running install for module 'bytes'
  108. The most recent version "1.05" of the module "bytes"
  109. is part of the perl-5.24.0 distribution. To install that, you need to run
  110.   force install bytes   --or--
  111.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  112. Running make test
  113.   Can't test without successful make
  114. Running make install
  115.   Make had returned bad status, install seems impossible
  116. Running install for module 'charnames'
  117. The most recent version "1.43" of the module "charnames"
  118. is part of the perl-5.24.0 distribution. To install that, you need to run
  119.   force install charnames   --or--
  120.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  121. Running make test
  122.   Can't test without successful make
  123. Running make install
  124.   Make had returned bad status, install seems impossible
  125. Running install for module 'diagnostics'
  126. The most recent version "1.34" of the module "diagnostics"
  127. is part of the perl-5.24.0 distribution. To install that, you need to run
  128.   force install diagnostics   --or--
  129.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  130. Running make test
  131.   Can't test without successful make
  132. Running make install
  133.   Make had returned bad status, install seems impossible
  134. Running install for module 'feature'
  135. The most recent version "1.42" of the module "feature"
  136. is part of the perl-5.24.0 distribution. To install that, you need to run
  137.   force install feature   --or--
  138.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  139. Running make test
  140.   Can't test without successful make
  141. Running make install
  142.   Make had returned bad status, install seems impossible
  143. fields is up to date (2.23).
  144. Running install for module 'filetest'
  145. The most recent version "1.03" of the module "filetest"
  146. is part of the perl-5.24.0 distribution. To install that, you need to run
  147.   force install filetest   --or--
  148.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  149. Running make test
  150.   Can't test without successful make
  151. Running make install
  152.   Make had returned bad status, install seems impossible
  153. Running install for module 'integer'
  154. The most recent version "1.01" of the module "integer"
  155. is part of the perl-5.24.0 distribution. To install that, you need to run
  156.   force install integer   --or--
  157.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  158. Running make test
  159.   Can't test without successful make
  160. Running make install
  161.   Make had returned bad status, install seems impossible
  162. Running install for module 'less'
  163. The most recent version "0.03" of the module "less"
  164. is part of the perl-5.24.0 distribution. To install that, you need to run
  165.   force install less   --or--
  166.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  167. Running make test
  168.   Can't test without successful make
  169. Running make install
  170.   Make had returned bad status, install seems impossible
  171. Running install for module 'locale'
  172. The most recent version "1.09" of the module "locale"
  173. is part of the perl-5.24.0 distribution. To install that, you need to run
  174.   force install locale   --or--
  175.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  176. Running make test
  177.   Can't test without successful make
  178. Running make install
  179.   Make had returned bad status, install seems impossible
  180. Running install for module 'mro'
  181. The most recent version "1.18" of the module "mro"
  182. is part of the perl-5.24.0 distribution. To install that, you need to run
  183.   force install mro   --or--
  184.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  185. Running make test
  186.   Can't test without successful make
  187. Running make install
  188.   Make had returned bad status, install seems impossible
  189. Running install for module 'open'
  190. The most recent version "1.10" of the module "open"
  191. is part of the perl-5.24.0 distribution. To install that, you need to run
  192.   force install open   --or--
  193.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  194. Running make test
  195.   Can't test without successful make
  196. Running make install
  197.   Make had returned bad status, install seems impossible
  198. Running install for module 'overload'
  199. The most recent version "1.26" of the module "overload"
  200. is part of the perl-5.24.0 distribution. To install that, you need to run
  201.   force install overload   --or--
  202.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  203. Running make test
  204.   Can't test without successful make
  205. Running make install
  206.   Make had returned bad status, install seems impossible
  207. Running install for module 'overloading'
  208. The most recent version "0.02" of the module "overloading"
  209. is part of the perl-5.24.0 distribution. To install that, you need to run
  210.   force install overloading   --or--
  211.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  212. Running make test
  213.   Can't test without successful make
  214. Running make install
  215.   Make had returned bad status, install seems impossible
  216. Running install for module 're'
  217. The most recent version "0.32" of the module "re"
  218. is part of the perl-5.24.0 distribution. To install that, you need to run
  219.   force install re   --or--
  220.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  221. Running make test
  222.   Can't test without successful make
  223. Running make install
  224.   Make had returned bad status, install seems impossible
  225. Running install for module 'sigtrap'
  226. The most recent version "1.08" of the module "sigtrap"
  227. is part of the perl-5.24.0 distribution. To install that, you need to run
  228.   force install sigtrap   --or--
  229.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  230. Running make test
  231.   Can't test without successful make
  232. Running make install
  233.   Make had returned bad status, install seems impossible
  234. Running install for module 'sort'
  235. The most recent version "2.02" of the module "sort"
  236. is part of the perl-5.24.0 distribution. To install that, you need to run
  237.   force install sort   --or--
  238.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  239. Running make test
  240.   Can't test without successful make
  241. Running make install
  242.   Make had returned bad status, install seems impossible
  243. Running install for module 'strict'
  244. The most recent version "1.11" of the module "strict"
  245. is part of the perl-5.24.0 distribution. To install that, you need to run
  246.   force install strict   --or--
  247.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  248. Running make test
  249.   Can't test without successful make
  250. Running make install
  251.   Make had returned bad status, install seems impossible
  252. Running install for module 'subs'
  253. The most recent version "1.02" of the module "subs"
  254. is part of the perl-5.24.0 distribution. To install that, you need to run
  255.   force install subs   --or--
  256.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  257. Running make test
  258.   Can't test without successful make
  259. Running make install
  260.   Make had returned bad status, install seems impossible
  261. Running install for module 'utf8'
  262. The most recent version "1.19" of the module "utf8"
  263. is part of the perl-5.24.0 distribution. To install that, you need to run
  264.   force install utf8   --or--
  265.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  266. Running make test
  267.   Can't test without successful make
  268. Running make install
  269.   Make had returned bad status, install seems impossible
  270. Running install for module 'vars'
  271. The most recent version "1.03" of the module "vars"
  272. is part of the perl-5.24.0 distribution. To install that, you need to run
  273.   force install vars   --or--
  274.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  275. Running make test
  276.   Can't test without successful make
  277. Running make install
  278.   Make had returned bad status, install seems impossible
  279. Running install for module 'vmsish'
  280. The most recent version "1.04" of the module "vmsish"
  281. is part of the perl-5.24.0 distribution. To install that, you need to run
  282.   force install vmsish   --or--
  283.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  284. Running make test
  285.   Can't test without successful make
  286. Running make install
  287.   Make had returned bad status, install seems impossible
  288. Running install for module 'warnings'
  289. The most recent version "1.36" of the module "warnings"
  290. is part of the perl-5.24.0 distribution. To install that, you need to run
  291.   force install warnings   --or--
  292.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  293. Running make test
  294.   Can't test without successful make
  295. Running make install
  296.   Make had returned bad status, install seems impossible
  297. Running install for module 'warnings::register'
  298. The most recent version "1.04" of the module "warnings::register"
  299. is part of the perl-5.24.0 distribution. To install that, you need to run
  300.   force install warnings::register   --or--
  301.   install R/RJ/RJBS/perl-5.24.0.tar.gz
  302. Running make test
  303.   Can't test without successful make
  304. Running make install
  305.   Make had returned bad status, install seems impossible
  306. Could not read '/home/avz/.cpan/build/Mouse-v2.4.5-gtPyV1/META.yml'. Falling back to other methods to determine prerequisites
  307. Could not read '/home/avz/.cpan/build/Crypt-SSLeay-0.72-ypNjbf/META.yml'. Falling back to other methods to determine prerequisites
  308. Could not read '/home/avz/.cpan/build/DateTime-TimeZone-Local-Win32-1.94-knZrvf/META.yml'. Falling back to other methods to determine prerequisites
  309. Could not read '/home/avz/.cpan/build/GD-2.56-KfYkXO/META.yml'. Falling back to other methods to determine prerequisites
  310. Could not read '/home/avz/.cpan/build/multidimensional-0.012-GF5S2z/META.yml'. Falling back to other methods to determine prerequisites
  311. Could not read '/home/avz/.cpan/build/bareword-filehandles-0.004-AL8LD9/META.yml'. Falling back to other methods to determine prerequisites
  312. 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" на консоли:

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

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

  1. cpan[5]> notest install Server::Starter
  2. Running install for module 'Server::Starter'
  3.   KAZUHO/Server-Starter-0.32.tar.gz
  4.   Has already been unwrapped into directory /home/avz/.cpan/build/Server-Starter-0.32-0
  5.   KAZUHO/Server-Starter-0.32.tar.gz
  6.   Has already been prepared
  7.   KAZUHO/Server-Starter-0.32.tar.gz
  8.   Has already been made
  9.   KAZUHO/Server-Starter-0.32.tar.gz
  10.   Skipping test because of notest pragma
  11. Running Build install
  12. Building Server-Starter
  13. Installing /usr/local/share/man/man1/start_server.1
  14. Installing /usr/local/share/perl5/Server/Starter.pm
  15. Installing /usr/local/share/perl5/Server/Starter/Guard.pm
  16. Installing /usr/local/share/man/man3/Server::Starter.3pm
  17. Installing /usr/local/bin/start_server
  18.   KAZUHO/Server-Starter-0.32.tar.gz
  19.   ./Build install  -- OK

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

  1. # perl sbin/rt-test-dependencies
  2. perl:
  3.  >=5.10.1(5.10.1) ...found
  4. users:
  5.  rt group (rt) ...found
  6.  bin owner (root) ...found
  7.  libs owner (root) ...found
  8.  libs group (bin) ...found
  9.  web owner (apache) ...found
  10.  web group (apache) ...found
  11. CLI dependencies:
  12. CORE dependencies:
  13. DASHBOARDS dependencies:
  14. GD dependencies:
  15. GPG dependencies:
  16. GRAPHVIZ dependencies:
  17. ICAL dependencies:
  18. MAILGATE dependencies:
  19. SMIME dependencies:
  20. USERLOGO dependencies:
  21.  
  22. All dependencies have been found.

Перемога!

Размещено в категории *nix, Howto. Теги: , , .

Как включить депозитное свойство карты универсальная

Оказывается, не все в курсе, что для карты "универсальная" (раньше она называлась "кредитка универсальная") от приватбанка можно включить начисление процентов на остаток.

1. Выбираем нужную карту в списке карт слева и переходим в её настройки, кликая по ссылке "управление картой/счетом":

Управление картой в приват24

Универсалка - включаем начисление процентов на остаток

2. Если депозитное свойство не активировано, то включаем его:

Депозитное свойство карты универсальная

Что сделать чтобы капали проценты по универсальной

Всё. В результате получаем примерно 10% годовых от остатка на бонусный счет. Средства с бонусного счета можно тратить в торговых точках c наклейками "бонус-плюс". Полный их список есть на официальном сайте.

Размещено в категории Деньги.

Страница 1 из 48123456789101112...Последняя »