ÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀí
ÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀí
ÔÚÏÖ´úµÄÅÌËãÇéÐÎÖУ¬ÈÕÖ¾ÖÎÀíÊǺÜÊÇÖ÷ÒªµÄ¡£Í¨¹ýÓÐÓõØÍøÂçºÍÆÊÎöÈÕÖ¾£¬ÎÒÃÇ¿ÉÒÔÏàʶϵͳµÄÔËÐÐ״̬£¬ÊµÊ±·¢Ã÷Ï¢Õù¾öÎÊÌ⣬Ìá¸ßϵͳµÄ¿ÉÓÃÐÔºÍÇå¾²ÐÔ¡£ÔÚLinuxϵͳÉÏ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀíÀ´È·±£ÈÕÖ¾µÄ³¤ÆÚÐÔ¡¢¿É¿¿ÐԺͿɻá¼ûÐÔ¡£±¾ÎĽ«ÏêϸÏÈÈÝÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀí£¬²¢Ìṩ´úÂëʾÀý¡£
Ò»¡¢×°ÖúÍÉèÖÃÈÕÖ¾ÊÕÂÞÊðÀí
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚÿ̨ÐèÒªÊÕÂÞÈÕÖ¾µÄЧÀÍÆ÷ÉÏ×°ÖúÍÉèÖÃÈÕÖ¾ÊÕÂÞÊðÀí¡£³£ÓõÄÈÕÖ¾ÊÕÂÞÊðÀíÓÐLogstash¡¢FluentdºÍFilebeatµÈ¡£
ÒÔ×°ÖúÍÉèÖÃLogstashΪÀý£¬ÎÒÃÇ¿ÉÒÔƾ֤ÒÔÏ°취À´¾ÙÐвÙ×÷£º
ÏÂÔغÍ×°ÖÃLogstash
curl -L -O https://artifacts.elastic.co/downloads/logstash/logstash-7.10.0.tar.gz tar -xzf logstash-7.10.0.tar.gz
µÇ¼ºó¸´ÖÆ
½¨ÉèLogstashÉèÖÃÎļþ
ÔÚLogstashµÄ×°ÖÃĿ¼Öн¨ÉèÒ»¸öÃûΪlogstash.confµÄÉèÖÃÎļþ£¬ÄÚÈÝÈçÏ£º
input { beats { port => 5044 } } output { elasticsearch { hosts => ["localhost:9200"] } }
µÇ¼ºó¸´ÖÆ
Æô¶¯Logstash
./logstash-7.10.0/bin/logstash -f logstash.conf
µÇ¼ºó¸´ÖÆ
¶þ¡¢ÉèÖÃÈÕÖ¾´æ´¢¼¯Èº
½ÓÏÂÀ´£¬ÎÒÃÇÐèÒªÉèÖÃÒ»¸ö¸ß¿ÉÓõÄÈÕÖ¾´æ´¢¼¯Èº£¬ÒÔÈ·±£ÈÕÖ¾µÄ³¤ÆÚÐԺͿɿ¿ÐÔ¡£³£ÓõÄÈÕÖ¾´æ´¢¼¯ÈºÓÐElasticsearchºÍSplunkµÈ¡£
ÒÔÉèÖÃElasticsearchΪÀý£¬ÎÒÃÇ¿ÉÒÔƾ֤ÒÔÏ°취À´¾ÙÐвÙ×÷£º
ÏÂÔغÍ×°ÖÃElasticsearch
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0.tar.gz tar -xzf elasticsearch-7.10.0.tar.gz
µÇ¼ºó¸´ÖÆ
ÐÞ¸ÄElasticsearchÉèÖÃÎļþ
ÔÚElasticsearchµÄ×°ÖÃĿ¼ÖеÄconfigĿ¼Ï£¬±à¼elasticsearch.ymlÎļþ£¬ÐÞ¸ÄÒÔÏÂÉèÖãº
cluster.name: my-cluster node.name: my-node network.host: 0.0.0.0
µÇ¼ºó¸´ÖÆ
Æô¶¯Elasticsearch
./elasticsearch-7.10.0/bin/elasticsearch
µÇ¼ºó¸´ÖÆ
Èý¡¢ÉèÖÃÈÕÖ¾ÍøÂçºÍÆÊÎöƽ̨
×îºó£¬ÎÒÃÇÐèÒªÉèÖÃÒ»¸öÈÕÖ¾ÍøÂçºÍÆÊÎöƽ̨£¬ÒÔ±ãÎÒÃÇ¿ÉÒÔÀû±ãµØÅÌÎʺÍÆÊÎöÈÕÖ¾¡£³£ÓõÄÈÕÖ¾ÍøÂçºÍÆÊÎöƽ̨ÓÐKibanaºÍSplunkµÈ¡£
ÒÔÉèÖÃKibanaΪÀý£¬ÎÒÃÇ¿ÉÒÔƾ֤ÒÔÏ°취À´¾ÙÐвÙ×÷£º
ÏÂÔغÍ×°ÖÃKibana
curl -L -O https://artifacts.elastic.co/downloads/kibana/kibana-7.10.0-linux-x86_64.tar.gz tar -xzf kibana-7.10.0-linux-x86_64.tar.gz
µÇ¼ºó¸´ÖÆ
ÐÞ¸ÄKibanaÉèÖÃÎļþ
ÔÚKibanaµÄ×°ÖÃĿ¼ÖеÄconfigĿ¼Ï£¬±à¼kibana.ymlÎļþ£¬ÐÞ¸ÄÒÔÏÂÉèÖãº
server.host: "0.0.0.0" elasticsearch.hosts: ["http://localhost:9200"]
µÇ¼ºó¸´ÖÆ
Æô¶¯Kibana
./kibana-7.10.0-linux-x86_64/bin/kibana
µÇ¼ºó¸´ÖÆ
ͨ¹ýÒÔÉÏÉèÖã¬ÎÒÃǾͿÉÒÔÔÚLinuxÉÏʵÏָ߿ÉÓõÄÈÕÖ¾ÖÎÀíÁË¡£LogstashÈÏÕæÊÕÂÞÈÕÖ¾²¢·¢Ë͵½Elasticsearch£¬ElasticsearchÈÏÕæ´æ´¢ÈÕÖ¾£¬²¢ÌṩÅÌÎʺÍÆÊÎö¹¦Ð§£¬KibanaÔòÌṩÁËÒ»¸öÓû§ÓѺõÄWeb½çÃ棬Àû±ãÎÒÃǾÙÐÐÈÕÖ¾µÄÅÌÎʺÍÆÊÎö¡£
×ܽ᣺
ͨ¹ý±¾ÎĵÄÏÈÈݺÍʾÀý£¬ÎÒÃÇÏàʶÁËÔõÑùÔÚlinuxÉÏÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀí¡£Õâ¹ØÓÚ°ü¹ÜϵͳµÄÎȹÌÐÔºÍÇå¾²ÐÔºÜÊÇÖ÷Òª¡£Ï£Íû±¾ÎĶÔÄúÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇÔõÑùÔÚLinuxÉÏÉèÖø߿ÉÓõÄÈÕÖ¾ÖÎÀíµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