Ubuntu16.04的ElasticSearch的实践-创新互联
一.安装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"}'
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
网站栏目:Ubuntu16.04的ElasticSearch的实践-创新互联
文章位置:http://scyanting.com/article/degdei.html