网站建设模拟实训题,上海代理工商注册公司,网站建设哪专业,怎么获取网站数据做统计目录 前言安装ElasticSearch/ES安装步骤1#xff1a;准备1. 安装docker2. 搜索可以使用的镜像。3. 也可从docker hub上搜索镜像。4. 选择合适的redis镜像。 安装步骤2#xff1a;拉取ElasticSearch镜像1 拉取镜像2 查看已拉取的镜像 安装步骤3#xff1a;创建容器创建容器方… 目录 前言安装ElasticSearch/ES安装步骤1准备1. 安装docker2. 搜索可以使用的镜像。3. 也可从docker hub上搜索镜像。4. 选择合适的redis镜像。 安装步骤2拉取ElasticSearch镜像1 拉取镜像2 查看已拉取的镜像 安装步骤3创建容器创建容器方式1快速创建容器 安装步骤4运行容器安装步骤5检查是否安装成功 ElasticSearch 配置工作目录/WorkingDir设置跨域请求设置 JVM 内存参数 容器设置容器随 docker 自动启动容器设置IP 安装elasticsearch-head其它参考 前言
TencentOS Server 3.1Docker version 19.03.14, build 5eb3275d40elasticsearch: 7.4.0
安装ElasticSearch/ES
安装步骤1准备
1. 安装docker
安装 docker 参考【Centos 8】【Centos 7】安装 docker
2. 搜索可以使用的镜像。 shell docker search elasticsearch
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
elasticsearch Elasticsearch is a powerful open source sear… 6115 [OK]
kibana Kibana gives shape to any kind of data — str… 2622 [OK] 3. 也可从docker hub上搜索镜像。
docker hubdocker hub-stage。
4. 选择合适的redis镜像。
版本拉取命令最新版本docker pull elasticsearch:latest7.4.0docker pull elasticsearch:7.4.07.12.0docker pull elasticsearch:7.12.08.0.0docker pull elasticsearch:8.0.08.9.0docker pull docker.elastic.co/elasticsearch/elasticsearch:8.9.0
安装步骤2拉取ElasticSearch镜像
1 拉取镜像
shell docker pull elasticsearch:7.4.02 查看已拉取的镜像
shell docker images
REPOSITORY TAG IMAGE ID CREATED SIZEelasticsearch 7.4.0 dd156dd42341 3 years ago 859MB
mobz/elasticsearch-head 5 b19a5c98e43b 6 years ago 824MB安装步骤3创建容器
创建容器方式1快速创建容器
shell docker create -e discovery.typesingle-node -p 9200:9200 -p 9300:9300 \
-e ES_JAVA_OPTS-Xms1g -Xmx1g \
--name elasticsearch1 elasticsearch:7.4.0
安装步骤4运行容器
shell docker start elasticsearch1安装步骤5检查是否安装成功
浏览器访问http://localhost:9200, 如果出现以下界面就是安装成功
ElasticSearch 配置
工作目录/WorkingDir
WorkingDir: /usr/share/elasticsearch 设置跨域请求
shell docker exec -it elasticsearch1 /bin/bash
shell vi /usr/share/elasticsearch/config/elasticsearch.yml增加如下配置
http.cors:enabled: trueallow-origin: *设置 JVM 内存参数
shell docker exec -it elasticsearch1 /bin/bash
shell vi /usr/share/elasticsearch/config/jvm.options修改如下配置
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## which should be named with .options suffix, and the min and
## max should be set to the same value. For example, to set the
## heap to 4 GB, create a new file in the jvm.options.d
## directory containing these lines:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/8.9/heap-size.html
## for more information
##
################################################################
-Xms1g
-Xmx1g容器设置
容器随 docker 自动启动
设置容器的重启策略
shell docker update --restartalways elasticsearch1每次docker启动时容器也会自动启动
容器设置IP
向网络中添加容器
shell docker network connect --ip 172.19.0.2 mynetwork elasticsearch1 docket ip : 172.19.0.2
安装elasticsearch-head
Docker安装 elasticsearch-head
其它
略
参考
https://blog.csdn.net/qq_40942490/article/details/111594267 https://www.cnblogs.com/jianxuanbing/p/9410800.html https://blog.csdn.net/teyue87/article/details/122626499 https://blog.csdn.net/qq_44732146/article/details/120744829 https://gitee.com/mirrors/elasticsearch https://github.com/mobz/elasticsearch-head