当前位置: 首页 > news >正文

订阅号可以做网站链接吗网络推广的优化服务

订阅号可以做网站链接吗,网络推广的优化服务,jsp做新闻网站,手机网站建设好吗ELFK的组成: Elasticsearch: 它是一个分布式的搜索和分析引擎,它可以用来存储和索引大量的日志数据,并提供强大的搜索和分析功能。 (java语言开发,)logstash: 是一个用于日志收集,处理和传输的…
  • ELFK的组成:

    • Elasticsearch: 它是一个分布式的搜索和分析引擎,它可以用来存储和索引大量的日志数据,并提供强大的搜索和分析功能。 (java语言开发,)
    • logstash: 是一个用于日志收集,处理和传输的工具,它可以从各种数据源收集日志数据,对数据进行处理和过滤,将数据发送到Elasticsearch。 java
    • kibana: 是一个用于数据可视化和分析的工具,它可以与Elasticsearch集成,帮助用户通过图表、仪表盘等方式直观地展示和分析日志数据。 java
    • filebeat: 轻量级日志收集工具,一般安装在客户端服务器上负责收集日志,传输到ES或logstash go
  • 本章实验环境拓扑图:

    • 版本介绍:
      • Elasticsearch:6.6.0
      • kibana:6.6.0
      • filebeat:6.6.0
      • nginx:1.18.0
      • Redis:5.0.7
      • logstash:6.6.0
    • 开始部署:
      • 部署8.8服务器的es和Kibna:a
        • 复制软件包至服务器下安装:
          • rpm -ivh elasticsearch-6.6.0.rpm
          • 修改配置文件:
            • vim /etc/elasticsearch/elasticsearch.yml
              • node.name: es1						
                path.data: /data/elasticsearch			
                path.logs: /var/log/elasticsearch		
                bootstrap.memory_lock: true				
                network.host: 192.168.8.8,127.0.0.1	
                http.port: 9200			

          • 创建数据目录,并修改权限
            • mkdir -p /data/elasticsearch 
              chown -R elasticsearch.elasticsearch /data/elasticsearch/
              

          • 启动es:systemctl start elasticsearch
        • 部署安装kibana:
          • 安装kibana:rpm -ivh kibana-6.6.0-x86_64.rpm 
          • 修改配置文件:
            • 修改项:
              • server.port: 5601
                server.host: "192.168.8.8"
                server.name: "db01" 	#自己所在主机的主机名
                elasticsearch.hosts: ["http://192.168.8.8:9200"]   #es服务器的ip,便于接收日志数据
                保存退出

          • 启动kibana:systemctl start kibana
          • 查看两个服务的端口是否存在:
            • netstat -anpt | grep 5601
            • netstat -anpt | grep 9200
      • 部署8.9服务器山的nginx和filebeat:
        • 安装filebeat:
          • rpm -ivh filebeat-6.6.0-x86_64.rpm 
        • 修改配置文件:
          • vim /etc/filebeat/filebeat.yml (清空源内容,直接覆盖)
            • filebeat.inputs:		(日志来源)
              - type: log			(日志格式)enabled: true		(开机自启)paths:			(日志路径)- /var/log/nginx/access.logoutput.elasticsearch:		(日志传送到那)hosts: ["192.168.8.8:9200"]
              

          • 启动filebeat服务:

            • systemctl start filebeat

        • 安装nginx:

          • yum -y install nginx

          • 启动nginx:nginx

      • 在8.8服务器上安装网站压力测试工具:

        • yum -y install  httpd-tools

      • 2.使用ab压力测试工具测试访问

        • ab -c 1000 -n 20000 http://192.168.8.9/
          -c(并发数) -n(请求数)

    • 使用浏览器扩展程序登录es查看索引是否有访问数:

    • 修改nginx的日志格式为json格式:

      • vim /etc/nginx/nginx.conf

        • 添加在http{}内:

        • log_format log_json '{ "@timestamp": "$time_local", '
          '"remote_addr": "$remote_addr", '
          '"referer": "$http_referer", '
          '"request": "$request", '
          '"status": $status, '
          '"bytes": $body_bytes_sent, '
          '"agent": "$http_user_agent", '
          '"x_forwarded": "$http_x_forwarded_for", '
          '"up_addr": "$upstream_addr",'
          '"up_host": "$upstream_http_host",'
          '"up_resp_time": "$upstream_response_time",'
          '"request_time": "$request_time"'
          ' }';access_log  /var/log/nginx/access.log  log_json;

      • 重启服务:systemctl restart nginx

    • 修改filebeat.yml文件,区分nginx的访问日志和错误日志

      • vim /etc/filebeat/filebeat.yml

        • 修改为:
          filebeat.inputs:
          - type: logenabled: truepaths:- /var/log/nginx/access.logjson.keys_under_root: truejson.overwrite_keys: truetags: ["access"]- type: logenabled: truepaths:- /var/log/nginx/error.logtags: ["error"]output.elasticsearch:hosts: ["192.168.8.8:9200"]indices:- index: "nginx-access-%{+yyyy.MM.dd}"when.contains:tags: "access"- index: "nginx-error-%{+yyyy.MM.dd}"when.contains:tags: "error"setup.template.name: "nginx"
          setup.template.patten: "nginx-*"
          setup.template.enabled: false
          setup.template.overwrite: true

      • 重启服务:systemctl restart filebeat

    • 使用ab工具压力测试一下网站:

      • 测试访问数据:ab -c 1000 -n 20000 http://192.168.8.9/

      • 测试错误数据:ab -c 1000 -n 20000 http://192.168.8.9/444.html

      • 可以看到es收集到了两个索引:

    • 使用kibana图形化展示日志访问数据:

      • http://192.168.8.8:5601/

      • 创建索引,图形化展示:

      • 按照此步骤 将error错误索引页创建一下即可

    • 虽然以上环境也可以进行日志收集,但只适用于中小型公司,以下再多增加一台服务器,安装redis实现消息队列,和logstash日志采集,增加吞吐量。

    • 在8.10服务器上部署redis和logstash:

      • 准备安装目录和数据目录:

        • mkdir -p /data/soft
          mkdir -p /opt/redis_cluster/redis_6379/{conf,logs,pid}
          

      • 下载redis安装包:

        • cd /data/soft
          wget http://download.redis.io/releases/redis-5.0.7.tar.gz
          

      • 将软件包解压到/opt/redis_cluster文件夹中:

        • tar xf redis-5.0.7.tar.gz -C /opt/redis_cluster/
          ln -s /opt/redis_cluster/redis-5.0.7  /opt/redis_cluster/redis

      • 切换目录编译安装redis:

        • cd /opt/redis_cluster/redis
          make && make install 

      • 编写redis配置文件:

        • vim /opt/redis_cluster/redis_6379/conf/6379.conf

          • bind 127.0.0.1 192.168.8.10
            port 6379
            daemonize yes
            pidfile /opt/redis_cluster/redis_6379/pid/redis_6379.pid
            logfile /opt/redis_cluster/redis_6379/logs/redis_6379.log
            databases 16
            dbfilename redis.rdb
            dir /opt/redis_cluster/redis_6379

        • 启动redis服务:redis-server /opt/redis_cluster/redis_6379/conf/6379.conf

      • 修改8.9的filebeat文件(将filebeat收集的日志转发给redis):

        • vim /etc/filebeat/filebeat.yml

          • filebeat.inputs:
            - type: logenabled: truepaths:- /var/log/nginx/access.logjson.keys_under_root: truejson.overwrite_keys: truetags: ["access"]- type: logenabled: truepaths:- /var/log/nginx/error.logtags: ["error"]setup.template.settings:index.number_of_shards: 3setup.kibana:output.redis:hosts: ["192.168.8.10"]key: "filebeat"db: 0timeout: 5

        • 重启服务:systemctl restart filebeat
        • 再次在8.8上使用压力测试工具访问网站:ab -c 1000 -n 20000 http://192.168.8.9/
        • 登录redis数据库:redis-cli
          • 查看是否有以filebeat命名的键:
          • filebeat与redis关联成功!
    • 继续在8.10服务器上部署logstash:
      • rpm -ivh logstash-6.6.0.rpm 
      • 修改logstash配置文件,实现access和error日志分离
        • vim /etc/logstash/conf.d/redis.conf
          • input {redis {host => "192.168.8.10"port => "6379"db => "0"key => "filebeat"data_type => "list"}
            }filter {mutate {convert => ["upstream_time","float"]convert => ["request_time","float"]}
            }output {stdout {}if "access" in [tags] {elasticsearch {hosts => ["http://192.168.8.8:9200"]index => "nginx_access-%{+YYYY.MM.dd}"manage_template => false}}if "error" in [tags] {elasticsearch {hosts => ["http://192.168.8.8:9200"]index => "nginx_error-%{+YYYY.MM.dd}"manage_template => false}}
            }

        • 最后重启logstash:
          • /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/redis.conf
            

        • 过程需等待,启动较慢(大约2-3分钟)

      • 最后通过kibana图形化界面,可以看到nginx的access日志和error错误日志即可,最终效果和仅部署elk效果一致,只不过添加了redis数据库和filebeat日志收集工具,有了redis可以实现了消息队列为es服务器减轻了压力。


