[TSDB] OpenGemini 运维指南

news/2024/12/27 1:12:06/文章来源:https://www.cnblogs.com/johnnyzen/p/18634213

OpenGemini 运维指南

概述 : OpenGemini 运维

Gemix : 官方部署运维一体化工具

启动集群 : gemix cluster start {geminiClusterName}

[root@vmw-b ~]# gemix cluster start gemini-test
Starting cluster gemini-test...
+ [ Serial ] - SSHKeySet: privateKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa, publicKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=root, host=192.168.101.102
+ [Parallel] - UserSSH: user=root, host=192.168.101.103
+ [Parallel] - UserSSH: user=root, host=192.168.101.104
+ [Parallel] - UserSSH: user=root, host=192.168.101.102
+ [Parallel] - UserSSH: user=root, host=192.168.101.103
+ [Parallel] - UserSSH: user=root, host=192.168.101.104
+ [Parallel] - UserSSH: user=root, host=192.168.101.102
+ [Parallel] - UserSSH: user=root, host=192.168.101.103
+ [Parallel] - UserSSH: user=root, host=192.168.101.104
+ [Parallel] - UserSSH: user=root, host=192.168.101.105
+ [Parallel] - UserSSH: user=root, host=192.168.101.105
+ [ Serial ] - StartCluster
Starting component ts-metaStarting instance 192.168.101.104:8091Starting instance 192.168.101.102:8091Starting instance 192.168.101.103:8091Start instance 192.168.101.104:8091 successStart instance 192.168.101.103:8091 successStart instance 192.168.101.102:8091 success
Starting component ts-storeStarting instance 192.168.101.104:8401Starting instance 192.168.101.102:8401Starting instance 192.168.101.103:8401Start instance 192.168.101.104:8401 successStart instance 192.168.101.103:8401 successStart instance 192.168.101.102:8401 success
Starting component ts-sqlStarting instance 192.168.101.104:8086Starting instance 192.168.101.102:8086Starting instance 192.168.101.103:8086Start instance 192.168.101.104:8086 successStart instance 192.168.101.103:8086 successStart instance 192.168.101.102:8086 success
Starting component ts-serverStarting instance 192.168.101.105:8186Start instance 192.168.101.105:8186 success
Starting component grafanaStarting instance 192.168.101.105:3000Start instance 192.168.101.105:3000 success
Starting component ts-monitorStarting instance 192.168.101.103Starting instance 192.168.101.104Starting instance 192.168.101.105Starting instance 192.168.101.102Start 192.168.101.104 successStart 192.168.101.103 successStart 192.168.101.105 successStart 192.168.101.102 success
Started cluster `gemini-test` successfully

停运集群 : gemix cluster stop {geminiClusterName}

[root@vmw-b opengemini]# gemix cluster stop gemini-test
Will stop the cluster gemini-test with nodes: , roles: .
Do you want to continue? [y/N]:(default=N) y
+ [ Serial ] - SSHKeySet: privateKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa, publicKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-e.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-e.servers.com
+ [ Serial ] - StopCluster
Stopping component grafanaStopping instance vmw-e.servers.comStop grafana vmw-e.servers.com:3000 success
Stopping component ts-serverStopping instance vmw-e.servers.comStop ts-server vmw-e.servers.com:8186 success
Stopping component ts-sqlStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-sql vmw-d.servers.com:8086 successStop ts-sql vmw-c.servers.com:8086 successStop ts-sql vmw-b.servers.com:8086 success
Stopping component ts-storeStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-store vmw-d.servers.com:8401 successStop ts-store vmw-c.servers.com:8401 successStop ts-store vmw-b.servers.com:8401 success
Stopping component ts-metaStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-meta vmw-d.servers.com:8091 successStop ts-meta vmw-c.servers.com:8091 successStop ts-meta vmw-b.servers.com:8091 success
Stopping component ts-monitorStopping instance vmw-e.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStopping instance vmw-d.servers.comStop vmw-e.servers.com successStop vmw-d.servers.com successStop vmw-c.servers.com successStop vmw-b.servers.com success
Stopped cluster `gemini-test` successfully
[root@vmw-b opengemini]# 

卸载集群 : gemix cluster uninstall

