通过
yum list java*
查看需要安装的java版本。
这里安装 java-1.8.0-openjdk。yum -y install java-1.8.0-openjdk
查看java版本是否安装成功。java -version
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
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
yum install elasticsearch
vim /etc/elasticsearch/elasticsearch.yml
cluster.initial_master_nodes
节点,会报错如下:bootstrap check failure [1] of [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_host...be configured
Sep 16 15:52:03 VM_0_8_centos systemd-entrypoint[19004]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/elasticsearch.log
systemctl restart elasticsearch.service
systemctl status elasticsearch.service
curl localhost:9200
, 或者用 postman用外网ip请求试试。{ "name": "node-1", "cluster_name": "elasticsearch", "cluster_uuid": "_na_", "version": { "number": "7.14.1", "build_flavor": "default", "build_type": "rpm", "build_hash": "66b55ebfa59c92c15db3f69a335d500018b3331e", "build_date": "2021-08-26T09:01:05.390870785Z", "build_snapshot": false, "lucene_version": "8.9.0", "minimum_wire_compatibility_version": "6.8.0", "minimum_index_compatibility_version": "6.0.0-beta1" }, "tagline": "You Know, for Search" }