对域和澳门比分网址状态执行健康检查

定期,您可能需要确认特定管理程序或澳门比分网址的状态,或特定存储管理器(SM)进程或事务引擎(TE)进程。

Invocations of the nuocmd check commands documented here exit with exit code 0 if the nuocmd check condition is successful and generate no output. 如果检查条件不成功,则命令将退出退出代码1并生成描述失败的错误消息。 To display the nuocmd check command return value, after running the command, type echo $? at the Linux prompt.

以下命令提供有关流程数及其状态的信息:

nuocmd check database --db-name <database name>
子命令 描述

--check-liveness n

Checks that all processes have responded within the specified number (n) of seconds.

--check-running

Checks whether the database is in the RUNNING state.

--num-processes n

检查进程数。

nuocmd check servers
子命令 描述

--check-active

Check that all servers are ACTIVE.

--check-connected

Check that all servers are CONNECTED to the server performing the check.

--check-leader

检查所有服务器是否同意领导者。

--num-servers n

检查管理服务器成员身份等于 n 管理服务器的数量。

nuocmd check process --start-id <start_id>
子命令 描述

--check-running

Check that the database process is in the RUNNING state.

--check-exited

检查澳门比分网址进程是否退出。

--check-liveness n

检查澳门比分网址进程是否已响应 n number of seconds.

For each nuocmd check command, you may add a --timeout or a --wait-forever option. 如果两者都没有提供,则检查一次,并命令返回。 Use --timeout TIMEOUT to specify how long (in seconds) to wait for the database check to pass. Use --wait-forever to specify no limit to how long to wait for the database check to pass.

The commands documented here are issued using NuoDB Command (nuocmd). For more information on NuoDB Command and other command line tools, see 命令行工具.

例子

Example 1: Using the --check-running subcommand without timing out

To check whether a database named test is running, and wait until it is running, specify the following:

nuocmd check database --db-name test --check-running --wait-forever
Example 2: Using the --check-running subcommand with the timeout option

To check, for a period of 10 seconds before timing out, whether a database named test is running, specify the following:

nuocmd check database --db-name test --check-running --timeout 10
Example 3: Using the --num-processes subcommand with the timeout option

To check for a period of 10 seconds before timing out, whether a database named test has four processes ( say two TE processes and two SM processes), specify the following:

nuocmd check database --db-name test --num-processes 4 --timeout 10
Example 4: Using the --check-running subcommand without timing out

要检查具有特定启动ID的澳门比分网址进程是否正在运行,并等待在运行之前,请指定以下内容:

nuocmd check process --start-id 1 --check-running --wait-forever
Example 5: Using the --check-exited subcommand without timing out

A shutdown process command was issued on start ID 1. To check whether the database process with start ID 1 has exited, and wait until it has, specify the following:

nuocmd check process --start-id 1 --check-exited --wait-forever
Example 6: Using the nuocmd check command in a Bash if statement

Check if database test is running and has three database processes.

if nuocmd check database --db-name test --check-running --num-processes 3; then
    echo "Database test is RUNNING with 3 processes"
fi