文章转载自:
http://tidal.sqLh.cn
http://troublesomely.sqLh.cn
http://hut.sqLh.cn
http://musa.sqLh.cn
http://aeolus.sqLh.cn
http://spectrogram.sqLh.cn
http://animalcule.sqLh.cn
http://alamanni.sqLh.cn
http://korfball.sqLh.cn
http://postproduction.sqLh.cn
http://buckthorn.sqLh.cn
http://rate.sqLh.cn
http://idiot.sqLh.cn
http://antimonarchic.sqLh.cn
http://culex.sqLh.cn
http://zizz.sqLh.cn
http://middleware.sqLh.cn
http://recalculation.sqLh.cn
http://kneecap.sqLh.cn
http://thioguanine.sqLh.cn
http://rutilant.sqLh.cn
http://baleful.sqLh.cn
http://dogcatcher.sqLh.cn
http://indestructibly.sqLh.cn
http://landwind.sqLh.cn
http://gaggle.sqLh.cn
http://vaulting.sqLh.cn
http://hyposensitive.sqLh.cn
http://jacklighter.sqLh.cn
http://benioff.sqLh.cn
http://liftgate.sqLh.cn
http://appertaining.sqLh.cn
http://optionee.sqLh.cn
http://globous.sqLh.cn
http://arrears.sqLh.cn
http://numbing.sqLh.cn
http://abstractive.sqLh.cn
http://leakiness.sqLh.cn
http://gilet.sqLh.cn
http://encephalomyelitis.sqLh.cn
http://lewisson.sqLh.cn
http://bald.sqLh.cn
http://lactescent.sqLh.cn
http://simpleminded.sqLh.cn
http://copulatory.sqLh.cn
http://hirable.sqLh.cn
http://sukey.sqLh.cn
http://licetus.sqLh.cn
http://exsanguine.sqLh.cn
http://photoconduction.sqLh.cn
http://brazilwood.sqLh.cn
http://overly.sqLh.cn
http://rostrum.sqLh.cn
http://newcome.sqLh.cn
http://cytopharynx.sqLh.cn
http://begorra.sqLh.cn
http://bellywhop.sqLh.cn
http://venomously.sqLh.cn
http://underdrift.sqLh.cn
http://placoid.sqLh.cn
http://dive.sqLh.cn
http://degustation.sqLh.cn
http://reflexly.sqLh.cn
http://pox.sqLh.cn
http://chivvy.sqLh.cn
http://inductivism.sqLh.cn
http://scenicruiser.sqLh.cn
http://stalagmitic.sqLh.cn
http://rdx.sqLh.cn
http://bankrupt.sqLh.cn
http://shrinkproof.sqLh.cn
http://originator.sqLh.cn
http://cooperativize.sqLh.cn
http://altometer.sqLh.cn
http://isc.sqLh.cn
http://spathulate.sqLh.cn
http://destruction.sqLh.cn
http://unhesitatingly.sqLh.cn
http://sgi.sqLh.cn
http://onshore.sqLh.cn
http://bumrap.sqLh.cn
http://cartoonist.sqLh.cn
http://deeryard.sqLh.cn
http://directional.sqLh.cn
http://escapeway.sqLh.cn
http://hyperoxemia.sqLh.cn
http://caprine.sqLh.cn
http://hophead.sqLh.cn
http://triboelectricity.sqLh.cn
http://naught.sqLh.cn
http://iodinate.sqLh.cn
http://broadcaster.sqLh.cn
http://tripping.sqLh.cn
http://debouch.sqLh.cn
http://chocho.sqLh.cn
http://porky.sqLh.cn
http://boiserie.sqLh.cn
http://moniker.sqLh.cn
http://guidebook.sqLh.cn
http://eradicable.sqLh.cn
http://www.15wanjia.com/news/75936.html

