# 环境准备 (以vmware为例)标签:9200,elasticsearch7.6,version,7.6,build,docker,安装 From: https://blog.51cto.com/u_16021118/6140331
1. docker 镜像源设置为aliyun
2. cpu设置值>1
# 安装步骤
1. 安装docker
curl -sSL https://get.daocloud.io/docker | sh
2. 下载es7镜像
docker pull elasticsearch:7.6.2
3. 启动容器
docker run --restart=always -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms512m -Xmx512m" --name='elasticsearch' --cpuset-cpus="1" -m 2G -d elasticsearch:7.6.2
4. 防火墙
如果有防火墙,可以开放9200,9300两个端口或者关闭防火墙
systemctl stop firewalld
5. 浏览器访问 (下面IP要修改为当前安装的服务器IP)
http://192.168.43.43:9200/
出现如下所示内容,即标识安装成功
{
"name" : "fa013b1587ca",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "D0j1zHUWSoK1KNzvWRQ00Q",
"version" : {
"number" : "7.6.2",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
"build_date" : "2020-03-26T06:34:37.794943Z",
"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"
}
6. 安装es-head,浏览器端可视化插件
https://github.com/ainusers/es-visual-plugin