搜索弹性引擎不断杀死代码我如何解决它?

如何解决搜索弹性引擎不断杀死代码我如何解决它?

我使用运行 gunicorn 实例的烧瓶服务器设置了弹性搜索。我的问题是弹性搜索每隔几个小时就会崩溃,我必须重新启动它。

服务状态如下所示:

● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
   Active: Failed (Result: signal) since Mon 2021-06-21 06:06:15 UTC; 3h 8min ago
     Docs: https://www.elastic.co
  Process: 17808 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=killed,signal=KILL)
 Main PID: 17808 (code=killed,signal=KILL)
    Tasks: 0 (limit: 2313)
   CGroup: /system.slice/elasticsearch.service

Jun 21 04:56:51 ip-XXX-XX-XX-XXX systemd[1]: Starting Elasticsearch...
Jun 21 04:57:27 ip-XXX-XX-XX-XXX systemd[1]: Started Elasticsearch.
Jun 21 06:06:15 ip-XXX-XX-XX-XXX systemd[1]: elasticsearch.service: Main process exited,code=killed,status=9/KILL
Jun 21 06:06:15 ip-XXX-XX-XX-XXX systemd[1]: elasticsearch.service: Failed with result 'signal'.

这是烧瓶错误日志的样子:

Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/connection/http_urllib3.py",line 251,in perform_request
    response = self.pool.urlopen(
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py",line 726,in urlopen
    retries = retries.increment(
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/util/retry.py",line 386,in increment
    raise six.reraise(type(error),error,_stacktrace)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/packages/six.py",line 735,in reraise
    raise value
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py",line 670,in urlopen
    httplib_response = self._make_request(
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py",line 392,in _make_request
    conn.request(method,url,**httplib_request_kw)
  File "/home/ubuntu/anaconda3/lib/python3.8/http/client.py",line 1255,in request
    self._send_request(method,body,headers,encode_chunked)
  File "/home/ubuntu/anaconda3/lib/python3.8/http/client.py",line 1301,in _send_request
    self.endheaders(body,encode_chunked=encode_chunked)
  File "/home/ubuntu/anaconda3/lib/python3.8/http/client.py",line 1250,in endheaders
    self._send_output(message_body,line 1010,in _send_output
    self.send(msg)
  File "/home/ubuntu/anaconda3/lib/python3.8/http/client.py",line 950,in send
    self.connect()
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/connection.py",line 187,in connect
    conn = self._new_conn()
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/urllib3/connection.py",line 171,in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.httpconnection object at 0x7f016009b280>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/flask/app.py",line 1950,in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/flask/app.py",line 1936,in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/flask_restful/__init__.py",line 468,in wrapper
    resp = resource(*args,**kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/flask/views.py",line 89,in view
    return self.dispatch_request(*args,**kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/flask_restful/__init__.py",line 583,in dispatch_request
    resp = meth(*args,**kwargs)
  File "/home/ubuntu/Automation/searchengine/engine/query.py",line 71,in post
    res = Item().find(clean_query,File "/home/ubuntu/Automation/searchengine/engine/models.py",line 136,in find
    res = s.execute()
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch_dsl/search.py",line 715,in execute
    self,es.search(index=self._index,body=self.to_dict(),**self._params)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/client/utils.py",line 153,in _wrapped
    return func(*args,params=params,headers=headers,**kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/client/__init__.py",line 1662,in search
    return self.transport.perform_request(
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/transport.py",line 413,in perform_request
    raise e
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/transport.py",line 381,in perform_request
    status,headers_response,data = connection.perform_request(
  File "/home/ubuntu/anaconda3/lib/python3.8/site-packages/elasticsearch/connection/http_urllib3.py",line 264,in perform_request
    raise ConnectionError("N/A",str(e),e)
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.httpconnection object at 0x7f016009b280>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.httpconnection object at 0x7f016009b280>: Failed to establish a new connection: [Errno 111] Connection refused)

我能做些什么来修复它?以前它偶尔会崩溃,但现在每隔几个小时就会崩溃一次。可能的问题是什么?如果我需要添加更多详细信息,请告诉我。

编辑: 我认为正在捕获错误的弹性搜索日志:

[2021-06-21T12:45:02,145][INFO ][o.e.x.s.s.SecurityStatuschangelistener] [ip-XXX-XX-XX-XXX] Active license is Now [BASIC]; Security is disabled
[2021-06-21T12:45:02,198][INFO ][o.e.g.GatewayService     ] [ip-XXX-XX-XX-XXX] recovered [3] indices into cluster_state
[2021-06-21T12:45:15,401][INFO ][o.e.c.r.a.AllocationService] [ip-XXX-XX-XX-XXX] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[m][0],[dev_m][0]]]).
[2021-06-21T13:29:15,959][INFO ][o.e.m.j.JvmGcMonitorService] [ip-XXX-XX-XX-XXX] [gc][2570] overhead,spent [399ms] collecting in the last [1s]
[2021-06-21T13:40:03,249][WARN ][o.e.m.j.JvmGcMonitorService] [ip-XXX-XX-XX-XXX] [gc][young][3215][14] duration [1.9s],collections [1]/[2.8s],total [1.9s]/[2.7s],memory [160.1mb]->[93.7mb]/[980mb],all_pools {[young] [68mb]->[0b]/[0b]}{[old] [72.1mb]->[90.1mb]/[980mb]}{[survivor] [20mb]->[3.6mb]/[0b]}
[2021-06-21T13:40:03,257][WARN ][o.e.m.j.JvmGcMonitorService] [ip-XXX-XX-XX-XXX] [gc][3215] overhead,spent [1.9s] collecting in the last [2.8s]

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?