环境准备
修改主机名
[root@localhost ~]# hostnamectl set-hostname vbcHost01
查看三个主机名:静态、瞬态和灵活主机名
[root@localhost ~]# hostnamectl --pretty
[root@localhost ~]# hostnamectl --static
[root@localhost ~]# hostnamectl --transient
主机名和IP映射
[root@localhost ~]# vi /etc/hosts
yum安装jdk
执行命令yum -y list java*查看可安装java版本
执行命令yum install -y java-11-openjdk-devel.i686
查看已安装: /usr/lib/jvm/
Linux创建用户
adduser elasticsearch
passwd elasticsearch
chown -R elasticsearch:elasticsearch /etc/staller/elasticsearch-7.13.0
chmod -R 750 /etc/staller/elasticsearch-7.13.0
su - elasticsearch
下载安装elasticsearch
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
启动ES
-
root用户修改elasticsearch-7.13.0/config/elasticsearch.yml文件,
添加
bootstrap.system_call_filter: false
bootstrap.memory_lock: true
network.bind_host: 0.0.0.0
network.host: localhost
cluster.name: elasticsearch_cluster_name
node.name: vbcHost01
cluster.initial_master_nodes: [“vbcHost01”]
注意冒号后面有空格 -
root用户设置系统资源
vi /etc/security/limits.conf
添加
elasticsearch soft nproc 65535
elasticsearch soft nofile 65536
elasticsearch hard nofile 65536
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited -
root用户设置虚拟内存
vi /etc/sysctl.conf
添加
vm.max_map_count=262144
然后执行: sysctl -p -
elasticsearch用户进入elasticsearch-7.13.0/bin ,执行elasticsearch脚本
9300 端口为 Elasticsearch 集群间组件的通信端口
9200 端口为浏览器访问的 http协议 RESTful 端口
Logstash
日志采集、过滤、分析工具
安装LogStash
配置
启动
[root@vbchost01 logstash-7.13.3]#
bin/logstash -f config/kibana.conf --config.test_and_exit
Kibana
一个开源的分析和可视化平台,可视化查询日志
下载Kinaban
安装shasum: yum install -y perl-Digest-SHA
安装Kibana
修改配置文件
kibana-7.13.3-linux-x86_64/config/kinaba.yml
修改1.
Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601
修改2. 本机服务器地址或者集群地址
#Specifies the address to which the Kibana server will bind. IP addresses and host names are both valid values.
#The default is ‘localhost’, which usually means remote machines will not be able to connect.
#To allow connections from remote users, set this parameter to a non-loopback address.
server.host: “192.168.10.133”
修改3. 本机服务器地址或者集群地址
#The URLs of the Elasticsearch instances to use for all your queries.
#elasticsearch.hosts: [“http://192.168.10.133:9200”]
启动
启动脚本: kibana-7.13.3-linux-x86_64/bin/kibana
安装成功
http://192.168.10.133:5601
Stack Management > Index patterns > Create index pattern
Analytics > Discover