TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

The taosadapter deployed separately is abnormal

Open tcy110 opened this issue 2 years ago • 1 comments

apiVersion: apps/v1 kind: Deployment metadata: name: "adapter" namespace: monitoring labels: app: "adapter" spec: replicas: 1 selector: matchLabels: app: "adapter" template: metadata: name: "adapter" labels: app: "adapter" spec: tolerations: - operator: Exists containers: - name: "adapter" image: tdengine/tdengine:2.4.0.4 imagePullPolicy: "Always" args: - --debug=true - --logLevel=trace command: ["taosadapter"] env: - name: TAOS_FIRST_EP value: tdengine-0.taosd.monitoring.svc.cluster.local - name: fqdn value: tdengine-0.taosd.monitoring.svc.cluster.local - name: TZ value: "Asia/Shanghai" - name: TAOS_DEBUG_FLAG value: "135"

以上是我adapter pod的yaml文件,已经按照官方操作填写TAOS_FIRST_EP,也就是taos的地址。 但是在启动pod后,提供给prometheus远程写入时,adapter提示无法与tdengine建立连接,我尝试了通过taos客户端方式,在adapter的pod成功连接到tdengine。我想问是yaml文件中还缺少了连接参数吗?还是说代码中写死了只能让adapter和tdengine部署在一个pod中,通过localhost访问呢?以下是我的报错输出。

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

taos connect failed, reason: Unable to establish connection.

07/18 15:20:40.534054 00000001 TAOS_ADAPTER error "connect taosd error" model=prometheus error=factory is not able to fill the pool: [0x20b] invalid connection 07/18 15:20:40.534092 00000001 TAOS_ADAPTER info "| 400 | 24.010409314s | 10.21.166.32 | POST | /prometheus/v1/remote_write/prometheus " model=web sessionID=76 07/18 15:20:41.034844 00000001 TAOS_ADAPTER error "connect taosd error" model=prometheus error=factory is not able to fill the pool: [0x20b] invalid connection 07/18 15:20:41.034883 00000001 TAOS_ADAPTER info "| 400 | 24.526072521s | 10.21.166.32 | POST | /prometheus/v1/remote_write/prometheus " model=web sessionID=31 07/18 15:20:41.535580 00000001 TAOS_ADAPTER error "connect taosd error" error=factory is not able to fill the pool: [0x20b] invalid connection model=prometheus 07/18 15:20:41.535615 00000001 TAOS_ADAPTER info "| 400 | 25.011463062s | 10.21.82.159 | POST | /prometheus/v1/remote_write/prometheus " model=web sessionID=77 07/18 15:20:42.036335 00000001 TAOS_ADAPTER error "connect taosd error" model=prometheus error=factory is not able to fill the pool: [0x20b] invalid connection 07/18 15:20:42.036425 00000001 TAOS_ADAPTER info "| 400 | 25.521798565s | 10.21.166.32 | POST | /prometheus/v1/remote_write/prometheus " sessionID=53 model=web 07/18 15:20:42.036389 00000001 TAOS_ADAPTER error "connect taosd error" model=prometheus error=factory is not able to fill the pool: [0x20b] invalid connection 07/18 15:20:42.036491 00000001 TAOS_ADAPTER info "| 400 | 25.512015095s | 10.21.166.32 | POST | /prometheus/v1/remote_write/prometheus " model=web sessionID=78 07/18 15:20:42.537086 00000001 TAOS_ADAPTER error "connect taosd error" error=factory is not able to fill the pool: [0x20b] invalid connection model=prometheus 07/18 15:20:42.537126 00000001 TAOS_ADAPTER info "| 400 | 26.011700035s | 10.21.166.32 | POST | /prometheus/v1/remote_write/prometheus " model=web sessionID=80

tcy110 avatar Jul 18 '22 07:07 tcy110

@tcy110 请使用如下 yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: "adapter"
  namespace: monitoring
  labels:
    app: "adapter"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: "adapter"
  template:
    metadata:
      name: "adapter"
      labels:
        app: "adapter"
    spec:
      tolerations:
      - operator: Exists
      containers:
      - name: "adapter"
        image: tdengine/tdengine:2.4.0.4
        imagePullPolicy: "IfNotPresent"
        args:
        - --debug=true
        - --logLevel=trace
        command: ["sh", "/usr/bin/entrypoint.sh", "taosadapter"]
        env:
        - name: TAOS_FIRST_EP
          value: tdengine-0.tdengine.monitoring.svc.cluster.local
        - name: fqdn
          value: tdengine-0.tdengine.monitoring.svc.cluster.local
        - name: TZ
          value: "Asia/Shanghai"
        - name: TAOS_DEBUG_FLAG
          value: "135"

huskar-t avatar Jul 19 '22 05:07 huskar-t