标签:pos init 文件 clu inux ini struct com gate
[root@manager ~]# vim /etc/elasticsearch/jvm.options
# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space
-Xms2g
-Xmx2g
[root@manager ~]# grep '^[^#]' /etc/elasticsearch/elasticsearch.yml
cluster.name: test-es
node.name: manager
node.attr.rack: r1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
bootstrap.memory_lock: true #官方文档建议为true
network.host: 192.168.50.65
http.port: 9200
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["manager"]
gateway.recover_after_nodes: 3
action.destructive_requires_name: true
[root@manager ~]# systemctl edit elasticsearch
[Service]
LimitMEMLOCK=infinity
[root@manager ~]# systemctl daemon-reload
[root@manager ~]# sysctl -p
vm.max_map_count=262144
[root@manager ~]# cat /etc/security/limits.d/20-nproc.conf
* soft nproc 4096
root soft nproc unlimited
[root@manager ~]# cat /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096
[root@manager ~]# systemctl start elasticsearch.service
[root@manager ~]# jps # 专门查看Java程序的ps,比直接用ps去查PID要方便一点
3292 Jps
25756 Elasticsearch
浏览器访问 http://192.168.50.65:9200/
或者curl
[root@manager ~]# curl http://192.168.50.65:9200/
{
"name" : "manager",
"cluster_name" : "test-es",
"cluster_uuid" : "S8pmWc10SfKXZZxmxbN2Qg",
"version" : {
"number" : "7.4.2",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "2f90bbf7b93631e52bafb59b3b049cb44ec25e96",
"build_date" : "2019-10-28T20:40:44.881551Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
基础知识参考
http://www.linuxe.cn/post-295.html
https://www.elastic.co/guide/en/elasticsearch/reference/7.4/heap-size.html
标签:pos init 文件 clu inux ini struct com gate
原文地址:https://www.cnblogs.com/max27149/p/11888139.html