ubuntu16.04 安装elasticsearch
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/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list sudo apt-get update && sudo apt-get install elasticsearch
配置
sudo nano /etc/elasticsearch/elasticsearch.yml
在最下面添加
network.host: 0.0.0.0 discovery.seed_hosts: ["0.0.0.0"] cluster.name: myCluster1 node.name: "myNode1"
将 Elasticsearch 配置为在系统启动时自动启动
sudo /bin/systemctl enable elasticsearch.service
启动停止
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
测试
curl -X GET "http://localhost:9200/?pretty"
{ "name" : "myNode1", "cluster_name" : "myCluster1", "cluster_uuid" : "_na_", "version" : { "number" : "7.10.1", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "1c34507e66d7db1211f66f3513706fdf548736aa", "build_date" : "2020-12-05T01:00:33.671820Z", "build_snapshot" : false, "lucene_version" : "8.7.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "You Know, for Search" }