环境
- ubuntu 16.04 server
- vmware 12 pro
- Finnalshell 虚拟机环境如何配置可参考 我的另一篇博客
虚拟机环境配置
安装vmware12pro
创建虚拟机ubuntu16.04 ubuntu(root)/123456 更新源安装java8
sudo apt-get install default-jre
安装elasticsearch
使用apt方式安装elaticsearch6.8方便快捷
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -sudo apt-get install apt-transport-httpsecho "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.listsudo apt-get update && sudo apt-get install elasticsearch
配置elasticsearch
注意:配置es需要切换到root用户,启动es不需要root用户
配置文件目录 /etc/elasticsearch YAML格式- elasticsearch.yml for configuring Elasticsearch
- jvm.options for configuring Elasticsearch JVM settings
- log4j2.properties for configuring Elasticsearch logging
设置jvm选项 /etc/elasticsearch/jvm.options
#堆大小 -Xms2g 最小堆大小-Xmx2g 最大堆大小
重要的配置项
/etc/elasticsearch/elasticsearch.ymlpath.data 数据文件path.logs 日志文件cluster.name 集群名称,一个集群对应多个Nodenode.name 节点名称 network.host 绑定的IP地址默认为127.0.0.0
设置开机自启动
sudo /bin/systemctl daemon-reloadsudo /bin/systemctl enable elasticsearch.service
启动和关闭
sudo systemctl start elasticsearch.servicesudo systemctl stop elasticsearch.service使用curl测试是否装好
ubuntu@ubuntu:/etc/elasticsearch$ curl localhost:9200{ "name" : "kQOogOX", "cluster_name" : "elasticsearch", "cluster_uuid" : "GZ5rMOMgRtqJewDPOscF_w", "version" : { "number" : "6.8.7", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "c63e621", "build_date" : "2020-02-26T14:38:01.193138Z", "build_snapshot" : false, "lucene_version" : "7.7.2", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, "tagline" : "You Know, for Search"}
注意问题
导入ovf模板时,需要修改硬件兼容性,在虚拟机->管理->修改硬件兼容性中修改,使得导出的ovf文件兼容目标ESXI系统