ES elasticsearch 7.10安装部署
下载安装
#进入安装目录
cd /opt
#下载安装包,300多M
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.1-linux-x86_64.tar.gz
# 解压
tar -zxvf elasticsearch-7.10.1-linux-x86_64.tar.gz
# 进入es根目录
cd elasticsearch-7.10.1
配置
- 修改配置文件
vim config/elasticsearch.yml
#集群名词
cluster.name: lizz-application
# 本节点名词
node.name: node-1
# 服务ip,0表示所有本地ip
network.host: 0.0.0.0
# 服务端口号
http.port: 9200
# es节点列表,集群时配置多个,数组
discovery.seed_hosts: ["127.0.0.1"]
# es启动时,参数选主的node列表,集群时配置多个
cluster.initial_master_nodes: ["node-1"]
启动
- 启动es
bin/elasticsearch
#启动失败异常
java.lang.RuntimeException: can not run elasticsearch as root
- 创建esuser用户,参考Linux用户管理添加/删除用户
- 切换用户成功
sudo su esuser
[sudo] esuser 的密码:
- 再次启动异常
bin/elasticsearch
[1]: max number of threads [3882] for user [esuser] is too low, increase to at least [4096]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ES启动异常:max number of threads [3882] for user [xxx] is too low, increase to at least [4096]
ES启动异常:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ES启动异常:the default discovery settings are unsuitable for production use; at least...
ES启动异常:There is insufficient memory for the Java Runtime Environment to continue
- 再次启动,增加-d后台启动,防止退出时自动关闭
bin/elasticsearch -d
- 查看启动日志,文件名词与cluster.name名一致。
tailf logs/lizz-application.log
- 启动成功,查看服务
curl http://127.0.0.1:9200/
{
"name" : "node-1",
"cluster_name" : "lizz-application",
"cluster_uuid" : "1ZwW2lw2RUKhqM9F1Bhu-A",
"version" : {
"number" : "7.10.1",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa",
"build_date" : "2020-12-05T01:00:33.671820Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}