-
Notifications
You must be signed in to change notification settings - Fork 0
/
elasticsearch
57 lines (33 loc) · 1.45 KB
/
elasticsearch
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
###To get unaggigned
curl -XGET localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED
more https://www.datadoghq.com/blog/elasticsearch-unassigned-shards/
##change setting in command line like cluser and node related information should be added on command line.
./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1
##export elasticsearch config path
ES_PATH_CONF=/path/to/my/config ./bin/elasticsearch
###logging of elasticsearch
https://www.elastic.co/guide/en/elasticsearch/reference/current/logging.html
##adding an index on cluster
curl -X PUT "localhost:9200/blogs?pretty" -H 'Content-Type: application/json' -d'
{
"settings" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
}
}
'
curl -XPUT "localhost:9200/blogs/_settings?pretty" -H 'Content-Type: application/json' -d'
{
"settings": {
"index.unassigned.node_left.delayed_timeout": "5m"
}
}'
###########################
https://stackoverflow.com/questions/23113433/elasticsearch-clustering-on-multiple-machines-master-election?rq=1
https://discuss.elastic.co/t/master-node-and-data-node-configuration/132259/3
3
If you are running to nodes on one machine, it is probably better to add ports to your configuration.
discovery.zen.ping.unicast.hosts: ["machine1:9300", "machine2:9300", "machine2:9301"]
Than also configure the ports yourself so you know which node has which port:
transport.tcp.port: 9300
http.port: 9200