当前位置:网站首页>Very important very important very important very important very important very important very important very important very important

Very important very important very important very important very important very important very important very important very important

2022-06-25 11:21:00 Anonymous & Xiaoyu

1、 List the process number

ps -ef | grep elastic

2、 Close the process number

kill -9 Process number

3、 restart elasticsearch 

./elasticsearch -d

Parameters -d It means running in the background

1es Out-of-service root User start

Abnormal information :can not run elasticsearch as root

Solution : A new user  adduser xxx take es Folder permission modification  chown -R xx|xx Folder

2./elasticsearch -d Background start

3、 Problems needing attention during installation

1. Modify memory

Abnormal information Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Cannot allocate memory' (errno=12)

Solution : modify /config/jvm.options file  -Xms200m -Xmx200m

2. Modify the file size

Abnormal information  max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

[2]: max number of threads [3895] for user [elastic] is too low, increase to at least [4096]

[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Solution

1. modify /etc/security/limits.conf, Modify it to the prompt value

  • hard nofile 65536

2. modify /etc/security/limits.d/90-nproc.conf file add to

  • hard nproc 4096

3. modify /etc/sysctl.conf

Add the configuration :vm.max_map_count=262144, And then execute the command  sysctl -p

soft nproc: The maximum number of file descriptors that can be opened ( Soft limit )

hard nproc: The maximum number of file descriptors that can be opened ( Hard limit )

soft nofile: The maximum number of processes available to a single user ( Soft limit )

hard nofile: The maximum number of processes available to a single user ( Hard limit )

4 Simple cluster configuration

Master configuration

Cluster name , Other nodes use this name to find the specified cluster

cluster.name: wali

The name of the node , Node names in a cluster cannot be duplicate

node.name: master

Is it the primary node

node.master: true

Where the data is stored

path.data: /home/tar/elasticsearch-6.3.2/data

Where to store the log

path.logs: /home/tar/elasticsearch-6.3.2/logs

The binding of ip

network.host : 172.31.69.209

Indicates whether it is  Elasticsearch Service enabled  HTTP. If you want to use  Elasticsearch REST Request to query directly  Elasticsearch data , Then you can enable  HTTP port

http.cors.enabled: true

If  http.cors.enabled The value of is  true, Then the attribute specifies that allow  REST Where does the request come from .

http.cors.allow-origin: "*"

If enabled  HTTP port , Then this attribute is specified by  Elasticsearch The port used by the service .

http.port: 9200

Used in a cluster  Elasticsearch Port for communication between nodes

transport.tcp.port: 9300

Other node configuration

Cluster name , Other nodes use this name to find the specified cluster

cluster.name: wali

The name of the node , Node names in a cluster cannot be duplicate

node.name: slave2

Where the data is stored

path.data: /home/wuzhuang/data2

Where to store the log

path.logs: /home/wuzhuang/logs2

The binding of ip

network.host : 172.31.69.209

Provide others  Elasticsearch Unicast discovery function of service node . Configure host based in the cluster  TCP Other ports  Elasticsearch Comma separated list of services .

discovery.zen.ping.unicast.hosts: ["172.31.69.209"]

elasticsearch.yml Configuration properties

attribute

The default value

describe

cluster.name

<kbd class="ph userinput">federated_cluster</kbd>

Elasticsearch Cluster name . Using a cluster can separate  Process Federation Server Binding to a single distributed system . All servers participating in the cluster must have the same cluster name .

node.name

<kbd class="ph userinput">node1</kbd>

Elasticsearch The node name . Each of the clusters  Process Federation Server Must have a unique node name .

node.master

<kbd class="ph userinput">true</kbd>

Indicates whether a node is qualified to be a master . Master node management  Elasticsearch The state of the cluster . At run time ,Elasticsearch The service will automatically nominate a qualified cluster member as the master node .

node.data

<kbd class="ph userinput">true</kbd>

Indicates whether the node is a data node . The data node contains and manages part of the index .

http.enabled

<kbd class="ph userinput">false</kbd>

Indicates whether it is  Elasticsearch Service enabled  HTTP. If you want to use  Elasticsearch REST Request to query directly  Elasticsearch data , Then you can enable  HTTP port .

htttp.port

<kbd class="ph userinput">9200</kbd>

If enabled  HTTP port , Then this attribute is specified by  Elasticsearch The port used by the service .

http.cors.enabled

<kbd class="ph userinput">true</kbd>

If enabled  HTTP port , Then this property specifies whether cross source  REST request .

http.cors.allowed.origin

<kbd class="ph userinput">localhost</kbd>

If  http.cors.enabled The value of is  <kbd class="ph userinput">true</kbd>, Then the attribute specifies that allow  REST Where does the request come from .

transport.tcp.port

<kbd class="ph userinput">9300</kbd>

Used in a cluster  Elasticsearch Port for communication between nodes .

discovery.zen.minimum_master_nodes

<kbd class="ph userinput">1</kbd>

Indicates the required for a cluster quota  Process Federation Server The number of .

discovery.zen.ping.multicast.enabled

<kbd class="ph userinput">false</kbd>

One or more multicast requests received and responded to by the sending node provide access to other  Elasticsearch Multicast of service nodes  ping Discovery function . For more information , see also Elasticsearch file .

discovery.zen.ping.unicasts.hosts

<kbd class="ph userinput">localhost</kbd>

Provide others  Elasticsearch Unicast discovery function of service node . Configure host based in the cluster  TCP Other ports  Elasticsearch Comma separated list of services .

discovery.zen.ping.timeout

<kbd class="ph userinput">3s</kbd>

Elastic Search nodes waiting to join  Elasticsearch Cluster time .

原网站

版权声明
本文为[Anonymous & Xiaoyu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200540217437.html