diff --git a/hetu-docs/en/installation/deployment-ha.md b/hetu-docs/en/installation/deployment-ha.md index fa008c1e0..7d5943d03 100644 --- a/hetu-docs/en/installation/deployment-ha.md +++ b/hetu-docs/en/installation/deployment-ha.md @@ -9,7 +9,7 @@ Please follow [Deploying openLooKeng Manually](./deployment.md) or [Deploying op ## Configuring HA -- Create an ``etc\state-store.properties`` file inside both coordinators and workers installation directories. +- Create an `etc\state-store.properties` file inside both coordinators and workers installation directories. ### State Store Properties @@ -46,5 +46,38 @@ hetu.multiple-coordinator.enabled=true The above properties are described below: -- hetu.multiple-coordinator.enabled`: Multiple coordinator mode is enabled -- hetu.embedded-state-store.enabled`: Allow this coordinator to use embedded state store +- `hetu.multiple-coordinator.enabled`: Multiple coordinator mode is enabled +- `hetu.embedded-state-store.enabled`: Allow this coordinator to use embedded state store + +## HA Cluster behind Reverse Proxy + +To achieve the full benefit of HA, clients(ie. openLooKeng CLI, JDBC, etc) are encouraged to _not_ connect to specific coordinators directly. Instead, they should connect to multiple coordinators through some sort of _reverse proxy_, for example through a load balancer, or a Kubernetes service. This allows the client to continue to work even if a specific coordinator is not working as expected. + +### Reverse Proxy Requirement + +When the connection is made through a reverse proxy, it is required for a given client to connect to the same coordinator during the execution of a query. This is to ensure a constant heartbeat between the client and coordinator while that query is running. This can be achieved by enabling _sticky_ connections, for example, Nginx's `ip_hash`. + +### Configure Reverse Proxy Example (Nginx) + +Please include configuration below in the Nginx configuration file (ie. `nginx.conf`) + +``` +http { + ... # Your own configuration + upstream backend { + ip_hash; + server :; + server :; + server :; + ... + } + + server { + ... # Your own configuration + location / { + proxy_pass http://backend; + proxy_set_header Host :; + } + } +} +``` \ No newline at end of file diff --git a/hetu-docs/zh/installation/deployment-ha.md b/hetu-docs/zh/installation/deployment-ha.md index dc35ce54f..a967eaa4b 100644 --- a/hetu-docs/zh/installation/deployment-ha.md +++ b/hetu-docs/zh/installation/deployment-ha.md @@ -45,4 +45,37 @@ hetu.multiple-coordinator.enabled=true 上述属性说明如下: - `hetu.multiple-coordinator.enabled`:开启了多协调节点模式。 -- `hetu.embedded-state-store.enabled`:允许此协调节点使用嵌入式状态存储。 \ No newline at end of file +- `hetu.embedded-state-store.enabled`:允许此协调节点使用嵌入式状态存储。 + +## HA及反向代理 + +要尽可能的显示HA的优势,建议客户端(例如openLooKeng CLI, JDBC等)不直接连接特定的协调节点,而是通过反向代理连接多个协调节点,例如使用负载平衡器或者Kubernetes服务,这样即使某个协调节点无法正常工作,客户端也可以继续使用其它的协调节点。 + +### 反向代理要求 + +通过反向代理连接时,要求客户端在执行语句查询期间连接到同一协调器,确保在语句查询运行时客户端和协调器之间保持恒定心跳。这可以通过配置反向代理实现,例如Nginx的`ip_hash`。 + +### 配置反向代理 (Nginx) + +请在Nginx配置文件中包含以下配置(nginx.conf) + +``` +http { + ... # 用户自定义配置 + upstream backend { + ip_hash; + server :; + server :; + server :; + ... + } + + server { + ... # 用户自定义配置 + location / { + proxy_pass http://backend; + proxy_set_header Host :; + } + } +} +``` \ No newline at end of file