“Elasticsearch精英进阶:从零到精通的安装,从Kibana到Java API,全面掌握CRUD与DSL查询及聚合技术全攻略“
# 安装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/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
# 启动Elasticsearch服务
sudo systemctl start elasticsearch.service
# 安装Kibana
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt main" | sudo tee - /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install kibana
# 修改Kibana配置文件,指向Elasticsearch
sudo vim /etc/kibana/kibana.yml
# 修改或添加以下行:
# elasticsearch.hosts: ["http://localhost:9200"]
# 启动Kibana服务
sudo systemctl start kibana.service
# 安装Elasticsearch Data Streams插件
sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch stream
# 重启Elasticsearch服务以应用插件更改
sudo systemctl restart elasticsearch.service
# 安装Elasticsearch Java API客户端
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.10.0</version>
</dependency>
以上代码提供了在Ubuntu系统上安装Elasticsearch、Kibana以及Data Streams插件的示例,并展示了如何使用Java API客户端与Elasticsearch进行交互。这些步骤涵盖了Elasticsearch精英进阶课程的主要内容,并且是从零开始掌握Elasticsearch的关键所在。
评论已关闭