别人的文章链接,全一点
1.为了nginx容器配置,执行如下代码,若没有nginx容器会从远程拉取
docker run -p 80:80 --name nginx \
-v /mydata/nginx/html:/usr/share/nginx/html \
-v /mydata/nginx/logs:/var/log/nginx \
-v /mydata/nginx/conf/:/etc//nginx \
-d nginx:1.10 POST _analyze
2.如下内存不太够,调大点
virtualbox上调整下
3.访问http://192.168.56.10/出现如下说明nginx配置迁移成功
4.在nginx的html文件夹下添加index.html并添加 <h1>gulimall</h1> 再次访问会出现如下
5.添加自定义分词文件
[root@localhost html]# mkdir es
[root@localhost html]# ls
es index.html
[root@localhost html]# cd es
[root@localhost es]# ls
[root@localhost es]# vi fenci.txt
尚硅谷
乔碧萝
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
我在输入中文的时候乱码了,所以在CRT中先调整了编码格式
6.修改配置上面自定义配置生效
[root@localhost elasticsearch]# ls
config data plugins
[root@localhost elasticsearch]# cd plugins/
[root@localhost plugins]# ls
ik
[root@localhost plugins]# cd ik
[root@localhost ik]# ls
commons-codec-1.9.jar config httpclient-4.5.2.jar plugin-descriptor.properties
commons-logging-1.2.jar elasticsearch-analysis-ik-7.4.2.jar httpcore-4.4.4.jar plugin-security.policy
[root@localhost ik]# cd config/
[root@localhost config]# ls
extra_main.dic extra_single_word_full.dic extra_stopword.dic main.dic quantifier.dic suffix.dic
extra_single_word.dic extra_single_word_low_freq.dic IKAnalyzer.cfg.xml preposition.dic stopword.dic surname.dic
[root@localhost config]# vi IKAnalyzer.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>IK Analyzer 扩展配置</comment>
<!--用户可以在这里配置自己的扩展字典 -->
<entry key="ext_dict"></entry>
<!--用户可以在这里配置自己的扩展停止词字典-->
<entry key="ext_stopwords"></entry>
<!--用户可以在这里配置远程扩展字典 -->
<entry key="remote_ext_dict">http://192.168.56.10/es/fenci.txt</entry>
<!--用户可以在这里配置远程扩展停止词字典-->
<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>
~
~
~
7.重启es并设置自启动
[root@localhost config]# cd /
[root@localhost /]# docker start elasticsearch
elasticsearch
[root@localhost /]# docker update elasticsearch --restart=always