Elasticsearch问题:ConnectionError

时间:2018-08-28 07:35:16

标签: django elasticsearch

我正在新社会中开发不同的Web应用程序,每次我想使用Elasticsearch(版本6.3.2)时都会遇到此问题:

elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f4e2ab26438>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f4e2ab26438>: Failed to establish a new connection: [Errno 111] Connection refused)

例如对于Django,我执行以下命令:

sudo service elasticsearch start

然后

python manage.py indexdocs

我收到如下问题。我试图做:

curl -XGET http://localhost:9200

我得到了:curl: (7) Failed to connect to localhost port 9200: Connexion refusée

您对此有任何想法吗?我必须在某个地方授权一些东西吗?

谢谢

编辑:

/var/log/elasticsearch/elasticsearch.log中,我遇到了循环问题:

[2018-08-28T09:27:56,673][INFO ][o.e.n.Node               ] [] initializing ...
[2018-08-28T09:27:56,733][INFO ][o.e.e.NodeEnvironment    ] [DRmGsVp] using [1] data paths, mounts [[/ (/dev/sda1)]], net usable_space [25.5gb], net total_space [39.1gb], types [ext4]
[2018-08-28T09:27:56,734][INFO ][o.e.e.NodeEnvironment    ] [DRmGsVp] heap size [1.9gb], compressed ordinary object pointers [true]
[2018-08-28T09:27:56,749][INFO ][o.e.n.Node               ] [DRmGsVp] node name derived from node ID [DRmGsVpYQ8W4E4JTZoM1Lw]; set [node.name] to override
[2018-08-28T09:27:56,749][INFO ][o.e.n.Node               ] [DRmGsVp] version[6.4.0], pid[6436], build[default/deb/595516e/2018-08-17T23:18:47.308994Z], OS[Linux/4.15.0-33-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_181/25.181-b13]
[2018-08-28T09:27:56,749][INFO ][o.e.n.Node               ] [DRmGsVp] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.n$
[2018-08-28T09:27:57,892][ERROR][o.e.b.Bootstrap          ] Exception
java.lang.IllegalArgumentException: Plugin [ingest-attachment] was built for Elasticsearch version 6.3.2 but version 6.4.0 is running
        at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:339) ~[elasticsearch-6.4.0.jar:6.4.0]

1 个答案:

答案 0 :(得分:0)

问题在于摄取插件和elasticsearch之间的不兼容。 我建议下载摄取插件版本6.4。或将其删除。

  

sudo bin / elasticsearch-plugin安装接收附件

     

sudo bin / elasticsearch-plugin删除摄取附件

可以从https://artifacts.elastic.co/downloads/elasticsearch-plugins/ingest-attachment/ingest-attachment-6.4.0.zip下载此插件以进行脱机安装。

离线安装: 要从本地文件系统/path/to/plugin.zip安装插件,可以运行:

  

sudo bin / elasticsearch-plugin安装文件:///path/to/plugin.zip