Commit c458239e authored by macro's avatar macro
Browse files

docker部署文档修改

parent 83cd9728
...@@ -146,7 +146,7 @@ Mysql | 5.7 | https://www.mysql.com/ ...@@ -146,7 +146,7 @@ Mysql | 5.7 | https://www.mysql.com/
Redis | 3.2 | https://redis.io/download Redis | 3.2 | https://redis.io/download
Elasticsearch | 6.2.2 | https://www.elastic.co/downloads Elasticsearch | 6.2.2 | https://www.elastic.co/downloads
MongoDb | 3.2 | https://www.mongodb.com/download-center MongoDb | 3.2 | https://www.mongodb.com/download-center
RabbitMq | 5.25 | http://www.rabbitmq.com/download.html RabbitMq | 3.4.1 | http://www.rabbitmq.com/download.html
nginx | 1.10 | http://nginx.org/en/download.html nginx | 1.10 | http://nginx.org/en/download.html
### 搭建步骤 ### 搭建步骤
......
...@@ -85,27 +85,24 @@ rabbitmq:management ...@@ -85,27 +85,24 @@ rabbitmq:management
## elasticsearch安装 ## elasticsearch安装
### 下载镜像文件 ### 下载镜像文件
docker pull elasticsearch:2.4 docker pull elasticsearch:6.2.2
### 创建实例并运行 ### 创建实例并运行
docker run -p 9200:9200 -p 9300:9300 --name elasticsearch \ docker run -p 9200:9200 -p 9300:9300 --name elasticsearch \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \ -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \ -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-d elasticsearch:2.4 -d elasticsearch:6.2.2
### 测试 ### 测试
访问会返回版本信息:http://192.168.1.66:9200/ 访问会返回版本信息:http://192.168.1.66:9200/
### 安装目录位置 ### 安装目录位置
/usr/share/elasticsearch /usr/share/elasticsearch
### 安装head插件 ### 安装head插件(可以不安装,仅用于测试)
1. 进入docker内部bash:docker exec -it elasticsearch /bin/bash 1. 进入docker内部bash:docker exec -it elasticsearch /bin/bash
2. 安装插件:plugin install mobz/elasticsearch-head 2. 安装插件,具体参考:https://github.com/mobz/elasticsearch-head
3. 测试:http://192.168.1.66:9200/_plugin/head/ 3. 测试:http://192.168.1.66:9200/_plugin/head/
### 安装中文分词器IKAnalyzer ### 安装中文分词器IKAnalyzer
1. 下载中文分词器:https://github.com/medcl/elasticsearch-analysis-ik/releases?after=v5.6.4 的zip包,并解压后重新压缩为.tar.gz文件 1. 进入docker内部bash:docker exec -it elasticsearch /bin/bash
2. 上传后拷贝到容器中:docker container cp elasticsearch-analysis-ik-1.10.6.tar.gz elasticsearch:/usr/share/elasticsearch/plugins 2. 安装中文分词插件,执行以下命令:elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.2.2/elasticsearch-analysis-ik-6.2.2.zip
3. 进入容器压缩文件所在目录:docker exec -it elasticsearch /bin/bash 3. 测试:
4. 进行解压操作:tar -xvf elasticsearch-analysis-ik-1.10.6.tar.gz
5. 重新启动容器:docker restart elasticsearch
6. 测试:
- 访问header插件:打开地址http://192.168.1.66:9200/_plugin/head/ - 访问header插件:打开地址http://192.168.1.66:9200/_plugin/head/
- 选择复合查询,输入地址:POST:http://192.168.1.66:9200/_analyze - 选择复合查询,输入地址:POST:http://192.168.1.66:9200/_analyze
- 输入参数:JSON:{"analyzer":"ik","text":"我们是大数据开发人员"} - 输入参数:JSON:{"analyzer":"ik","text":"我们是大数据开发人员"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment