安装远程索引¶
如果用户希望分析WFS数据(请参见 分析和可视化数据 ) Elasticsearch <https://www.elastic.co/products/elasticsearch> 实例可以安装在目录旁边。
手动安装¶
从下载Elasticsearchhttps://www.elastic.co/downloads/elasticsearch然后解压文件。
cd es/config
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2.tar.gz
tar xvfz elasticsearch-7.4.2.tar.gz
使用以下命令手动启动和停止Elasticsearch:
elasticsearch-7.4.2/bin/elasticsearch
然后创建默认索引:
cd es
curl -X PUT http://localhost:9200/features -H "Content-Type: application/json" -d @config/features.json
curl -X PUT http://localhost:9200/records -H "Content-Type: application/json" -d @config/records.json
curl -X PUT http://localhost:9200/searchlogs -H "Content-Type: application/json" -d @config/searchlogs.json
停止Elasticsearch使用
elasticsearch-7.4.2/bin/elasticsearch stop
使用Maven安装¶
从源代码运行,使用Maven下载。
cd es
mvn install -Pes-download
mvn exec:exec -Des-start
curl -X PUT http://localhost:9200/features -H "Content-Type: application/json" -d @config/features.json
curl -X PUT http://localhost:9200/records -H "Content-Type: application/json" -d @config/records.json
curl -X PUT http://localhost:9200/searchlogs -H "Content-Type: application/json" -d @config/searchlogs.json
要在使用Maven时停止Elasticsearch,只需停止进程,因为Elasticsearch是在前台模式下启动的。
检查安装¶
从访问Elasticsearch管理页http://localhost/本地主机:9200/。
配置连接¶
更新中的Elasticsearch URL `WEB-INF/config.properties
,将“es”添加到中的“spring.profiles.active” ```WEB-INF/web.xml` 激活它并重新启动应用程序(请参见 :code:`web/src/main/webResources/WEB-INF/config.properties )。