[root@vmw-b go-study]# gemix cluster uninstall gemini-test██     ██  █████  ██████  ███    ██ ██ ███    ██  ████████     ██ ██   ██ ██   ██ ████   ██ ██ ████   ██ ████  █  ██ ███████ ██████  ██ ██  ██ ██ ██ ██  ██ ██   █████ ███ ██ ██   ██ ██   ██ ██  ██ ██ ██ ██  ██ ██ ██    █████ ███  ██   ██ ██   ██ ██   ████ ██ ██   ████  ██████This operation will destroy openGemini v1.2.0 cluster gemini-test and its data.
Are you sure to continue?
(Type "Yes, I know my cluster and data will be deleted." to continue)
: Yes, I know my cluster and data will be deleted.
Destroying cluster...
+ [ Serial ] - SSHKeySet: privateKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa, publicKey=/root/.gemix/storage/cluster/clusters/gemini-test/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-b.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-c.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-d.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-e.servers.com
+ [Parallel] - UserSSH: user=root, host=vmw-e.servers.com
+ [ Serial ] - StopCluster
Stopping component grafanaStopping instance vmw-e.servers.comStop grafana vmw-e.servers.com:3000 success
Stopping component ts-serverStopping instance vmw-e.servers.comStop ts-server vmw-e.servers.com:8186 success
Stopping component ts-sqlStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-sql vmw-d.servers.com:8086 successStop ts-sql vmw-c.servers.com:8086 successStop ts-sql vmw-b.servers.com:8086 success
Stopping component ts-storeStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-store vmw-c.servers.com:8401 successStop ts-store vmw-d.servers.com:8401 successStop ts-store vmw-b.servers.com:8401 success
Stopping component ts-metaStopping instance vmw-d.servers.comStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStop ts-meta vmw-d.servers.com:8091 successStop ts-meta vmw-c.servers.com:8091 successStop ts-meta vmw-b.servers.com:8091 success
Stopping component ts-monitorStopping instance vmw-b.servers.comStopping instance vmw-c.servers.comStopping instance vmw-d.servers.comStopping instance vmw-e.servers.comStop vmw-c.servers.com successStop vmw-d.servers.com successStop vmw-e.servers.com successStop vmw-b.servers.com success
+ [ Serial ] - UninstallCluster
Destroying component grafanaDestroying instance vmw-e.servers.comDestroy vmw-e.servers.com finished- Destroy grafana paths: [/usr/local/opengemini/gemini-deploy/grafana-3000 /etc/systemd/system/grafana-3000.service]Destroying component ts-serverDestroying instance vmw-e.servers.comDestroy vmw-e.servers.com finished- Destroy ts-server paths: [/usr/local/opengemini/gemini-deploy/ts-server-8186/data /usr/local/opengemini/gemini-log/logs/ts-server-8186 /usr/local/opengemini/gemini-deploy/ts-server-8186 /etc/systemd/system/ts-server-8186.service]Uninstalling monitored vmw-e.servers.comUninstalling instance vmw-e.servers.com
Uninstalling monitored on vmw-e.servers.com success
Destroying component ts-sqlDestroying instance vmw-b.servers.comDestroy vmw-b.servers.com finished- Destroy ts-sql paths: [/usr/local/opengemini/gemini-log/logs/ts-sql-8086 /usr/local/opengemini/gemini-deploy/ts-sql-8086 /etc/systemd/system/ts-sql-8086.service]Destroying instance vmw-c.servers.comDestroy vmw-c.servers.com finished- Destroy ts-sql paths: [/usr/local/opengemini/gemini-log/logs/ts-sql-8086 /usr/local/opengemini/gemini-deploy/ts-sql-8086 /etc/systemd/system/ts-sql-8086.service]Destroying instance vmw-d.servers.comDestroy vmw-d.servers.com finished- Destroy ts-sql paths: [/usr/local/opengemini/gemini-log/logs/ts-sql-8086 /usr/local/opengemini/gemini-deploy/ts-sql-8086 /etc/systemd/system/ts-sql-8086.service]Destroying component ts-storeDestroying instance vmw-b.servers.comDestroy vmw-b.servers.com finished- Destroy ts-store paths: [/data/gemini-data/data /usr/local/opengemini/gemini-log/logs/ts-store-8401 /usr/local/opengemini/gemini-deploy/ts-store-8401 /etc/systemd/system/ts-store-8401.service]Destroying instance vmw-c.servers.comDestroy vmw-c.servers.com finished- Destroy ts-store paths: [/data/gemini-data/data /usr/local/opengemini/gemini-log/logs/ts-store-8401 /usr/local/opengemini/gemini-deploy/ts-store-8401 /etc/systemd/system/ts-store-8401.service]Destroying instance vmw-d.servers.comDestroy vmw-d.servers.com finished- Destroy ts-store paths: [/data/gemini-data/data /usr/local/opengemini/gemini-log/logs/ts-store-8401 /usr/local/opengemini/gemini-deploy/ts-store-8401 /etc/systemd/system/ts-store-8401.service]Destroying component ts-metaDestroying instance vmw-b.servers.comDestroy vmw-b.servers.com finished- Destroy ts-meta paths: [/data/gemini-data/meta /usr/local/opengemini/gemini-log/logs/ts-meta-8091 /usr/local/opengemini/gemini-deploy/ts-meta-8091 /etc/systemd/system/ts-meta-8091.service]Destroying instance vmw-c.servers.comDestroy vmw-c.servers.com finished- Destroy ts-meta paths: [/etc/systemd/system/ts-meta-8091.service /data/gemini-data/meta /usr/local/opengemini/gemini-log/logs/ts-meta-8091 /usr/local/opengemini/gemini-deploy/ts-meta-8091]Destroying instance vmw-d.servers.comDestroy vmw-d.servers.com finished- Destroy ts-meta paths: [/data/gemini-data/meta /usr/local/opengemini/gemini-log/logs/ts-meta-8091 /usr/local/opengemini/gemini-deploy/ts-meta-8091 /etc/systemd/system/ts-meta-8091.service]Uninstalling monitored vmw-b.servers.comUninstalling instance vmw-b.servers.com
Uninstalling monitored on vmw-b.servers.com success
Uninstalling monitored vmw-c.servers.comUninstalling instance vmw-c.servers.com
Uninstalling monitored on vmw-c.servers.com success
Uninstalling monitored vmw-d.servers.comUninstalling instance vmw-d.servers.com
Uninstalling monitored on vmw-d.servers.com success
Clean global directories vmw-b.servers.comClean directory /usr/local/opengemini/gemini-log/logs on instance vmw-b.servers.comClean directory /usr/local/opengemini/gemini-deploy on instance vmw-b.servers.comClean directory /home/root/data on instance vmw-b.servers.com
Clean global directories vmw-b.servers.com success
Clean global directories vmw-c.servers.comClean directory /usr/local/opengemini/gemini-log/logs on instance vmw-c.servers.comClean directory /usr/local/opengemini/gemini-deploy on instance vmw-c.servers.comClean directory /home/root/data on instance vmw-c.servers.com
Clean global directories vmw-c.servers.com success
Clean global directories vmw-d.servers.comClean directory /usr/local/opengemini/gemini-log/logs on instance vmw-d.servers.comClean directory /usr/local/opengemini/gemini-deploy on instance vmw-d.servers.comClean directory /home/root/data on instance vmw-d.servers.com
Clean global directories vmw-d.servers.com success
Clean global directories vmw-e.servers.comClean directory /usr/local/opengemini/gemini-log/logs on instance vmw-e.servers.comClean directory /usr/local/opengemini/gemini-deploy on instance vmw-e.servers.comClean directory /home/root/data on instance vmw-e.servers.com
Clean global directories vmw-e.servers.com success
Delete public key vmw-b.servers.com
Delete public key vmw-b.servers.com success
Delete public key vmw-c.servers.com
Delete public key vmw-c.servers.com success
Delete public key vmw-d.servers.com
Delete public key vmw-d.servers.com success
Delete public key vmw-e.servers.com
Delete public key vmw-e.servers.com success
Uninstall cluster `gemini-test` successfully
  • 卸载前后的对比:

