Linux上ElasticSearch搭建7.9.2

国内源下载ES

到 https://mirrors.huaweicloud.com/elasticsearch/7.9.2/ 选择自己需要的版本,我这里是7.9.2

wget https://mirrors.huaweicloud.com/elasticsearch/7.9.2/elasticsearch-7.9.2-linux-x86_64.tar.gz

tar -xzvf elasticsearch-7.9.2-linux-x86_64.tar.gz

cd elasticsearch-7.9.2

vim config/jvm.options

-Xms256m
-Xmx256m
##-Xms1g
##-Xmx1g
外网访问问题

vim config/elasticsearch.yml

network.host: 0.0.0.0
再启动 会报错
ERROR: [4] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3766] for user [cheng] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /home/Downloads/elasticsearch-7.9.2/logs/elasticsearch.log
解决方案

参考 https://blog.csdn.net/wd2014610/article/details/89532638

安装ik_max_word

参考GitHub https://github.com/medcl/elasticsearch-analysis-ik

下面命令里面 7.9.2 替换成你自己的版本即可

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.9.2/elasticsearch-analysis-ik-7.9.2.zip

自定义词库

vim config/analysis-ik/IKAnalyzer.cfg.xml

其中 ext_dict.txt 就是你自定义的词库 我是放在同级目录

<?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">ext_dict.txt</entry>
	 <!--用户可以在这里配置自己的扩展停止词字典-->
	<entry key="ext_stopwords"></entry>
	<!--用户可以在这里配置远程扩展字典 -->
	<!-- <entry key="remote_ext_dict">words_location</entry> -->
	<!--用户可以在这里配置远程扩展停止词字典-->
	<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>

添加 es启动用户

创建一个非root用户,作为elasticsearch启动用户

创建用户组 groupadd esgroup
创建用户 useradd estest -g esgroup -p 123456
赋予权限 chown -R estest:esgroup elasticsearch-7.9.2 (用户名:组 es目录)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值