2014-02-27 89 views
2

我通過閱讀tutorial安裝了預編譯版本Elasticsearch 1.0.0版本。如果我啓動elasticsearch,我收到以下錯誤消息:我應該嘗試舊版ES還是如何解決此問題?在OpenShift上安裝elasticsearch

[elastic-dataportal.rhcloud.com elasticsearch-1.0.0]\> ./bin/elasticsearch 
[2014-02-25 10:02:18,757][INFO ][node      ] [Desmond Pitt] version[1.0.0], pid[203443], build[a46900e/2014-02-12T16:18:34Z] 
[2014-02-25 10:02:18,764][INFO ][node      ] [Desmond Pitt] initializing ... 
[2014-02-25 10:02:18,780][INFO ][plugins     ] [Desmond Pitt] loaded [], sites [] 
OpenJDK Server VM warning: You have loaded library /var/lib/openshift/430c93b1500446b03a00005c/app-root/data/elasticsearch-1.0.0/lib/sigar/libsigar-x86-linux.so which might have disabled stack guard. The VM will try to fix the stack guard now. 
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'. 
[2014-02-25 10:02:32,198][INFO ][node      ] [Desmond Pitt] initialized 
[2014-02-25 10:02:32,205][INFO ][node      ] [Desmond Pitt] starting ... 
[2014-02-25 10:02:32,813][INFO ][transport    ] [Desmond Pitt] bound_address {inet[/127.8.212.129:3306]}, publish_address {inet[/127.8.212.129:3306]} 
[2014-02-25 10:02:35,949][INFO ][cluster.service   ] [Desmond Pitt] new_master [Desmond Pitt][_bWO_h9ETTWrMNr7x_yALg][ex-std-node134.prod.rhcloud.com][inet[/127.8.212.129:3306]], reason: zen-disco-join (elected_as_master) 
[2014-02-25 10:02:36,167][INFO ][discovery    ] [Desmond Pitt] elasticsearch/_bWO_h9ETTWrMNr7x_yALg 
{1.0.0}: Startup Failed ... 
- BindHttpException[Failed to bind to [8080]] 
     ChannelException[Failed to bind to: /127.8.212.129:8080] 
       BindException[Address already in use] 

回答

3

您嘗試將ES分配給端口8080,該端口已被佔用。從那裏配置的罪魁禍首是http.port: ${OPENSHIFT_DIY_PORT}。只需將兩個port配置保留在配置之外或將envvar分配給其他某個端口。對於ES的默認端口是9200 HTTP和9300

+0

我讀了關於變量'$ {OPENSHIFT_INTERNAL_PORT}'的討論。在我看來,他們編輯了教程的這一部分,通過將變量更改爲'$ {OPENSHIFT_DIY_PORT}'來描述config/elasticsearch.yml。但是這個提示不適合我,我也得到同樣的錯誤。 – user3206010

+0

@ user3206010尚未配置的變量似乎已設置爲已在使用中的「8080」。如果您沒有理由更改ES運行端口(並且很少有端口),則可以將端口從配置文件中取出,並使用ES的默認設置。 – cfrick

+0

好吧現在沒有錯誤,我怎麼能達到ES'curl -XGET'http:// XXXX:9200/_cluster/health?pretty = true''的實例? – user3206010

4

您必須首先停止正在運行的演示應用程序,它已經綁定到8080這可以使用下面的命令來完成:

ctl_app stop 

運行後該命令將能夠在端口8080上啓動elasticsearch。但是,這不建議在生產環境中使用。