ITPub博客

首页 > 数据库 > > influxDB高可用方案实践

influxDB高可用方案实践

作者:飘絮絮絮丶 时间:2022-02-09 16:48:28 0 删除 编辑

##一、gateway



##二、influxdb-relay

    influxdb的高可用层最初由influxdata创建提出,但之后不再维护。其架构图如下:其中负载设备(load Balancer)可以通过nginx对于读请求直接转发到inflxudb,对于写请求转发到relay。可以通过IP地址转发,也可以通过域名来转发.

```

https://github.com/influxdata/influxdb-relay

配置

[[http]]

name ="example-http"

bind-addr ="127.0.0.1:9096"

# Array of InfluxDB instances to use as backends for Relay.

output = [

# name: name of the backend, used for display purposes only.

# location: full URL of the /write endpoint of the backend

# timeout: Go-parseable time duration. Fail writes if incomplete in this time.

{ name="local1", location="http://127.0.0.1:8086/write", timeout="10s"},

{ name="local2", location="http://127.0.0.1:7086/write", timeout="10s"},

]

[[udp]]

# Name of the UDP server, used for display purposes only.

name ="example-udp"

# UDP address to bind to.

bind-addr ="127.0.0.1:9096"

# Socket buffer size for incoming connections.

read-buffer = 0# default

# Precision to use for timestamps

precision ="n"# Can be n, u, ms, s, m, h

# Array of InfluxDB instances to use as backends for Relay.

output = [

# name: name of the backend, used for display purposes only.

# location: host and port of backend.

# mtu: maximum output payload size

{ name="local1", location="127.0.0.1:8089", mtu=512 },

{ name="local2", location="127.0.0.1:7089", mtu=1024 },

]

```

运行  >> nohup ./influxdb-relay -config relay.toml &

测试 >> curl -i -XPOST 'http://localhost:9096/write?db=testDB' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.67'

配置方式一:单机双写

        relay只配置[[http]]选项的场景: bind-addr是强绑定(只能通过指定的IP访问,localhost对应127.0.0.1)

      设置的端口防火墙是否打开。

配置方式二:双机双写

      relay只配置[[http]]选项的场景: bind-addr是强绑定(只能通过指定的IP访问,localhost对应127.0.0.1)

      设置的端口防火墙是否打开。且两主机间要可以通信。relay主机可以远行在两个主机上,也可以独立远行。



##三、influxdb-proxy



作者:voidFan
链接:https://www.jianshu.com/p/6c8c2f669b1c
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69946831/viewspace-3139142/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-09-09

  • 博文量
    2646
  • 访问量
    42220