Elasticsearch usage guidelines

(1)使用es client代码库
<elasticsearch.version>2.3.3</elasticsearch.version>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-elasticsearch</artifactId>
</dependency>

(2)es建议使用xml配置
spring.data.elasticsearch.cluster-name=galen #集群名称
#spring.data.elasticsearch.cluster-nodes=106.75.33.233:9200,10.10.46.196:9200,10.10.56.141:9200 多台服务器
spring.data.elasticsearch.cluster-nodes=172.16.10.70:9300 #es service url
spring.data.elasticsearch.properties.path.data= ./elasticsearch/data #es local data
spring.data.elasticsearch.properties.path.logs= ./elasticsearch/logs #es local logs

(3) Notes
Note on cluster- The port number of nodes is generally 9300, not 9200

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326114616&siteId=291194637