nginx – 异常:bus.Bus不可用 – Odoo 10

前端之家收集整理的这篇文章主要介绍了nginx – 异常:bus.Bus不可用 – Odoo 10前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

目前,我在不同的机器上有两个不同的数据库,显示下面的错误.第一次出现是几个月前,偶尔出现在日志中,有时连续多次出现,其他时间只出现一天.

只有在运行带有proxy_mode = True和/或工作人员数量的Odoo时才会发生这种情况. 0.禁用代理时,错误停止.

  1. Traceback (most recent call last):
  2. File "/odoo/odoo-server/odoo/http.py",line 638,in _handle_exception
  3. return super(JsonRequest,self)._handle_exception(exception)
  4. File "/odoo/odoo-server/odoo/http.py",line 675,in dispatch
  5. result = self._call_function(**self.params)
  6. File "/odoo/odoo-server/odoo/http.py",line 331,in _call_function
  7. return checked_call(self.db,*args,**kwargs)
  8. File "/odoo/odoo-server/odoo/service/model.py",line 119,in wrapper
  9. return f(dbname,**kwargs)
  10. File "/odoo/odoo-server/odoo/http.py",line 324,in checked_call
  11. result = self.endpoint(*a,**kw)
  12. File "/odoo/odoo-server/odoo/http.py",line 933,in __call__
  13. return self.method(*args,line 504,in response_wrap
  14. response = f(*args,**kw)
  15. File "/odoo/odoo-server/addons/bus/controllers/main.py",line 35,in poll
  16. raise Exception("bus.Bus unavailable")
  17. Exception: bus.Bus unavailable

这是我目前的Nginx配置:

  1. upstream odoo10 {
  2. server myipaddres:8069 weight=1 fail_timeout=0;
  3. }
  4. upstream odoo10-im {
  5. server myipaddres:8072 weight=1 fail_timeout=0;
  6. }
  7. ## http redirects to https ##
  8. server {
  9. listen 80;
  10. server_name mydomain.com;
  11. # Strict Transport Security
  12. add_header Strict-Transport-Security max-age=2592000;
  13. rewrite ^/.*$https://$host$request_uri? permanent;
  14. }
  15. server {
  16. # server port and name
  17. listen 443 ssl;
  18. server_name mydomain.com;
  19. # Specifies the maximum accepted body size of a client request,# as indicated by the request header Content-Length.
  20. client_max_body_size 200m;
  21. # add ssl specific settings
  22. keepalive_timeout 60;
  23. ssl on;
  24. ssl_certificate /etc/ssl/Nginx/mydomain.crt;
  25. ssl_certificate_key /etc/ssl/Nginx/mydomain.key;
  26. # limit ciphers
  27. ssl_ciphers HIGH:!ADH:!MD5;
  28. ssl_protocols SSLv3 TLSv1;
  29. ssl_prefer_server_ciphers on;
  30. # increase proxy buffer to handle some OpenERP web requests
  31. proxy_buffers 16 64k;
  32. proxy_buffer_size 128k;
  33. #general proxy settings
  34. # force timeouts if the backend dies
  35. proxy_connect_timeout 600s;
  36. proxy_send_timeout 600s;
  37. proxy_read_timeout 600s;
  38. proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;
  39. # set headers
  40. proxy_set_header Host $host;
  41. proxy_set_header X-Real-IP $remote_addr;
  42. proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
  43. # Let the OpenERP web service know that we’re using HTTPS,otherwise
  44. # it will generate URL using http:// and not https://
  45. proxy_set_header X-Forwarded-Proto https;
  46. # by default,do not forward anything
  47. proxy_redirect off;
  48. proxy_buffering off;
  49. location / {
  50. proxy_pass http://odoo10;
  51. }
  52. location /longpolling {
  53. proxy_pass http://odoo10-im;
  54. }
  55. # cache some static data in memory for 60mins.
  56. # under heavy load this should relieve stress on the OpenERP web interface a bit.
  57. location /web/static/ {
  58. proxy_cache_valid 200 60m;
  59. proxy_buffering on;
  60. expires 864000;
  61. proxy_pass http://odoo10;
  62. }
  63. }

以及与性能相关的etc / odoo-conf的相关部分:

  1. [options]
  2. # ...
  3. db_maxconn = 64
  4. limit_memory_hard = 2684354560
  5. limit_memory_soft = 2147483648
  6. limit_request = 8192
  7. limit_time_cpu = 600 limit_time_real = 1200 limit_time_real_cron = 2400
  8. max_cron_threads = 2
  9. osv_memory_age_limit = 1.0
  10. osv_memory_count_limit = False
  11. proxy_mode = True
  12. workers = 5 xmlrpc = True
  13. xmlrpc_interface = myipaddress
  14. netrpc_interface = myipaddress
  15. # ...

目前正在数字海洋基础设施上运行,在具有2GB RAM和2个cpu核心的机器上运行.

在您的Nginx.conf文件中,添加以下行:

  1. location /longpolling {
  2. proxy_pass http://127.0.0.1:8072;
  3. }
  4. location / {
  5. proxy_pass http://127.0.0.1:8069;
  6. }

猜你在找的Nginx相关文章