티스토리 뷰

현재 같은 클러스터에 노드 명만 다른 상태입니다.

 

[node1]

cluster.name: "cluster-1"

cluster.name: "node-1"

http.port

 

[node2]

cluster.name: "cluster-1"

cluster.name: "node-2"

 

각각 실행하면은 node-1에서 added {node-2} 이라는 로그가 보일겁니다.

 

이제 이걸 확인하는 방법은 

curl http://localhost:9200, curl http://localhost:9201 하면은 확인이 가능하겠죠??

 

다음은 데이터를 한번 넣어보고 확인해볼게요

curl -X PUT "localhost:9200/customer/_doc_1?pretty" -H 'Content-Type: application/json' -d'

{

  "name" : "John Doe"

}

'

입력하게되면은 데이터가 정상적으로 들어갔다는 로그가 생성됩니다.

ex) [customer] creating index....

 

다음에 데이터를 확인하는건

curl http://localhost:9200/customer/_doc/1

->

9200에서 넣어도 9201에서도 데이터 확인가능

왜냐면 같은 클러스터로 묶여있기에 사용이 가능합니다.

 

다음에는 node3은

cluster.name: "cluster-2"

node.name: "node-3"

으로 설정되어있고 이를 실행하면은

같이 바인딩되지않고 별도의 클러스터를 구축하게됩니다.

여기서 curl http://localhost:9202/customer/_doc/1 에서는 확인이 불가능합니다

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함