8.1.0版本ELK搭建,不开启xpack认证机制

部署环境安排

ip部署服务
192.168.0.121kibana,elasticsearch
192.168.0.83elasticsearch,logstash
192.168.0.84elasticsearch,logstash,httpd,filebeat

下载安装包

下载elasticsearch-8-1-0
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
https://www.elastic.co/cn/downloads/past-releases/elasticsearch-8-1-0
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.0-linux-x86_64.tar.gz

下载kibana-8-1-0
https://www.elastic.co/downloads/past-releases#kibana
https://www.elastic.co/cn/downloads/past-releases/kibana-8-1-0
https://artifacts.elastic.co/downloads/kibana/kibana-8.1.0-linux-x86_64.tar.gz

下载logstash-8-1-0
https://www.elastic.co/downloads/past-releases#logstash
https://www.elastic.co/cn/downloads/past-releases/logstash-8-1-0
https://artifacts.elastic.co/downloads/logstash/logstash-8.1.0-linux-x86_64.tar.gz

下载
https://www.elastic.co/downloads/past-releases#filebeat
https://www.elastic.co/cn/downloads/past-releases/filebeat-8-1-0
https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.1.0-linux-x86_64.tar.gz

服务器环境配置

操作所有服务器

jdk

8.1.0版本自带jdk

关闭交换空间

swapoff -a
vim /etc/fstab #注释swap行

创建运行elasticsearch的用户elastic

useradd elastic

设置elastic用户的文件最大打开数量和最大线程使用数量

ulimit -n 65535
ulimit -u 4096
vim /etc/security/limits.conf
elastic -  nofile  65535
elastic -  nproc 4096

设置虚拟内存

sysctl -w vm.max_map_count=262144
vim /etc/sysctl.conf
vm.max_map_count=262144

创建数据目录

mkdir -p /data/elastic/data
mkdir -p /data/elastic/logs
chown -R elastic:elastic /data/elastic

mkdir -p /data/kibana/data
mkdir -p /data/kibana/logs

mkdir -p /data/logstash/data
mkdir -p /data/logstash/logs

mkdir -p /data/filebeat/data
mkdir -p /data/filebeat/logs

部署elasticsearch

操作所有服务器

tar xf elasticsearch-8.1.0-linux-x86_64.tar.gz -C /data
cd elasticsearch-8.1.0
chown -R elastic:elastic /data/elasticsearch-8.1.0
cd config
#修改jvm参数
vim jvm.options
-Xms2g
-Xmx2g

操作192.168.0.121

#192.168.0.121
vim elasticsearch.yml

cluster.name: my-application
node.name: node-1
path.data: /data/elastic/data
path.logs: /data/elastic/log
network.host: 192.168.0.121
http.port: 9200
discovery.seed_hosts: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]
cluster.initial_master_nodes: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]

#false 表示不开启xpack认证机制
xpack.security.enabled: false

#false 表示不开启xpack认证机制
xpack.security.enrollment.enabled: false

#上方false 下方的配置不生效
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12

操作192.168.0.83

#192.168.0.83
vim elasticsearch.yml
cluster.name: my-application
node.name: node-2
path.data: /data/elastic/data
path.logs: /data/elastic/log
network.host: 192.168.0.83
http.port: 9200
discovery.seed_hosts: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]
cluster.initial_master_nodes: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]


xpack.security.enabled: false

xpack.security.enrollment.enabled: false

操作192.168.0.84

#192.168.0.84
vim elasticsearch.yml
cluster.name: my-application
node.name: node-3
path.data: /data/elastic/data
path.logs: /data/elastic/log
network.host: 192.168.0.84
http.port: 9200
discovery.seed_hosts: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]
cluster.initial_master_nodes: ["192.168.0.121", "192.168.0.83", "192.168.0.84"]


xpack.security.enabled: false

xpack.security.enrollment.enabled: false

操作所有服务器