卸载前

[root@vmw-d ~]# ll /data/gemini-data/meta/
总用量 24
-rw-------. 1 root root 32768 12月 23 14:28 raft.db
drwxr-xr-x. 2 root root     6 12月 23 10:24 snapshots

卸载后

[root@vmw-d ~]# ll /data/gemini-data/meta/
ls: 无法访问/data/gemini-data/meta/: 没有那个文件或目录[root@vmw-d ~]# ll /data/gemini-data/data
ls: 无法访问/data/gemini-data/data: 没有那个文件或目录[root@vmw-d ~]# ll /usr/local/opengemini/gemini-log/
总用量 0
[root@vmw-d ~]# ll /usr/local/opengemini/
总用量 0
drwxr-xr-x. 2 root root 6 12月 23 14:29 gemini-log# 注: 即 opengemini/gemini-deploy/* 目录及子目录也被移除

帮助手册

[root@vmw-b go-study]# gemix cluster help
Deploy an openGemini cluster for productionUsage:gemix cluster [command]Available Commands:template    Print topology templateinstall     Install an openGemini cluster for productionstart       Start an openGemini clusterstop        Stop an openGemini clusteruninstall   Uninstall a specified clusterstatus      check cluster statusupgrade     upgrade clusterFlags:-h, --help   help for clusterUse "gemix cluster [command] --help" for more information about a command.

