elk日志收集展示-创新互联-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
elk日志收集展示-创新互联

【elasticsearch7.6安装】
系统准备:
操作系统:centos 7 x64
JAVA软件版本:java8(官方文档)
Elasticsearch版本:6.6.2

创新互联专注骨干网络服务器租用10年,服务更有保障!服务器租用,绵阳电信机房 成都服务器租用,成都服务器托管,骨干网络带宽,享受低延迟,高速访问。灵活、实现低成本的共享或公网数据中心高速带宽的专属高性能服务器。

安装JDK并设置环境变量:
rpm -ivh jdk-8u192-linux-x64.rpm

vi /etc/profile
export JAVA_HOME=/usr/java/latest

vi .bash_profile
export PATH=$JAVA_HOME/bin:$PATH

查看java版本:
java -version

安装elasticsearch:
tar zxvf elasticsearch-6.6.2.tar.gz
修改配置文件:
config\elasticsearch.yml
cluster.name 集群名称
node.name 节点名称
path.data
path.logs
network.host 0:0:0:0 所有外网IP可访问
http.port http请求端口号,默认为9200
修改配置文件
config\jvm.options
-Xms1g
-Xmx1g

启动elasticsearch
bin\elasticsearch
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
elasticsearch不允许使用root用户启动。

useradd elk

chown -R elk:elk elasticsearch-6.6.2
chown -R elk:elk elk
./elasticsearch

vi /etc/security/limits.conf

  • soft nofile 65536
  • hard nofile 65536
    vi /etc/sysctl.conf
    vm.max_map_count=262144

访问elasticsearch
http://192.168.1.129:9200
新建启动脚本
vi startup.sh
nohup /usr/local/elasticsearch-6.6.2/bin/elasticsearch >> /usr/local/elasticsearch-6.6.2/output.log 2>&1 &
chmod a+x startup.sh
关闭elasticsearch:
jps
kill -9 进程号

【安装kibana】
tar zxvf kibana-6.6.2-linux-x86_64.tar.gz
Kibana是一个开源的分析与可视化平台,设计出来用于和Elasticsearch一起使用的。
你可以用kibana搜索、查看、交互存放在Elasticsearch索引里的数据,
使用各种不同的图表、表格、地图等kibana能够很轻易地展示高级数据分析与可视化。

配置文件config\bibana.yml
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]

访问:
http://127.0.0.1:5601

vi startup.sh
nohup /usr/local/kibana-6.6.2-linux-x86_64/bin/kibana >> /usr/local/kibana-6.6.2-linux-x86_64/output.log 2>&1 &

【kibana面板使用】
GET /kibana_sample_data_logs/_settings

【logstash安装及配置】
tar logstash-6.6.2.tar.gz

使用logstash收集nginx日志并在kibana展示,修改配置文件config\logstash.conf
input {
file {
path => "/usr/local/nginx/logs/access.log"
type => "nginxaccess"
start_position => "beginning"
}
}

filter {
grok {
match => { "message" => "%{HTTPD_COMBINEDLOG}" }
}
}

output {
#输出到elasticsearch:
elasticsearch {
hosts => ["127.0.0.1:9200"]
index => "nginx-%{+YYYY.MM.dd}"
}
}
启动脚本:
startup.sh
#!/bin/bash
nohup /usr/local/logstash-6.6.2/bin/logstash -f /usr/local/logstash-6.6.2/config/logstash.conf >> /usr/local/logstash-6.6.2/output.log 2>&1 &

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享标题:elk日志收集展示-创新互联
网站路径:http://scgulin.cn/article/giose.html