cd ..
#配置启动文件
echo "nohup bin/elasticsearch > /data/elastic/log/elastic.log &" > start.sh
chmod a+x start.sh
#依次启动elasticsearch
./start.sh
tail -200f /data/elastic/log/elastic.log
#查看验证
curl 192.168.0.121:9200
{
  "name" : "node-1",
  "cluster_name" : "my-application",
  "cluster_uuid" : "wnh3f7iARXuJvA0UbFPlwg",
  "version" : {
    "number" : "8.1.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "3700f7679f7d95e36da0b43762189bab189bc53a",
    "build_date" : "2022-03-03T14:20:00.690422633Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

curl 192.168.0.83:9200
{
  "name" : "node-2",
  "cluster_name" : "my-application",
  "cluster_uuid" : "wnh3f7iARXuJvA0UbFPlwg",
  "version" : {
    "number" : "8.1.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "3700f7679f7d95e36da0b43762189bab189bc53a",
    "build_date" : "2022-03-03T14:20:00.690422633Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

curl 192.168.0.84:9200
{
  "name" : "node-3",
  "cluster_name" : "my-application",
  "cluster_uuid" : "wnh3f7iARXuJvA0UbFPlwg",
  "version" : {
    "number" : "8.1.0",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "3700f7679f7d95e36da0b43762189bab189bc53a",
    "build_date" : "2022-03-03T14:20:00.690422633Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

curl 192.168.0.121:9200/_cat/nodes?v
ip            heap.percent ram.percent cpu load_1m load_5m load_15m node.role   master name
192.168.0.121           10          38   4    0.05    0.06     0.04 cdfhilmrstw -      node-1
192.168.0.84             7          78   4    0.12    0.10     0.05 cdfhilmrstw -      node-3
192.168.0.83            11          78   6    0.12    0.10     0.05 cdfhilmrstw *      node-2

部署kibana

操作服务器192.168.0.121

tar xf kibana-8.1.0-linux-x86_64.tar.gz -C /data
cd kibana-8.1.0/config
vim kibana.yml
server.port: 5601
server.host: "192.168.0.121"
elasticsearch.hosts: ["http://192.168.0.121:9200", "http://192.168.0.83:9200", "http://192.168.0.84:9200"]
path.data: /data/kibana/data
cd ..
echo "nohup bin/kibana --allow-root > /data/kibana/log/kibana.log &
" > start.sh
chmod a+x start.sh
./start.sh
tail -200f /data/kibana/log/kibana.log
#打开页面

部署logstash

操作服务器192.168.0.83 192.168.0.84

tar xf  logstash-8.1.0-linux-x86_64.tar.gz -C /data
cd logstash-8.1.0/config
cp logstash-sample.conf logstash.conf
vim logstash.conf
input {
  beats {
    port => 5044
  }
}

output {
  elasticsearch {
    hosts => ["http://192.168.0.121:9200", "http://192.168.0.83:9200", "http://192.168.0.83:9200"]
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
    #user => "elastic"
    #password => "changeme"
  }
}
cd ..
echo "nohup bin/logstash -f config/logstash.conf  > /data/logstash/log/logstash.log &" > start.sh
chmod a+x start.sh
./start.sh
tail -200f /data/logstash/log/logstash.log

部署httpd,filebeat

操作服务器192.168.0.84

yum -y install httpd
systemctl start httpd.service
systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2023-05-19 09:37:00 CST; 17s ago

ll /var/log/httpd/
total 4
-rw-r--r-- 1 root root   0 May 19 09:37 access_log
-rw-r--r-- 1 root root 679 May 19 09:37 error_log
tar xf filebeat-8.1.0-linux-x86_64.tar.gz -C /data
cd filebeat-8.1.0
vim filebeat.yml
egrep -v "^\s*$|^\s*#" filebeat.yml
filebeat.inputs:
- type: filestream
  enabled: true
  paths:
    - /var/log/httpd/*_log
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 3
setup.kibana:
output.logstash:
  hosts: ["192.168.0.83:5044", "192.168.0.84:5044"]
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~
logging.level: info
echo "nohup ./filebeat -e -c filebeat.yml > /data/filebeat/log/filebeat.log &
" > start.sh
chmod a+x start.sh
./start.sh
tail -200f /data/filebeat/log/filebeat.log 

访问http服务
curl 192.168.0.84
kibana可以看到filebeat的索引
在这里插入图片描述

配置kibana页面

选择kibana下方的创建视图Data Views
在这里插入图片描述
创建视图,输入filebeat的索引名称,选择时间戳@timestamp

在这里插入图片描述
发现discover可以看到新添加的视图
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL 8.1.0 是一个不存在的版本号,MySQL 8.1 还未正式发布。可用的最新版本是 MySQL 8.0.x。以下是 MySQL 8.0.x 的安装教程: 1. 访问 MySQL 官方网站:https://dev.mysql.com/downloads/mysql/,找到适合您操作系统的版本并下载。 2. 下载完成后,运行安装程序。根据操作系统类型,您可能需要以管理员身份运行安装程序。 3. 在安装向导中,选择 "Custom"(自定义)安装类型,以便您可以选择安装组件和设置。 4. 选择要安装的组件。通常情况下,您至少需要选择 "MySQL Server"(MySQL 服务器)和 "MySQL Workbench"(MySQL 工作台)。根据需求,您还可以选择其他组件。 5. 在安装选项中,选择适当的配置类型。如果您是首次安装 MySQL,建议选择 "Server Only"(仅服务器)配置类型。 6. 设置密码。输入 root 用户的密码,并确认密码。请记住这个密码,因为以后您需要使用它来访问 MySQL 数据库。 7. 完成安装向导,并等待安装过程完成。 8. 安装完成后,您可以启动 MySQL 服务器。您可以在 Windows 系统中使用服务管理器启动,或者在 Linux/Mac 上使用命令行启动。 9. 您可以使用 MySQL Workbench 连接到 MySQL 服务器,并开始管理数据库和执行查询。 这就是 MySQL 8.0.x 的基本安装教程。请注意,具体步骤可能会因操作系统和版本的不同而有所变化,因此请根据官方文档进行操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值