ts-cli : 官方客户端

ts-cli : OpenGemini 原生客户端

  • OpenGemini
  • https://github.com/openGemini/openGemini/releases/tag/v1.2.0 【预编译好的】

https://github.com/openGemini/openGemini/releases/download/v1.2.0/openGemini-1.2.0-linux-amd64.tar.gz 【推荐】
https://github.com/openGemini/openGemini/releases/download/v1.2.0/openGemini-1.2.0-windows-amd64.zip 【推荐】
已提前预编译好: ts-cli / ts-sql / ts-store / ...

  • 克隆-构建-运行 | 首页-开发指南-快速开始 | docs.opengemini.org 【自己用源码编译】

git clone https://github.com/openGemini/openGemini.git
cd openGemini
python3 build.py --clean

单机版的构建结果:

> ls build
> ts-cli ts-meta ts-monitor ts-server ts-sql ts-store

ts-server 是独立运行版

  • [vmw-e] 自己安装 ts-cli
下载安装包 openGemini-1.2.0-linux-amd64.tar.gz上传服务器 /root/openGemini-1.2.0-linux-amd64.tar.gz# 废弃: /root/test
mv /root/test /root/test.bakmkdir -p /root/gemini-test
tar -zxvf /root/openGemini-1.2.0-linux-amd64.tar.gz -C /root/gemini-testetc/monitor.confetc/openGemini.confetc/openGemini.singlenode.confetc/weakpasswd.propertiesusr/bin/ts-cliusr/bin/ts-metausr/bin/ts-monitorusr/bin/ts-serverusr/bin/ts-sqlusr/bin/ts-store
ls -la /root/gemini-test
chown -R root:root /root/gemini-testrm /usr/local/bin/ts-cli
ln -s /root/gemini-test/usr/bin/ts-cli /usr/local/bin/ts-cli
# [x] ln -s /root/test/usr/bin/ts-cli /usr/local/bin/ts-cli

初始状态创建管理员账号

  • step1 启动openGemini单机或者集群
  • step2 创建管理员用户
  • 方式1 http curl 请求
> curl -i -XPOST "http://ip:8086/query" -k --insecure --data-urlencode "q=CREATE USER admin WITH PASSWORD 'admin-passwd' WITH ALL PRIVILEGES"
  • 方式2 通过ts-cli连接openGemini, 通过客户端创建
[root@vmw-e ~]# ts-cli --host 192.168.101.102 --port 8086
openGemini CLI 0.1.0 (rev-revision)
Please use `quit`, `exit` or `Ctrl-D` to exit this program.
> CREATE USER admin WITH PASSWORD 'Xdddwwp@ssword' WITH ALL PRIVILEGES;
> 
> show databases; //错误示范
ERR: unable to parse authentication credentials
> show users //错误示范
ERR: unable to parse authentication credentials
> auth //错误示范
username: password: 
ERR: authorization failed
> quit[root@vmw-e ~]# ts-cli --host 192.168.101.102 --port 8086 --username admin --password "Xdddwwp@ssword"
openGemini CLI 0.1.0 (rev-revision)
Please use `quit`, `exit` or `Ctrl-D` to exit this program.
> show users
+-------+-------+--------+
| user  | admin | rwuser |
+-------+-------+--------+
| admin | true  | false  |
+-------+-------+--------+
3 columns, 1 rows in set
>
> create bdp_test;
> show databases;
name: databases
+----------+
|   name   |
+----------+
| bdp_test |
+----------+
1 columns, 1 rows in set

【注意事项】

  • 执行时,需要将命令中的IP地址和端口替换为实际环境中的ts-sql的ip和port,同时设置管理员账号名和密码
  • 密码必须由大小写字母、数字、特殊字符组成,长度限制为8-256位字符
  • config/weakpasswd.properties为若密码配置文件,默认支持若密码校验,如果设置的密码与配置文件中的密码一致,则视为若密码,不允许使用。
  • 密码字符串必须用单引号引起来,验证请求时,请包含单引号。
  • 不建议在密码中使用单引号(‘)和反斜杠(\)字符,对于包含这些字符\’的密码,在创建密码和提交身份验证请求时,请使用反斜杠对特殊字符进行转义

