Thanos 接收数据有 sidecar和Receiver两种模式,考虑实际工作情况,此处我们选择的是receiver模式,具体配置如下:
nohup thanos receive
--tsdb.path "/aiops/webMonitor/"
--grpc-address 192.168.1.12:10907
--http-address 192.168.1.12:10909
--receive.replication-factor 1
--label "receive_replica="0""
--label "receive_cluster="webmonitor""
--receive.local-endpoint 192.168.1.12:10907
--receive.hashrings-file /aiops/hashring.json
--remote-write.address 192.168.1.12:10908
--objstore.config-file "/aiops/bucket.yml" > /aiops/webMonitor/thanos_receive.log 2>&1 &
需要根据实际环境修改其中的IP地址,而/aiops/bucket.yml的内容大体如下:
上述命令中的 /aiops/bucket.yaml内容如下:
type: obsType
config:
endpoint: "192.168.1.183"
bucket: "nodemetrics"
token: "52ec14ad2c55b1cf03e"
insecure: true
put_user_metadata: {}
http_config:
idle_conn_timeout: 1m30s
response_header_timeout: 2m
insecure_skip_verify: false
tls_handshake_timeout: 10s
expect_continue_timeout: 1s
max_idle_conns: 100
max_idle_conns_per_host: 100
max_conns_per_host: 0
trace:
enable: false
list_objects_version: ""
part_size: 67108864
sse_config:
type: ""
kms_key_id: ""
kms_encryption_context: {}
encryption_key: ""
需要根据实际情况修改上面的obsType以及其中的ip地址和token等参数。
type: obsType
config:
endpoint: "192.168.1.183"
bucket: "obs"
token: "52ec14ad2c55b1cf03e"
insecure: true
而 /aiops/hashring.json的内容如下:
[
{
"endpoints": [
"192.168.1.12:10907"
]
}
]
至此thanos receive就配置完成了
而thanos query的具体命令如下:
thanos query –http-address 192.168.1.12:19192 –grpc-address=192.168.1.12:10906 –store 192.168.1.12:10907 –store 192.168.1.12:10919
————————————————
版权声明:本文为本人原创,转载请附上原文出处链接及本声明。
原文链接:http://laowubiji.com/index.php/2023/06/01/thanos-deploy_test/