This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 6188ab2 [docs](faq) add multiple FE WEB UI login issues (#7654)
6188ab2 is described below
commit 6188ab20dfd3822171d8a407b0221c7f576aece7
Author: jiafeng.zhang <[email protected]>
AuthorDate: Fri Jan 14 09:26:39 2022 +0800
[docs](faq) add multiple FE WEB UI login issues (#7654)
---
docs/en/faq/faq.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++
docs/zh-CN/faq/faq.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 147 insertions(+)
diff --git a/docs/en/faq/faq.md b/docs/en/faq/faq.md
index c176c0c..a3a0675 100644
--- a/docs/en/faq/faq.md
+++ b/docs/en/faq/faq.md
@@ -340,3 +340,77 @@ To ensure the unique data order between different
replicas, refer to the [Seque
Sometimes when restarting the Fe, the above error will occur (usually only in
the case of multiple followers), and the difference between the two values in
the error is 2. As a result, the Fe startup fails.
This is a bug in bdbje that has not been resolved. In this case, metadata can
only be recovered through fault recovery in [metadata operation and maintenance
manual](../administrator-guide/operation/metadata-operation.md).
+
+### Q24. Multiple FEs cannot log in when using Nginx to implement web UI load
balancing
+
+Doris can deploy multiple FEs. When accessing the Web UI, if you use Nginx for
load balancing, you will be prompted to log in again because of Session
problems. This problem is actually a session sharing problem. Nginx provides
centralized session sharing. The solution, here we use the ip_hash technology
in nginx, ip_hash can direct the request of a certain ip to the same backend,
so that a certain client and a certain backend under this ip can establish a
stable The session, ip_hash is [...]
+
+```
+upstream doris.com {
+ server 172.22.197.238:8030 weight=3;
+ server 172.22.197.239:8030 weight=4;
+ server 172.22.197.240:8030 weight=4;
+ ip_hash;
+}
+```
+The complete Nginx example configuration is as follows:
+
+```
+user nginx;
+worker_processes auto;
+error_log /var/log/nginx/error.log;
+pid /run/nginx.pid;
+
+# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
+include /usr/share/nginx/modules/*.conf;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ keepalive_timeout 65;
+ types_hash_max_size 2048;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
+ # for more information.
+ include /etc/nginx/conf.d/*.conf;
+ #include /etc/nginx/custom/*.conf;
+ upstream doris.com {
+ server 172.22.197.238:8030 weight=3;
+ server 172.22.197.239:8030 weight=4;
+ server 172.22.197.240:8030 weight=4;
+ ip_hash;
+ }
+
+ server {
+ listen 80;
+ server_name gaia-pro-bigdata-fe02;
+ if ($request_uri ~ _load) {
+ return 307 http://$host$request_uri ;
+ }
+
+ location / {
+ proxy_pass http://doris.com;
+ proxy_redirect default;
+ }
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root html;
+ }
+ }
+ }
+```
diff --git a/docs/zh-CN/faq/faq.md b/docs/zh-CN/faq/faq.md
index 96dc5a1..887c135 100644
--- a/docs/zh-CN/faq/faq.md
+++ b/docs/zh-CN/faq/faq.md
@@ -341,3 +341,76 @@ failed to initialize storage reader.
tablet=63416.1050661139.aa4d304e7a7aff9c-f0
这是 bdbje 的一个 bug,尚未解决。遇到这种情况,只能通过
[元数据运维手册](../administrator-guide/operation/metadata-operation.md) 中的 故障恢复
进行操作来恢复元数据了。
+### Q24. 多个FE,在使用Nginx实现web UI负载均衡时,无法登录
+
+Doris 可以部署多个FE,在访问Web
UI的时候,如果使用Nginx进行负载均衡,因为Session问题会出现不停的提示要重新登录,这个问题其实是Session共享的问题,Nginx提供了集中Session共享的解决方案,这里我们使用的是nginx中的ip_hash技术,ip_hash能够将某个ip的请求定向到同一台后端,这样一来这个ip下的某个客户端和某个后端就能建立起稳固的session,ip_hash是在upstream配置中定义的:
+
+```
+upstream doris.com {
+ server 172.22.197.238:8030 weight=3;
+ server 172.22.197.239:8030 weight=4;
+ server 172.22.197.240:8030 weight=4;
+ ip_hash;
+}
+```
+完整的Nginx示例配置如下:
+
+```
+user nginx;
+worker_processes auto;
+error_log /var/log/nginx/error.log;
+pid /run/nginx.pid;
+
+# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
+include /usr/share/nginx/modules/*.conf;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ keepalive_timeout 65;
+ types_hash_max_size 2048;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ # Load modular configuration files from the /etc/nginx/conf.d directory.
+ # See http://nginx.org/en/docs/ngx_core_module.html#include
+ # for more information.
+ include /etc/nginx/conf.d/*.conf;
+ #include /etc/nginx/custom/*.conf;
+ upstream doris.com {
+ server 172.22.197.238:8030 weight=3;
+ server 172.22.197.239:8030 weight=4;
+ server 172.22.197.240:8030 weight=4;
+ ip_hash;
+ }
+
+ server {
+ listen 80;
+ server_name gaia-pro-bigdata-fe02;
+ if ($request_uri ~ _load) {
+ return 307 http://$host$request_uri ;
+ }
+
+ location / {
+ proxy_pass http://doris.com;
+ proxy_redirect default;
+ }
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root html;
+ }
+ }
+ }
+```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]