出于安全考虑,openGemini的管理员账号在系统内只能创建一次不能删除,并且不能重命名
创建管理员账户前,请认真考虑用户名和密码,并做好账号和密码的保存。

ts-cli --host 192.168.101.102 --port 8086 --password "OpenGemini#1658"

  • 参考文献
  • 初始状态创建管理员账号 - 用户管理 - OpenGemini
  • [vmw-e] 使用
# 帮助手册
[root@vmw-e ~]# ts-cli -h
ts-cli is a CLI tool of openGemini.Usage:ts-cli [flags]ts-cli [command]Available Commands:execute     Execute a queryhelp        Help about any commandimport      Import data to openGeminiinteractive Work in interactive modeversion     Display the version of openGemini CLIFlags:--database string    Database to connect to openGemini.-h, --help               help for ts-cli--host string        ts-sql host to connect to. (default "localhost")-p, --password string    Password to connect to openGemini.--port int           ts-sql tcp port to connect to. (default 8086)--precision string   Specify the format of the timestamp: rfc3339, h, m, s, ms, u or ns. (default "ns")--socket string      openGemini unix domain socket to connect to.--ssl                Use https for connecting to openGemini.--unsafeSsl          Ignore ssl verification when connecting openGemini by https. (default true)-u, --username string    Username to connect to openGemini.Use "ts-cli [command] --help" for more information about a command.[root@vmw-e ~]# ts-cli -host 192.168.101.102 -port 8086

监控体系

Grafana

访问URL

  • Opengemini 通过 Gemix 一键安装完成后,即可访问 Grafana

http://{grafana_servers}:3000
默认用户名密码: admin / admin

进程 / 部署路径

[root@vmw-e ~]# ps -ef | grep -i grafana
root       2528      1  0 19:48 ?        00:00:07 bin/grafana-7.5.17/bin/grafana-server --homepath=/usr/local/opengemini/gemini-deploy/grafana-3000/bin/grafana-7.5.17 --config=/usr/local/opengemini/gemini-deploy/grafana-3000/conf/grafana.ini
root      89035  88722  0 21:01 pts/2    00:00:00 grep --color=auto -i grafana[root@vmw-e ~]# pwdx 2528
2528: /usr/local/opengemini/gemini-deploy/grafana-3000

核心配置 : grafana.ini

