Ubuntu16.04的ElasticSearch的实践

发布时间:2020-07-13 08:45:07 作者:dfwasds
来源:网络 阅读:350

一.安装Java
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install openjdk-8-jre-headless

验证
java -version

安装JDK
sudo apt-get install openjdk-8-jdk-headless

验证
javac

JAVA HOME /usr/lib/jvm/java-8-oracle
JAVA CLASSPATH /usr/share/java

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export CLASSPATH=/usr/share/java
source /etc/profile

二.安装ES
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

sudo apt-get install apt-transport-https

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

sudo apt-get update

sudo apt-get install elasticsearch

ps -p 1

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service

//sudo systemctl stop elasticsearch.service
//sudo systemctl status elasticsearch.service

验证
curl localhost:9200

三.安装ik
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.4.1/elasticsearch-analysis-ik-7.4.1.zip

重启
sudo systemctl stop elasticsearch.service
sudo systemctl start elasticsearch.service

验证
curl 'http://127.0.0.1:9200/_analyze?pretty=true' -H 'Content-Type: application/json' -d '{ "analyzer":"ik_max_word", "text":"士大夫敢死队风格MN"}'

推荐阅读:
  1. elk(elasticsearch、logstast,kibana)filebeat部署与实践
  2. Elasticsearch实践指南

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ubuntu16.04 elasticsearch analysis-ik

上一篇:九九乘法表python的表达方法

下一篇:python assert

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》