安装Elasticsearch
Contents
#前言
博客的搜索有点难用,经常找不到东西,因为现在还是基于字符串匹配的,也没有办法进行模糊搜索,所以折腾一下,顺便学习一下Elasticsearch
,记录之。
#安装OpenJDK
Elasticsearch is built using Java, and includes a bundled version of OpenJDK from the JDK maintainers (GPLv2+CE) within each distribution. The bundled JVM is the recommended JVM and is located within the jdk directory of the Elasticsearch home directory.
官网的描述如上,所以跟着官网去 https://jdk.java.net/ 下了OpenJDK
:
1 | wget https://download.java.net/java/GA/jdk16.0.1/7147401fd7354114ac51ef3e1328291f/9/GPL/openjdk-16.0.1_linux-x64_bin.tar.gz |
本来还想皮一下,结果发现验证不了。。。。只能手动验证了:
1 | onns@onns:~$ shasum -a 256 openjdk-16.0.1_linux-x64_bin.tar.gz |
然后解压安装:
1 | tar xvf openjdk-16.0.1_linux-x64_bin.tar.gz |
添加的内容是:
1 | export JAVA_HOME=/home/onns/jdk-16.0.1 |
测试一下:
1 | onns@onns:~$ javac -version |
#安装Elasticsearch
1 | wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.1-linux-x86_64.tar.gz |
这个就能验证成功 😂 :
1 | onns@onns:~$ shasum -a 512 -c elasticsearch-7.13.1-linux-x86_64.tar.gz.sha512 |
然后正常解压即可:
1 | tar -xvf elasticsearch-7.13.1-linux-x86_64.tar.gz |
然后运行:
1 | ./bin/elasticsearch |
尴尬,我的云服务器居然内存不够开启这个服务。。。换了个服务器:
1 | (base) hs@hs-Z390-AORUS-PRO:~$ curl localhost:9200 |
还是我太天真了,这个东西啥也不干就2G
内存没了,害。