vim /usr/local/opengemini/gemini-deploy/grafana-3000/conf/grafana.ini# #################### Grafana Configuration Example #####################
# 
# Everything has defaults so you only need to uncomment things you want to
# change
# possible values : production, development
; app_mode = production
# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty
; instance_name = ${HOSTNAME}
# ################################### Paths ####################################
[paths]
# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used)
# 
data         = /usr/local/opengemini/gemini-deploy/grafana-3000/data
# 
# Directory where grafana can store logs
# 
logs         = /usr/local/opengemini/gemini-deploy/grafana-3000/log
# 
# Directory where grafana will automatically scan and look for plugins
# 
plugins      = /usr/local/opengemini/gemini-deploy/grafana-3000/plugins
# 
# 
# folder that contains provisioning config files that grafana will apply on startup and while running.
provisioning = /usr/local/opengemini/gemini-deploy/grafana-3000/provisioning# 
# ################################### Server ####################################
[server]
# Protocol (http or https)
; protocol = http
# The ip address to bind to, empty will bind to all interfaces
; http_addr =
# The http port  to use
http_port = 3000
# The public facing domain name used to access grafana from a browser
domain    = 192.168.101.105
# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
; enforce_domain = false
# The full public facing url
# Log web requests
; router_logging = false
# the path relative working path
; static_root_path = public
# enable gzip
; enable_gzip = false
# https certs & key file
; cert_file =
; cert_key =
# ################################### Database ####################################
[database]# Either "mysql", "postgres" or "sqlite3", it's your choice
; type = sqlite3
; host = 127.0.0.1:3306
; name = grafana
; user = root
; password =
# For "postgres" only, either "disable", "require" or "verify-full"
; ssl_mode = disable
# For "sqlite3" only, path relative to data_path setting
; path = grafana.db
# ################################### Session ####################################
[session]# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
; provider = file
# Provider config options
# memory: not have any config yet
# file: session dir path, is relative to grafana data_path
# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana`
# mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name`
# postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable
; provider_config = sessions
# Session cookie name
; cookie_name = grafana_sess
# If you use session in https only, default is false
; cookie_secure = false
# Session life time, default is 86400
; session_life_time = 86400
# ################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
# No ip addresses are being tracked, only simple counters to track
# running instances, dashboard and error counts. It is very helpful to us.
# Change this option to false to disable reporting.
; reporting_enabled = true
# Set to false to disable all checks to https://grafana.net
# for new vesions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.net to get latest versions
check_for_updates = true# Google Analytics universal tracking code, only enabled if you specify an id here
; google_analytics_ua_id =
# ################################### Security ####################################
[security]
# default admin user, created on startup
admin_user     = admin
# default admin password, can be changed before first start of grafana,  or in profile settings
admin_password = admin# used for signing
; secret_key = SW2YcwTIb9zpOOhoPsMm
# Auto-login remember days
; login_remember_days = 7
; cookie_username = grafana_user
; cookie_remember_name = grafana_remember
# disable gravatar profile images
; disable_gravatar = false
# data source proxy whitelist (ip_or_domain:port separated by spaces)
; data_source_proxy_whitelist =
[snapshots]# snapshot sharing options
; external_enabled = true
; external_snapshot_url = https://snapshots-origin.raintank.io
; external_snapshot_name = Publish to snapshot.raintank.io
# ################################### Users ####################################
[users]# disable user signup / registration
; allow_sign_up = true
# Allow non admin users to create organizations
; allow_org_create = true
# Set to true to automatically assign new users to the default organization (id 1)
; auto_assign_org = true
# Default role new users will be automatically assigned (if disabled above is set to true)
; auto_assign_org_role = Viewer
# Background text for the user field on the login page
; login_hint = email or username
# Default UI theme ("dark" or "light")
; default_theme = dark
# ############## Set Cookie Name for Multiple Instances #######################
[auth]
login_cookie_name = grafana_session_3000# ################################### Anonymous Auth ##########################
[auth.anonymous]# specify organization name that should be used for unauthenticated users
; org_name = Main Org.
# specify role for unauthenticated users
; org_role = Viewer
# ################################### Basic Auth ##########################
[auth.basic]; enabled = true
# ################################### Auth LDAP ##########################
[auth.ldap]; enabled = false
; config_file = /etc/grafana/ldap.toml
# ################################### SMTP / Emailing ##########################
[smtp]; enabled = false
; host = localhost:25
; user =
; password =
; cert_file =
; key_file =
; skip_verify = false
; from_address = admin@grafana.localhost
[emails]; welcome_email_on_sign_up = false
# ################################### Logging ##########################
[log]
# Either "console", "file", "syslog". Default is console and  file
# Use space to separate multiple modes, e.g. "console file"
mode = file# Either "trace", "debug", "info", "warn", "error", "critical", default is "info"
; level = info
# For "console" mode only
[log.console]; level =
# log line format, valid options are text, console and json
; format = console
# For "file" mode only
[log.file]
level  = info
# log line format, valid options are text, console and json
format = text# This enables automated log rotate(switch of following options), default is true
; log_rotate = true
# Max line number of single file, default is 1000000
; max_lines = 1000000
# Max size shift of single file, default is 28 means 1 << 28, 256MB
; max_size_shift = 28
# Segment log daily, default is true
; daily_rotate = true
# Expired days of log file(delete after max days), default is 7
; max_days = 7
[log.syslog]
; level =
# log line format, valid options are text, console and json
; format = text
# Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used.
; network =
; address =
# Syslog facility. user, daemon and local0 through local7 are valid.
; facility =
# Syslog tag. By default, the process' argv[0] is used.
; tag =
# ################################### AMQP Event Publisher ##########################
[event_publisher]; enabled = false
; rabbitmq_url = amqp://localhost/
; exchange = grafana_events
; #################################### Dashboard JSON files ##########################
[dashboards.json]
enabled = false
path    = /usr/local/opengemini/gemini-deploy/grafana-3000/dashboards# ################################### Internal Grafana Metrics ##########################
# Metrics available at HTTP API Url /api/metrics
[metrics]# Disable / Enable internal metrics
; enabled           = true
# Publish interval
; interval_seconds  = 10
# Send internal metrics to Graphite
; [metrics.graphite]
; address = localhost:2003
; prefix = prod.grafana.%(instance_name)s.
# ################################### Internal Grafana Metrics ##########################
# Url used to to import dashboards directly from Grafana.net
[grafana_net]
url = https://grafana.net