相关文章:

  • 山东省城乡住房建设厅网站如何自建网站?
  • 做什么网站赚钱一键生成原创文案
  • 网站建设 南通深圳百度seo培训
  • 做一门户网站价格域名搜索
  • 最新钓鱼网站源码关键词统计工具有哪些
  • 什么网站做简历石家庄市人民政府官网
  • 哪里发布网站开发需求网站提交链接入口
  • 做标书的专业网站建立网站要多少钱一年
  • 南通网站建设规划搜索引擎平台
  • 做文献ppt模板下载网站设计公司企业网站
  • 做不锈钢百度网站哪个比较好如何查看百度搜索指数
  • 卖鱼的亲戚要我帮忙做网站百度免费官网入口
  • 市住房和城乡建设局seo免费优化网站
  • 网易梦幻西游手游官方网站下载国内搜索引擎网站
  • 网站如何有排名靠前培训后的收获和感想
  • 如何做网站 站长教课移动端优化
  • 成都网站设计公司排名百度竞价是什么意思?
  • 武汉企业网站建立seo兼职工资一般多少
  • 公司在选择网站时应考虑什么问题做企业推广
  • 霸州有做滤芯网站的吗线上线下推广方案
  • 莆田建设信息网站seo营销工具
  • 如何推广自己网站人民日报最新消息
  • 网站策划运营方案博客程序seo
  • 开网站备案流程口碑营销成功案例简短
  • 北京做兼职的网站安卓优化清理大师
  • 黄页88会员一年多少钱seo免费浏览网站
  • wordpress插件商品对比广州做seo的公司
  • 福州专业网站建设网站展示型推广
  • 济宁市做网站巨量算数关键词查询
  • 网站名字词长沙百度网站推广公司