centos6 - elk基础入门搭建

前端之家收集整理的这篇文章主要介绍了centos6 - elk基础入门搭建前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. [root@host-192-168-53-108~]#rm-rf/etc/yum.repos.d/*
  2. [root@host-192-168-53-108~]#wget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-6.repo
  3. [root@host-192-168-53-108~]#yumcleanall
  4. [root@host-192-168-53-108~]#yum-yinstalljava-1.8.0-openjdk*
  5. [root@host-192-168-53-108~]#wgethttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.rpm
  6. [root@host-192-168-53-108~]#rpm-ivhelasticsearch-5.5.0.rpm
  7. [root@host-192-168-53-108~]#chkconfig--addelasticsearch
  1. [root@host-192-168-53-108~]#cat/etc/hosts
  2. 192.168.53.108elk1
  1. [root@host-192-168-53-108~]#cat/etc/elasticsearch/elasticsearch.yml
  2. node.name:elk1
  3. network.host:192.168.53.108
  4. http.port:9200
  5. bootstrap.memory_lock:false
  6. bootstrap.system_call_filter:false
  7. discovery.zen.ping.unicast.hosts:[elk1]
  8. http.cors.enabled:true
  9. http.cors.allow-origin:"*"
  1. [root@host-192-168-53-108~]#cat/etc/elasticsearch/jvm.options|grep-v'^#'|grep-v^$
  2. #修改
  3. -Xms6g
  4. -Xmx6g
  1. [root@host-192-168-53-108~]#vim/etc/security/limits.conf
  2. *softnofile1000000
  3. *hardnofile1000000
  4. *softnproc1000000
  5. *hardnproc1000000
  1. [root@host-192-168-53-108~]#cat/etc/security/limits.d/90-nproc.conf
  2. *softnproc100000
  3. rootsoftnprocunlimited
  1. [root@host-192-168-53-108~]#cd/usr/local/
  2. [root@host-192-168-53-108local]#gitclonegit://github.com/mobz/elasticsearch-head.git
  3. [root@host-192-168-53-108local]#wgethttps://nodejs.org/dist/v8.2.0/node-v8.2.0-linux-x64.tar.gz--no-check-certificate
  4. [root@host-192-168-53-108local]#tarzxfnode-v8.2.0-linux-x64.tar.gz
  5. [root@host-192-168-53-108local]#ln-s/usr/local/node-v8.2.0-linux-x64/bin/node/usr/sbin/node
  6. [root@host-192-168-53-108local]#ln-s/usr/local/node-v8.2.0-linux-x64/bin/npm/usr/sbin/npm
  1. #设置npm代理镜像
  2. [root@host-192-168-53-108local]#npmconfigsetregistryhttps://registry.npm.taobao.org
  3. [root@host-192-168-53-108local]#npminstall-ggrunt
  4. [root@host-192-168-53-108local]#ln-s/usr/local/node-v8.2.0-linux-x64/lib/node_modules/grunt/bin/grunt/usr/sbin/grunt
  5. [root@host-192-168-53-108local]#cdelasticsearch-head/
  1. [root@host-192-168-53-108elasticsearch-head]#npminstall
  2. Errormakingrequest.
  3. Error:connectETIMEDOUT52.216.1.0:443
  4. atObject.exports._errnoException(util.js:1024:11)
  5. atexports._exceptionWithHostPort(util.js:1047:20)
  6. atTCPConnectWrap.afterConnect[asoncomplete](net.js:1150:14)
  7. Pleasereportthisfulllogathttps://github.com/Medium/phantomjs
  8. npmWARNelasticsearch-head@0.0.0licenseshouldbeavalidSPDXlicenseexpression
  9. npmWARNoptionalSKIPPINGOPTIONALDEPENDENCY:fsevents@1.1.2(node_modules/fsevents):
  10. npmWARNnotsupSKIPPINGOPTIONALDEPENDENCY:Unsupportedplatformforfsevents@1.1.2:wanted{"os":"darwin","arch":"any"}(current:{"os":"linux","arch":"x64"})
  11. npmERR!codeELIFECYCLE
  12. npmERR!errno1
  13. npmERR!phantomjs-prebuilt@2.1.14install:`nodeinstall.js`
  14. npmERR!Exitstatus1
  15. npmERR!
  16. npmERR!Failedatthephantomjs-prebuilt@2.1.14installscript.
  17. npmERR!Thisisprobablynotaproblemwithnpm.Thereislikelyadditionalloggingoutputabove.
  18. npmERR!Acompletelogofthisruncanbefoundin:
  19. npmERR!/root/.npm/_logs/2017-07-26T11_29_47_063Z-debug.log
  1. [root@host-192-168-53-108elasticsearch-head]#npminstallphantomjs-prebuilt@2.1.14--ignore-scripts
  2. [root@host-192-168-53-108elasticsearch-head]#npminstall
  1. [root@host-192-168-53-108elasticsearch-head]#vim/usr/local/elasticsearch-head/_site/app.js
  2. #把localhost改为ip
  3. this.base_uri=this.config.base_uri||this.prefs.get("app-base_uri")||"http://localhost:9200";
  4. this.base_uri=this.config.base_uri||this.prefs.get("app-base_uri")||"http://192.168.53.108:9200";
  1. [root@host-192-168-53-108elasticsearch-head]#vim/usr/local/elasticsearch-head/Gruntfile.js
  2. connect:{
  3. server:{
  4. options:{
  5. hostname:"0.0.0.0",#添加此行
  6. port:9100,base:'.',keepalive:true
  7. }
  8. }
  9. }
  1. [root@host-192-168-53-108elasticsearch-head]#gruntserver&
  2. [root@host-192-168-53-108elasticsearch-head]#echo"cd/usr/local/elasticsearch-head;gruntserver&">>/etc/rc.local
  3. [root@host-192-168-53-108elasticsearch-head]#cd
  4. [root@host-192-168-53-108~]#wgethttps://artifacts.elastic.co/downloads/logstash/logstash-5.5.0.rpm
  1. [root@host-192-168-53-108~]#vim/etc/logstash/conf.d/system.conf
  2. input{
  3. file{
  4. path=>"/var/log/messages"
  5. type=>"systemlog"
  6. start_position=>"beginning"
  7. stat_interval=>"2"
  8. }
  9. }
  10. output{
  11. elasticsearch{
  12. hosts=>["192.168.53.108:9200"]
  13. index=>"logstash-systemlog-%{+YYYY.MM.dd}"
  14. }
  15. }
  1. [root@host-192-168-53-108~]#/usr/share/logstash/bin/logstash-f/etc/logstash/conf.d/system.conf
  1. #在Elasticsearch中查看
  2. #浏览器访问http://192.168.53.108:9100/选择基本查询搜素
  1. [root@host-192-168-53-108~]#wgethttps://artifacts.elastic.co/downloads/kibana/kibana-5.5.0-x86_64.rpm
  2. [root@host-192-168-53-108~]#rpm-ivhkibana-5.5.0-x86_64.rpm
  1. [root@host-192-168-53-108~]#cat/etc/kibana/kibana.yml|grep-v'^#'|grep-v^$
  2. server.port:5601
  3. server.host:"0.0.0.0"
  4. elasticsearch.url:"http://elk1:9200"
  1. [root@host-192-168-53-108~]#/etc/init.d/kibanastart
  2. [root@host-192-168-53-108~]#chkconfig--addkibana

猜你在找的CentOS相关文章