You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/30 08:05:36 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #7524: Multiple FE WEB UI login issues

morningman commented on a change in pull request #7524:
URL: https://github.com/apache/incubator-doris/pull/7524#discussion_r776611075



##########
File path: docs/zh-CN/faq/faq.md
##########
@@ -318,6 +318,79 @@ failed to initialize storage reader. tablet=63416.1050661139.aa4d304e7a7aff9c-f0
 
 1. `brpc_max_body_size`:默认 3GB.
 
+### Q22. 多个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;

Review comment:
       ```suggestion
       server    172.22.197.240:8030 weight=4;
   ```

##########
File path: docs/zh-CN/faq/faq.md
##########
@@ -318,6 +318,79 @@ failed to initialize storage reader. tablet=63416.1050661139.aa4d304e7a7aff9c-f0
 
 1. `brpc_max_body_size`:默认 3GB.
 
+### Q22. 多个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;

Review comment:
       ```suggestion
           server    172.22.197.240:8030 weight=4;
   ```

##########
File path: docs/en/faq/faq.md
##########
@@ -317,3 +317,77 @@ One situation is OVERCROWDED, which means that a large amount of unsent data at
 The second is that the packet size of rpc exceeds `max_body_size`. This problem may occur if the query contains a very large String type or a Bitmap type. It can be circumvented by modifying the following BE parameters:
 
 1. `brpc_max_body_size`: The default is 3GB, if necessary, it can be modified to 3GB (in bytes).
+
+### Q22. Multiple FEs, when using Nginx to implement web UI load balancing, the login cannot be entered
+
+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 defined in the upstream configuration:
+
+```
+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;

Review comment:
       ```suggestion
           server    172.22.197.240:8030 weight=4;
   ```

##########
File path: docs/en/faq/faq.md
##########
@@ -317,3 +317,77 @@ One situation is OVERCROWDED, which means that a large amount of unsent data at
 The second is that the packet size of rpc exceeds `max_body_size`. This problem may occur if the query contains a very large String type or a Bitmap type. It can be circumvented by modifying the following BE parameters:
 
 1. `brpc_max_body_size`: The default is 3GB, if necessary, it can be modified to 3GB (in bytes).
+
+### Q22. Multiple FEs, when using Nginx to implement web UI load balancing, the login cannot be entered
+
+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 defined in the upstream configuration:
+
+```
+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;

Review comment:
       ```suggestion
       server    172.22.197.240:8030 weight=4;
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org