ts-monitor

进程 / 部署路径

[root@vmw-b ~]# ps -ef | grep -i ts-monitor
root       2957      1  0 19:50 ?        00:00:24 bin/ts-monitor --config=conf/ts-monitor.toml
root     112060   2138  0 21:10 pts/0    00:00:00 grep --color=auto -i ts-monitor
[root@vmw-b ~]# pwdx 2957
2957: /usr/local/opengemini/gemini-deploy/ts-monitor

核心配置 : ts-monitor.toml

# vim /usr/local/opengemini/gemini-deploy/ts-monitor/conf/ts-monitor.toml
[monitor]# localhost iphost = "192.168.101.102"# Indicates the path of the metric file generated by the kernel. References openGemini.conf: [monitor] store-path# metric-path cannot have subdirectoriesmetric-path = "/usr/local/opengemini/gemini-log/logs/ts-meta-8091/metric"# Indicates the path of the log file generated by the kernel. References openGemini.conf: [logging] path# error-log-path cannot have subdirectorieserror-log-path = "/usr/local/opengemini/gemini-log/logs/ts-meta-8091"# Data disk path. References openGemini.conf: [data] store-data-dirdisk-path = "/data/gemini-data/data"# Wal disk path. References openGemini.conf: [data]  store-wal-diraux-disk-path = "/data/gemini-data/data/wal"# Name of the process to be monitored. Optional Value: ts-store,ts-sql,ts-meta.# Determined based on the actual process running on the local node.process = "ts-store,ts-sql"# the history file reported error-log names.history-file = "history.txt"# Is the metric compressed.compress = false[query]# query for some DDL. Report for these data to monitor cluster.# - SHOW DATABASES# - SHOW MEASUREMENTS# - SHOW SERIES CARDINALITY FROM mstquery-enable = falsehttp-endpoint = "127.0.0.x:8086"query-interval = "5m"# username = ""# password = ""# https-enable = false[report]# Address for metric data to be reported.address = ""# Database name for metric data to be reported.database = "gemini_test"rp = "autogen"rp-duration = "168h"# username = ""# password = ""[logging]format = "auto"level = "info"path = "/usr/local/opengemini/gemini-log/logs/ts-monitor"max-size = "64m"max-num = 30max-age = 7compress-enabled = true

场景:数据节点启用ts-monitor,上报监控数据到 OpenGemini 监控库

  • step0 安装一个 opengemini 数据库实例,并创建监控库_monitor

最佳实践:单独创建,与 opengemini 正式业务库 独立开,避免产生影响。

此处,我偷个懒,暂复用 正式业务库 192.168.101.102 节点作为上报地址。

create database _monitor;
  • step1 节点上编辑ts-monitor的配置文件

原配置

[root@vmw-b ~]# vim /usr/local/opengemini/gemini-deploy/ts-monitor/conf/ts-monitor.toml
...[report]# Address for metric data to be reported.address = ""# Database name for metric data to be reported.database = "gemini_test"rp = "autogen"rp-duration = "168h"# username = ""# password = ""...

新配置

[root@vmw-b ~]# vim /usr/local/opengemini/gemini-deploy/ts-monitor/conf/ts-monitor.toml
...[report]# Address for metric data to be reported.address = "192.168.101.102:8086"# Database name for metric data to be reported.# database = "gemini_test"database = "_monitor"rp = "autogen"rp-duration = "168h"username = ""password = ""...
  • step3 重启ts-monitor进程

  • step4 登录 opengemini 后,可发现 _monitor 库下有新增的 measurement

# 查看保留策略
# show retention policies on _monitor
name=autogen shardGroupDuration=168h0m0s ...# show measurements on _monitor
err_log
meta
metaRaft
spdy
system# select * from "_monitor"."autogen"."err_log"

err_log

system


meta

ts-server

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/859539.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

CUDA环境搭建

1.安装CUDA CUDA Toolkit 12.6 Update 3 Downloads | NVIDIA Developer2.安装miniconda Download Now | Anaconda3.安装GPU版的 Pytorch PyTorchpip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124备选手动安装 迅雷下载 https://…

PostgreSQL 初始化配置设置

