yum 安装elasticsearch
1.
安装jdk8以上版本
yum install java -y
java -version 查看java版本
官网 https://www.elastic.co/guide/en/elasticsearch/reference/7.3/rpm.html#rpm-running-init
2.
1.下载并安装GPG key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
2.添加yum仓库
vim /etc/yum.repos.d/elasticsearch.repo
加入下面的代码
从官网复制的
[elasticsearch-7.x] name=Elasticsearch repository for 7.x packages baseurl=https://artifacts.elastic.co/packages/7.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md
3.安装elasticsearch
yum install elasticsearch
4.配置elasticsearch
参考 http://www.360doc.com/content/19/0110/15/51464875_807934554.shtml
https://www.cnblogs.com/miao-zp/p/6003160.html
配置外网访问,端口
vim /etc/elasticsearch/elasticsearch.yml
5 启动
systemctl start elasticsearch
测试
curl -X GET localhost:9200
如果内存不足 ,小于 1g
https://blog.csdn.net/qq_36663951/article/details/80693892
如果
[1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
https://www.jianshu.com/p/169acce2ce25
这时候继续编辑elasticsearch.yml文件,将 #cluster.initial_master_nodes: ["node-1", "node-2"] 修改为 cluster.initial_master_nodes: ["node-1"],记得保存。