elasticsearch及相关插件安装

elasticsearch相关安装

elasticsearch安装

  1. 下载es包
  2. 新建用户
    groupadd es
    useradd es -g es -p xxx
    chown -R es:es 你的es目录
  1. su es
    如果出现用户创建不成功
    mkdir /home/es
    cp /etc/skel/.bash_logout /home/es/
    cp /etc/skel/.bash_profile /home/es/
    cp /etc/skel/.bashrc /home/es/
  1. ./bin/elasticsearch

问题

  1. max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
vi /etc/security/limits.conf 

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096
  1. max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    vi /etc/sysctl.conf 

    添加下面配置:
    
    vm.max_map_count=655360
    
    并执行命令:
    
    sysctl -p

kibana安装

  1. 下载kibanna
  2. 修改配置文件
  3. ./kibana

安装x-pack

  1. 在线安装
      #elasticsearch安装x-pack
      ./elasticsearch-plugin install x-pack
      
      #kibana安装x-pack
      ./kibana-plugin install x-pack
      
      #logsta
      
      
      
    
  2. 离线安装
        1. 下载x-pack文件
        https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-5.6.10.zip
        2. 安装,使用file://协议
        ./elasticsearch-plugin install file://yourfilepath/x-pack-5.6.10.zip
    

安装ik分词器

github:https://github.com/medcl/elasticsearch-analysis-ik

  1. 离线
  2. 在线

重启es

ik的分析器和分词器

ik的Analyzer:ik_smart , ik_max_word

ik的Tokenizer:ik_smart , ik_max_word

区别

  • ik_max_word: 会将文本做最细粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,中华人民,中华,华人,人民共和国,人民,人,民,共和国,共和,和,国国,国歌”,会穷尽各种可能的组合;

  • ik_smart: 会做最粗粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,国歌”。

配置ik

路径:/home/es-fm/elasticsearch-5.6.10/config/analysis-ik

//扩展的词库
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

自定义扩展配置

//这里的ik需要配置扩展,至少需要配置扩展的停用词,多个词库以;号隔开
<properties>
	<comment>IK Analyzer 扩展配置</comment>
	<!--用户可以在这里配置自己的扩展字典 -->
	<entry key="ext_dict">extra_main.dic;extra_single_word.dic;extra_single_word_full.dic;extra_single_word_low_freq.dic</entry>
	 <!--用户可以在这里配置自己的扩展停止词字典-->
	<entry key="ext_stopwords">extra_stopword.dic</entry>
	<!--用户可以在这里配置远程扩展字典 -->
	<!-- <entry key="remote_ext_dict">words_location</entry> -->
	<!--用户可以在这里配置远程扩展停止词字典-->
	<!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值