我想将Elasticsearch部署为我的jboss 6.4上的.war库。
首先,我将Elasticsearch打包为.war,按以下准则:https://github.com/javanna/elasticsearch-war-war-example工作!
在我的JBOSS实例上部署此.WAR文件将产生以下输出:
Starting deployment of "elasticsearch-1.5.2.war" (runtime-name: "elasticsearch-1.5.2.war")
10:33:40,718 INFO [org.jboss.web] Register web context: /elasticsearch-1.5.2
10:33:40,774 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/elasticsearch-1.5.2]] Initializing elasticsearch Node 'node'
10:33:41,740 INFO [org.elasticsearch.node] [My Node Name] version[1.5.2], pid[21232], build[62ff986/2015-04-27T09:21:06Z]
10:33:41,740 INFO [org.elasticsearch.node] [My Node Name] initializing ...
10:33:41,744 INFO [org.elasticsearch.plugins] [My Node Name] loaded [], sites []
10:33:42,830 INFO [org.elasticsearch.node] [My Node Name] initialized
10:33:42,830 INFO [org.elasticsearch.node] [My Node Name] starting ...
10:33:45,739 INFO [org.elasticsearch.transport] [My Node Name] bound_address {inet[/0.0.0.0:9300]}, publish_address {inet[/123.12.123.123:9300]}
10:33:45,750 INFO [org.elasticsearch.discovery] [My Node Name] my-cluster/NILFFG5LRHyWIOk_X9hv4w
10:33:48,788 INFO [org.elasticsearch.cluster.service] (elasticsearch[My Node Name][clusterService#updateTask][T#1]) [My Node Name] new_master [My Node Name][NILFFG5LRHyWIOk_X9hv4w][MYDOMAIN][inet[/123.12.123.123:9300]], reason: zen-disco-join (elected_as_master)
10:33:48,803 INFO [org.elasticsearch.node] [My Node Name] started
10:33:48,831 INFO [org.elasticsearch.gateway] (elasticsearch[My Node Name][clusterService#updateTask][T#1]) [My Node Name] recovered [0] indices into cluster_state
10:33:48,859 INFO [org.jboss.as.server] : Deployed "elasticsearch-1.5.2.war" (runtime-name : "elasticsearch-1.5.2.war")
显然,与通常的elasticsearch.bat安装相比,端口9200上没有地址使用Elasticsearch的REST API。
- 根据此"指南" http://www.elastic.co/guide/en/elasticsearch/client/java-api/master/master/_deploying_in_jboss_eap6_module.html,我必须创建一个模块。隐含地,我在我的$ jboss_home/模块中创建了目录org.elasticsearch/main,作为所需的模块
- 我还将所需的JAR从我的Elasticsearch-1.5.2/lib复制到$ jboss_home/模块/org/elasticsearch/main
- 当然,我在我的模块文件夹中添加了其他任何模块依赖项,例如org.apache.log4j
添加我的模块作为扩展名时,我会收到以下错误。
[standalone@localhost:9999 /] /extension=org.elasticsearch:add()
{
"outcome" => "failed",
"failure-description" => "org.jboss.modules.ModuleLoadException: Error loading module from C:\jboss-eap-6.4\modules\org\elasticsearch\main\module.xml",
"rolled-back" => true
- 还有另一个缺失的依赖性吗?
- 是否有更详细的"指南"如何在应用程序服务器上配置Elasticsearch,例如jboss?
对于那些也想在JBOSS上部署Elasticsearch的人,请在elasticsearch.com上查看此线程
https://discuss.elastic.co/t/elasticsearch-deployment-on-jboss/304