Spec-Zone.ru › CouchDB 3.5

Устранение неполадок CouchDB 3 с помощью WeatherReport

Обзор

WeatherReport — это приложение OTP и набор инструментов для диагностики распространённых проблем, которые могут влиять на узел или кластер CouchDB версии 3 (версия 4 и более поздние версии не поддерживаются). Доступ к нему осуществляется с помощью escript командной строки weatherreport.

Вот простой пример использования weatherreport с выводом команды сразу после него:

$ weatherreport --etc /path/to/etc
[warning] Cluster member node3@127.0.0.1 is not connected to this node. Please check whether it is down.

Использование

В большинстве случаев достаточно выполнить команду weatherreport, как показано выше. Однако иногда может потребоваться дополнительная информация или запуск только определённых проверок. Для этого предусмотрены параметры командной строки. Выполните weatherreport --help, чтобы узнать больше об этих параметрах:

$ weatherreport --help
Usage: weatherreport [-c <path>] [-d <level>] [-e] [-h] [-l] [check_name ...]

  -c, --etc                 Path to the CouchDB configuration directory
  -d, --level               Minimum message severity level (default: notice)
  -l, --list                Describe available diagnostic tasks
  -e, --expert              Perform more detailed diagnostics
  -h, --help                Display help/usage
  check_name                A specific check to run

Чтобы узнать, какие проверки будут выполнены, используйте параметр –list:

$ weatherreport --list
Available diagnostic checks:

  custodian            Shard safety/liveness checks
  disk                 Data directory permissions and atime
  internal_replication Check the number of pending internal replication jobs
  ioq                  Check the total number of active IOQ requests
  mem3_sync            Check there is a registered mem3_sync process
  membership           Cluster membership validity
  memory_use           Measure memory usage
  message_queues       Check for processes with large mailboxes
  node_stats           Check useful erlang statistics for diagnostics
  nodes_connected      Cluster node liveness
  process_calls        Check for large numbers of processes with the same current/initial call
  process_memory       Check for processes with high memory usage
  safe_to_rebuild      Check whether the node can safely be taken out of service
  search               Check the local search node is responsive
  tcp_queues           Measure the length of tcp queues in the kernel

Если вам нужны все подробности о том, что делает WeatherReport, можно запустить проверки с более подробным уровнем ведения журнала, используя параметр --level:

$ weatherreport --etc /path/to/etc --level debug
[debug] Not connected to the local cluster node, trying to connect. alive:false connect_failed:undefined
[debug] Starting distributed Erlang.
[debug] Connected to local cluster node 'node1@127.0.0.1'.
[debug] Local RPC: mem3:nodes([]) [5000]
[debug] Local RPC: os:getpid([]) [5000]
[debug] Running shell command: ps -o pmem,rss -p 73905
[debug] Shell command output:
%MEM    RSS
0.3  25116

[debug] Local RPC: nodes([]) [5000]
[debug] Local RPC: mem3:nodes([]) [5000]
[warning] Cluster member node3@127.0.0.1 is not connected to this node. Please check whether it is down.
[info] Process is using 0.3% of available RAM, totalling 25116 KB of real memory.

Обычно достаточно параметров по умолчанию, но подойдут любые названия уровней важности syslog (от наиболее подробного к наименее подробному): debug, info, notice, warning, error, critical, alert, emergency.

Наконец, чтобы запустить только одну диагностическую проверку или список определённых проверок, можно указать их название или названия:

$ weatherreport --etc /path/to/etc nodes_connected
[warning] Cluster member node3@127.0.0.1 is not connected to this node. Please check whether it is down.

Copyright © 2025 The Apache Software Foundation — Licensed under the Apache License 2.0
https://docs.couchdb.org/en/3.5.1/cluster/troubleshooting.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API