未验证 提交 b4ceffde 编写于 作者: X xiaolei li 提交者: GitHub

docs: add taoskeeper start as service (#20588)

* docs: add taoskeeper start as service

* docs: update taoskeer launch
上级 a4eef9ea
...@@ -4,6 +4,9 @@ title: taosKeeper ...@@ -4,6 +4,9 @@ title: taosKeeper
description: This document describes how to use taosKeeper, a tool for exporting TDengine monitoring metrics. description: This document describes how to use taosKeeper, a tool for exporting TDengine monitoring metrics.
--- ---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
## Introduction ## Introduction
taosKeeper is a tool for TDengine that exports monitoring metrics. With taosKeeper, you can easily monitor the operational status of your TDengine deployment. taosKeeper uses the TDengine REST API. It is not necessary to install TDengine Client to use taosKeeper. taosKeeper is a tool for TDengine that exports monitoring metrics. With taosKeeper, you can easily monitor the operational status of your TDengine deployment. taosKeeper uses the TDengine REST API. It is not necessary to install TDengine Client to use taosKeeper.
...@@ -18,9 +21,9 @@ Methods of installing taosKeeper: ...@@ -18,9 +21,9 @@ Methods of installing taosKeeper:
- You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details. --> - You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details. -->
You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details. You can compile taosKeeper separately and install it. Please refer to the [taosKeeper](https://github.com/taosdata/taoskeeper) repository for details.
## Run ## Configuration and Launch
### Configuration and running methods ### Configuration
taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: [Command-line arguments](#command-line-arguments-in-detail), [environment variable](#environment-variable-in-detail) and [configuration file](#configuration-file-parameters-in-detail). The precedence of those is Command-line, environment variable and configuration file. taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: [Command-line arguments](#command-line-arguments-in-detail), [environment variable](#environment-variable-in-detail) and [configuration file](#configuration-file-parameters-in-detail). The precedence of those is Command-line, environment variable and configuration file.
...@@ -33,26 +36,79 @@ monitorFqdn localhost # taoskeeper's FQDN ...@@ -33,26 +36,79 @@ monitorFqdn localhost # taoskeeper's FQDN
For more information, see [TDengine Monitoring Configuration](../config/#monitoring). For more information, see [TDengine Monitoring Configuration](../config/#monitoring).
### Command-Line Parameters ### Quick Launch
You can use command-line parameters to run taosKeeper and control its behavior: <Tabs>
<TabItem label="Linux" value="linux">
```shell After the installation is complete, run the following command to start the taoskeeper service:
$ taosKeeper
```bash
systemctl start taoskeeper
``` ```
### Environment variable
You can use Environment variable to run taosKeeper and control its behavior: Run the following command to confirm that taoskeeper is running normally:
```bash
systemctl status taoskeeper
```
Output similar to the following indicates that taoskeeper is running normally:
```shell
$ export TAOS_KEEPER_TDENGINE_HOST=192.168.64.3
$ taoskeeper
``` ```
Active: active (running)
```
Output similar to the following indicates that taoskeeper has not started successfully:
```
Active: inactive (dead)
```
The following `systemctl` commands can help you manage taoskeeper service:
- Start taoskeeper Server: `systemctl start taoskeeper`
- Stop taoskeeper Server: `systemctl stop taoskeeper`
- Restart taoskeeper Server: `systemctl restart taoskeeper`
- Check taoskeeper Server status: `systemctl status taoskeeper`
:::info
- The `systemctl` command requires _root_ privileges. If you are not logged in as the _root_ user, use the `sudo` command.
- The `systemctl stop taoskeeper` command will instantly stop taoskeeper Server.
- If your system does not include `systemd`, you can run `/usr/local/taos/bin/taoskeeper` to start taoskeeper manually.
:::
</TabItem>
<TabItem label="macOS" value="macos">
After the installation is complete, run `launchctl start com.tdengine.taoskeeper` to start taoskeeper Server.
The following `launchctl` commands can help you manage taoskeeper service:
- Start taoskeeper Server: `sudo launchctl start com.tdengine.taoskeeper`
- Stop taoskeeper Server: `sudo launchctl stop com.tdengine.taoskeeper`
- Check taoskeeper Server status: `sudo launchctl list | grep taoskeeper`
:::info
- Please use `sudo` to run `launchctl` to manage _com.tdengine.taoskeeper_ with administrator privileges.
- The administrator privilege is required for service management to enhance security.
- Troubleshooting:
- The first column returned by the command `launchctl list | grep taoskeeper` is the PID of the program. If it's `-`, that means the taoskeeper service is not running.
- If the service is abnormal, please check the `launchd.log` file from the system log.
:::
you can run `taoskeeper -h` for more detail. </TabItem>
</Tabs>
### Configuration File #### Launch With Configuration File
You can quickly launch taosKeeper with the following commands. If you do not specify a configuration file, `/etc/taos/keeper.toml` is used by default. If this file does not specify configurations, the default values are used. You can quickly launch taosKeeper with the following commands. If you do not specify a configuration file, `/etc/taos/keeper.toml` is used by default. If this file does not specify configurations, the default values are used.
......
...@@ -4,6 +4,9 @@ title: taosKeeper ...@@ -4,6 +4,9 @@ title: taosKeeper
description: TDengine 3.0 版本监控指标的导出工具 description: TDengine 3.0 版本监控指标的导出工具
--- ---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
## 简介 ## 简介
taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。 taosKeeper 是 TDengine 3.0 版本监控指标的导出工具,通过简单的几项配置即可获取 TDengine 的运行状态。taosKeeper 使用 TDengine RESTful 接口,所以不需要安装 TDengine 客户端即可使用。
...@@ -18,9 +21,9 @@ taosKeeper 安装方式: ...@@ -18,9 +21,9 @@ taosKeeper 安装方式:
<!-- - 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。--> <!-- - 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。-->
- 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。 - 单独编译 taosKeeper 并安装,详情请参考 [taosKeeper](https://github.com/taosdata/taoskeeper) 仓库。
## 运行 ## 配置和运行方式
### 配置和运行方式 ### 配置
taosKeeper 需要在操作系统终端执行,该工具支持三种配置方式:[命令行参数](#命令行参数启动)[环境变量](#环境变量启动)[配置文件](#配置文件启动)。优先级为:命令行参数、环境变量、配置文件参数。 taosKeeper 需要在操作系统终端执行,该工具支持三种配置方式:[命令行参数](#命令行参数启动)[环境变量](#环境变量启动)[配置文件](#配置文件启动)。优先级为:命令行参数、环境变量、配置文件参数。
...@@ -34,27 +37,80 @@ monitorFqdn localhost # taoskeeper 服务的 FQDN ...@@ -34,27 +37,80 @@ monitorFqdn localhost # taoskeeper 服务的 FQDN
TDengine 监控配置相关,具体请参考:[TDengine 监控配置](../config/#监控相关) TDengine 监控配置相关,具体请参考:[TDengine 监控配置](../config/#监控相关)
### 命令行参数启动 ### 启动
在使用命令行参数运行 taosKeeper 并控制其行为。 <Tabs>
<TabItem label="Linux" value="linux">
```shell 安装后,请使用 `systemctl` 命令来启动 taoskeeper 的服务进程。
$ taosKeeper
```bash
systemctl start taoskeeper
``` ```
### 环境变量启动 检查服务是否正常工作:
通过设置环境变量达到控制启动参数的目的,通常在容器中运行时使用。 ```bash
systemctl status taoskeeper
```
```shell 如果服务进程处于活动状态,则 status 指令会显示如下的相关信息:
$ export TAOS_KEEPER_TDENGINE_HOST=192.168.64.3
```
$ taoskeeper Active: active (running)
``` ```
具体参数列表请参照 `taoskeeper -h` 输入结果。 如果后台服务进程处于停止状态,则 status 指令会显示如下的相关信息:
```
Active: inactive (dead)
```
如下 `systemctl` 命令可以帮助你管理 taoskeeper 服务:
- 启动服务进程:`systemctl start taoskeeper`
- 停止服务进程:`systemctl stop taoskeeper`
- 重启服务进程:`systemctl restart taoskeeper`
- 查看服务状态:`systemctl status taoskeeper`
:::info
- `systemctl` 命令需要 _root_ 权限来运行,如果您非 _root_ 用户,请在命令前添加 `sudo`
- 如果系统中不支持 `systemd`,也可以用手动运行 `/usr/local/taos/bin/taoskeeper` 方式启动 taoskeeper 服务。
- 故障排查:
- 如果服务异常请查看系统日志获取更多信息。
:::
</TabItem>
<TabItem label="macOS" value="macOS">
安装后,可以运行 `sudo launchctl start com.tdengine.taoskeeper` 来启动 taoskeeper 服务进程。
如下 `launchctl` 命令用于管理 taoskeeper 服务:
- 启动服务进程:`sudo launchctl start com.tdengine.taoskeeper`
- 停止服务进程:`sudo launchctl stop com.tdengine.taoskeeper`
- 查看服务状态:`sudo launchctl list | grep taoskeeper`
:::info
- `launchctl` 命令管理`com.tdengine.taoskeeper`需要管理员权限,务必在前面加 `sudo` 来增强安全性。
- `sudo launchctl list | grep taoskeeper` 指令返回的第一列是 `taoskeeper` 程序的 PID,若为 `-` 则说明 taoskeeper 服务未运行。
- 故障排查:
- 如果服务异常请查看系统日志获取更多信息。
:::
</TabItem>
</Tabs>
### 配置文件启动 #### 配置文件启动
执行以下命令即可快速体验 taosKeeper。当不指定 taosKeeper 配置文件时,优先使用 `/etc/taos/keeper.toml` 配置,否则将使用默认配置。 执行以下命令即可快速体验 taosKeeper。当不指定 taosKeeper 配置文件时,优先使用 `/etc/taos/keeper.toml` 配置,否则将使用默认配置。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册