gpt4 book ai didi

python - python 2.7.6至2.7.12破坏了我的脚本

转载 作者:行者123 更新时间:2023-12-03 01:52:15 24 4
gpt4 key购买 nike

我正在使用一个简单的脚本将数据发送到elasticsearch节点,但是在更改python版本后,该脚本不再运行。它说错误在第6行,但我不知道为什么。我尝试在"is"后添加逗号,但没有效果。我试过将括号和括号下移,但它必须生效。 (为简便起见,我省略了import和其他定义的变量)

if "Temporary failure in name resolution" or "Timeout" in output:
es.index(index='data', doc_type='data', body={
'macs' : '',
'data' : line,
'date' : datetime.now(),
'down' : 'yes' })

错误如下:
    snmpwalk: Timeout

Traceback (most recent call last):
File "script.py", line 6, in <module>
'down' : 'yes' })
File "build/bdist.linux-x86_64/egg/elasticsearch/client/utils.py", line 69, in _wrapped
File "build/bdist.linux-x86_64/egg/elasticsearch/client/__init__.py", line 279, in index
File "build/bdist.linux-x86_64/egg/elasticsearch/transport.py", line 327, in perform_request
File "build/bdist.linux-x86_64/egg/elasticsearch/connection/http_urllib3.py", line 105, in perform_request
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2507668090>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f2507668090>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution)

谢谢

最佳答案

这可能是网络问题,也可能是 Elasticsearch 的mmapfs目录已用尽。

尝试运行以下命令重新启动网络服务器

sudo service network-manager restart

如果它不起作用,则通过运行此命令来更改您的mmap计数
sudo sysctl -w vm.max_map_count=262144

引用
https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html

关于python - python 2.7.6至2.7.12破坏了我的脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39357521/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com