docker swarm elasticsearch and spring boot elasticsearch

1. yum install docker

2. service docker start

3. docker swarm init

4. docker swarm join 192.168.1.111:2733

5. docker node ls 

6. docker service create --name elastic --replicas 2 -p 9200:9200 elasticsearch

7. docker service ls docker ps

d6f9868a8f85  elasticsearch:latest   "/docker-entrypoint   43 minutes ago  Up 43 minutes   9200/tcp, 9300/tcp   elastic.1.qhrl6kfqk36ifw1jwwu79kc39

8. docker service ps elastic

9. chrome: http://172.168.1.110:9200

10. eclipse run spring boot(1.5.9) + spring-boot-starter-data-elasticsearch(1.5.1) + spring-data_elasticsearch(2.1.0) + elasticsearch(2.4.4), 

cluster-nodes: 192.168.1.110:9200  

cluster-name:elasticsearch

11. error: org.elasticsearch.transport.ReceiveTimeoutTransportException: [][192.168.1.110:9200][cluster:monitor/nodes/liveness] request_id [0] timed out after [5002ms]

12. google info: since 9200 is only for the HTTP interface, the TransportClient must use port 9300

13. netstat -ntlp, can find 9300, open 9300 port

14. error: org.elasticsearch.transport.ConnectTransportException: [][192.168.1.110:9300] connect_timeout[30s]

15. docker swarm leave --force

16. service firewalld stop

17. docker swarm init

18. docker service create --name elastic --replicas 2 -p 9200:9200 -p 9300:9300 elasticsearch

19. docker exec -it container id bash

20. cat /usr/share/elasticsearch/config/elasticsearch.yml

21. docker run -d -p 9200:9200 -p 9300:9300 -v "$PWD/config":/usr/share/elasticsearch/config --name elastic elasticsearch 

22. vi elasticsearch.yml

23. transport.tcp.port: 9300

24. http.port: 9200

25. copy https://github.com/spring-projects/spring-data-elasticsearch/wiki/Spring-Data-Elasticsearch---Spring-Boot---version-matrix

26. java.lang.IllegalStateException: Received message from unsupported version: [2.0.0] minimal compatible version is: [5.6.0]

27. docker pull elasticsearch:2.4.6

28. everything ok

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章