tar xvf elasticsearch-7.6.1-linux-x86_64.tar.gzmv elasticsearch-7.6.1 /usr/local/escd /usr/local/es && mkdir data因为es是不能使用root账号启动的,这里创建一个es的账号
useradd es && passwd es
chown es es -R
命令讲解下 chown 用户名 目录名 -R
cluster.name: my-application #集群名称node.name: node-1 #节点名称#数据和日志的存储目录path.data: /usr/local/elasticsearch-7.6.1/datapath.logs: /usr/local/elasticsearch-7.6.1/logs#设置绑定的ip,设置为0.0.0.0以后就可以让任何计算机节点访问到了network.host: 0.0.0.0http.port: 9200 #端口#设置在集群中的所有节点名称,这个节点名称就是之前所修改的,当然你也可以采用默认的也行,目前是单机,放入一个节点即可cluster.initial_master_nodes: ["node-1"]
-Xms256m-Xmx256m
账号权限编辑 ,末尾添加 vi /etc/security/limits.conf
es soft nofile 65536es hard nofile 65536es soft nproc 4096es hard nproc 4096
修改vi /etc/security/limits.d/20-nproc.conf,将* 改为用户名(es)
# Default limit for number of user's processes to prevent# accidental fork bombs.# See rhbz #432903 for reasoning.elasticsearch soft nproc 4096root soft nproc unlimited
编辑 vi /etc/sysctl.conf 在末尾加上
vm.max_map_count = 655360
sysctl -psu es/usr/local/es/bin/elasticsearchhttp://192.168.56.130:9200/
{"name" : "node-1","cluster_name" : "ex","cluster_uuid" : "gy2-hKnGTz2tnAupvqHAWg","version" : {"number" : "7.6.1","build_flavor" : "default","build_type" : "tar","build_hash" : "aa751e09be0a5072e8570670309b1f12348f023b","build_date" : "2020-02-29T00:15:25.529771Z","build_snapshot" : false,"lucene_version" : "8.4.0","minimum_wire_compatibility_version" : "6.8.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号