docker run -d -p 8500:8500 -p 8300:8300 -p 8301:8301 -p 8302:8302 -p 8600:8600/udp consul consul agent -dev -client=0.0.0.0
访问:http://192.168.0.102:8500/
DNS查询
dig @192.168.0.102 -p 8600 consul.service.consul SRV
https://nacos.io/zh-cn/docs/quick-start-docker.html
http://192.168.0.102:8848/nacos/index.html#/login
data_ID:配置集–>一个配置集就是一个配置文件,实际上可以更灵活
命名空间:可以隔离配置集,将某些配置集放到某一个命名空间之下。命名空间我们一般用来区分微服务。
组:组可以用来区别生产,测试,开发等环境
go nacos
https://github.com/nacos-group/nacos-sdk-go/blob/master/README_CN.md
https://www.json2yaml.com/convert-yaml-to-json
grpc错误码
https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
https://github.com/Ryan-Miao/docker-yapi
https://github.com/fjc0k/docker-YApi
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
#新建es的config配置?件夹
mkdir -p /data/elasticsearch/config
#新建es的data?录
mkdir -p /data/elasticsearch/data
#新建es的plugins?录
mkdir -p /data/elasticsearch/plugins
#给?录设置权限
chmod 777 -R /data/elasticsearch
#写?配置到elasticsearch.yml中, 下?的 > 表示覆盖的?式写?, >>表示追加的?式写?,但是要确外部能访问
echo "http.host: 0.0.0.0" >> /data/elasticsearch/config/elasticsearch.yml
#安装es
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms128m -Xmx256m" \
-v /data/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /data/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.10.1
docker run -d --name kibana -e ELASTICSEARCH_HOSTS="http://192.168.0.102:9200" -p 5601:5601 kibana:7.10.1
elasticsearch和kibana版本需要保持一致
访问地址
elasticsearch:http://192.168.0.102:9200/
kibana:http://192.168.0.102:5601/
IK分词器的安装和使用
https://github.com/medcl/elasticsearch-analysis-ik/releases
解压拷贝到plugins目录下
将目录文件夹改名为ik
设置权限
cd /data/elasticsearch/plugins
chmod 777 -R ik
docker start 重启容器
分词器使用
ik_smart 和 ik_max_word
GET _analyze
{
"text":"中国科学技术?学",
"analyzer": "ik_smart"
}
[root@localhost config]# mkdir custom
[root@localhost config]# ls
custom extra_main.dic extra_single_word.dic extra_single_word_full.dic extra_single_word_low_freq.dic extra_stopword.dic IKAnalyzer.cfg.xml main.dic preposition.dic quantifier.dic stopword.dic suffix.dic surname.dic
[root@localhost config]# cd custom/
[root@localhost custom]# ls
[root@localhost custom]# vim mydic.dic #定义的词
[root@localhost custom]# vim extra_stopword.dic #停用词
[root@localhost custom]# ls
extra_stopword.dic mydic.dic
[root@localhost custom]# cd ..
[root@localhost config]# ls
custom extra_main.dic extra_single_word.dic extra_single_word_full.dic extra_single_word_low_freq.dic extra_stopword.dic IKAnalyzer.cfg.xml main.dic preposition.dic quantifier.dic stopword.dic suffix.dic surname.dic
[root@localhost config]# vim IKAnalyzer.cfg.xml
然后重启docker