最近突发奇想,想玩一下elasticsearch,然后就找到了官网进行了安装学习:
- 官网地址:https://www.elastic.co/cn/
- 官方手册地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html
我安装的是最新的版本:elasticsearch-7.2.0
然后参考手册上面的安装步骤,开启了骚操作~~
1、首先查看安装的jvm,因为es是用java开发的嘛
java -version
echo $JAVA_HOME
2、然后进行下载包(curl不行的话,直接复制链接到浏览器里面哦~)
// 下载安装包
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.tar.gz
// 解压下载包
tar -xvf elasticsearch-6.0.1.tar.gz
// 切换到指定目录
cd elasticsearch-6.0.1/bin
// 运行
./elasticsearch
官网就上面几步操作,然后es就搞好了,然后按照步骤搞完,我TM咋不对嘞?
我执行启动命令后,报如下错误:
这个是什么鬼?为什么和官网不一样呢?
此时此刻只好依靠万能的百度了~ 搜一把!!!
很幸运找到了:
遇到的问题
Failed to create native process factories for Machine Learning
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failed to create native process factories for Machine Learning]; nested: FileNotFoundException[/tmp/elasticsearch-9556421478939290099/controller_log_1 (No such file or directory)];
咦,好类似哎,试一把~
解决方案:修改config/elasticsearch.yml文件,在底部添加
action.auto_create_index: .security,.monitoring*,.watches,.triggered_watches,.watcher-history*
xpack.security.enabled: false
xpack.monitoring.enabled: true
xpack.graph.enabled: false
xpack.watcher.enabled: false
xpack.ml.enabled: false
试一把,搞起~~~
启动没报错~~~
地址输入 localhost:9200 搞一把
ok,大功告成,安装完毕~