title: PostgreSQL 初始化配置设置 date: 2024/12/27 updated: 2024/12/27 author: cmdragon excerpt: PostgreSQL是一款广泛应用于企业级应用、数据仓库以及Web应用程序的强大数据库管理系统。在完成数据库的安装后,进行合理而有效的初始配置是确保数据库性能和安全性的关键…

Chrome浏览器不太愿意使用http3/quic怎么办?如何强制让Chrome开启http3/quic

1. 确认你要访问的网站支持h3 一定要有Alt-svc标头2. 配置Chrome启动参数,对指定网站强制开启Http3 右键点击桌面Chrome图标,选择属性,在Chrome.exe后添加启动参数,网站地址替换为你想要开启的网站地址。 chrome.exe --origin-to-force-quic-on=localhost:6001 https://loc…

postgis和postgresql学习

一、两者关系 postgresql本质上还是sql驱动的数据库,和mysql、sqlserver等是性质相同的 postgis本质上是postgresql的插件,可以将postgresql这种关系型数据库改造成空间数据库 二、环境配置 postgresql:https://www.enterprisedb.com/downloads/postgres-postgresql-downloa…

并发编程 - 死锁的产生、排查与解决方案

多线程中死锁因资源争夺形成循环等待,必要条件为互斥、占有并等待、不可剥夺、循环等待。可用VisualStudio等工具排查,解决办法包括顺序加锁、尝试锁、超时机制、避免嵌套使用锁。在多线程编程中,死锁是一种非常常见的问题,稍不留神可能就会产生死锁,今天就和大家分享死锁…

一维数组、多维数组、Array(deepToString sort fill binarySearch)方法2024122620241226

数组20241226 [数组详情](深入理解 Java 数组 - 静默虚空 - 博客园)什么是数组: 数组是相同类型数据的有序集合注意:必须是相同数据数组描述的是相同类型的若干个数据,按照一定的先后次序排列组合而成其中,每一个数据称作一个数组元素。 每个数组元素可以通过一个下标来访问它…

《计算机组成及汇编语言原理》阅读笔记:p116-p120

《计算机组成及汇编语言原理》学习第 7 天,p116-p120 总结,总计 5 页。 一、技术总结 1.CPU优化 (1)increase overall performance number 例如:16位电脑提升到32位电脑。 (2)multiprocessing One way to make computers more useful is to allow them to run more than on…

波折重重:Linux实时系统Xenomai宕机问题的深度定位过程

本文将带您深入了解一个与之相关的真实事故现场及其问题定位过程,波折重重,其中的xenomai问题定位思路具有一定借鉴意义,希望对你定位xenomai问题有所帮助。目录一 前言二 背景三 原因分析及措施硬件原因应用软件操作系统四 分析定位转机拨云见雾irq计数Schedstatcoreclk现象…

Java面向对象程序设计复习总结

作者:高世栋 学号:202302151071 一、第一章:初识Java与面向对象程序设计Java简介:Java是一种面向对象的程序设计语言,具有跨平台、安全性高、可移植性强等特点。面向对象程序设计概述:面向对象是一种程序设计思想,将现实世界的事物抽象为对象,通过对象之间的交互来完…

[Paper Reading] StegoType: Surface Typing from Egocentric Cameras

目录StegoType: Surface Typing from Egocentric CamerasTL;DRData数据采集设备开环数据收集闭环数据收集数据容错机制OracleMethodInput FeaturesBackboneDataLossExperiment效果可视化总结与思考相关链接Related works中值得深挖的工作资料查询 StegoType: Surface Typing fr…

JVM实战—2.JVM内存设置与对象分配流转

大纲 1.JVM内存划分的原理细节 2.对象在JVM内存中如何分配如何流转 3.部署线上系统时如何设置JVM内存大小 4.如何设置JVM堆内存大小 5.如何设置JVM栈内存与永久代大小 6.问题汇总1.JVM内存划分的原理细节 (1)背景引入 (2)大部分对象的存活周期都是极短的 (3)少数对象是长期存活…

【Obsidian】 博客园插件

搬运 原文作者:ZhangBlog 出处:https://www.cnblogs.com/aaalei/p/17926199.html由于 Markdown 语法的便捷性, 我们从繁重的排版布局工作中解脱出来, 越来越多的人开始接受这种写作方式, 该插件可以将你的 md 笔记, 方便的同步到博客园中, 即使你是使用的本地图片, 也无须担心…