wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
apt-get install apt-transport-https
echo "deb https://mirrors.bfsu.edu.cn/elasticstack/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
apt-get update && apt-get install kibana
systemctl enable kibana
# 修改配置文件
vim /etc/kibana/kibana.yml
server.host: "192.168.29.152" # 改为本机ip
i18n.locale: "zh-CN" # 改为中文(不是必须的)
systemctl start kibana
systemctl status kibana
# install logstash
apt-get install logstash
# 修改java 路径
vim /usr/share/logstash/bin/logstash.lib.sh
setup_java() {
# set the path to java into JAVACMD which will be picked up by JRuby to launch itself
#add java home
JAVA_HOME=/opt/jdk
#
############################################
systemctl start logstash.service
systemctl status logstash.service
systemctl enable logstash
# install elasticsearch
apt-get install elasticsearch
# 单机部署需要修改配置文件
vim /etc/elasticsearch/elasticsearch.yml
# 监听任意主机的连接
network.host: 0.0.0.0
# 设置主机初始节点
cluster.initial_master_nodes: ["node-1"]
# 启动
systemctl start elasticsearch
systemctl status elasticsearch
systemctl enable elasticsearch