Ubuntu 24.04 LTS安装elasticsearch-8.13.4+Kibana+IK的脚本半自动安装
#!/bin/bash
# 安装Elasticsearch 8.13.4和Kibana,并配置IK分词器插件
# 更新软件包列表
sudo apt-get update
# 安装Java
sudo apt-get install openjdk-17-jdk -y
# 验证Java安装
java -version
# 添加Elasticsearch和Kibana的官方GPG密钥
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# 添加Elasticsearch和Kibana的APT源
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
# 更新软件包列表
sudo apt-get update
# 安装Elasticsearch和Kibana
sudo apt-get install elasticsearch=8.13.4 kibana=8.13.4 -y
# 启动Elasticsearch和Kibana服务
sudo systemctl start elasticsearch
sudo systemctl start kibana
# 开机自启动
sudo systemctl enable elasticsearch
sudo systemctl enable kibana
# 验证Elasticsearch状态
sudo systemctl status elasticsearch
# 验证Kibana状态
sudo systemctl status kibana
# 安装Elasticsearch IK分词器插件
elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.13.4/elasticsearch-analysis-ik-8.13.4_linux_aarch64.zip
这段代码提供了一个自动化安装Elasticsearch 8.13.4和Kibana,并配置了IK分词器插件的方法。它首先更新软件包列表,然后安装Java环境,并添加Elasticsearch和Kibana的官方源。接着,它安装Elasticsearch和Kibana,并将它们设置为开机自启动。最后,它验证了Elasticsearch和Kibana的安装状态,并安装了Elasticsearch的IK分词器插件。
评论已关闭