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

网站建设进度百度自动优化

网站建设进度,百度自动优化,wordpress安装 var,node怎么做网站文章目录前言一. 实验环境二. 安装node_exporter2.1 node_exporter的介绍2.2 node_exporter的安装三. 在prometheus服务端配置监控远程主机3.1 在server端配置拉取node的信息3.2 重启prometheus3.3 通过浏览器查看prometheus总结前言 大家好,又见面了,我…

文章目录

  • 前言
  • 一. 实验环境
  • 二. 安装node_exporter
    • 2.1 node_exporter的介绍
    • 2.2 node_exporter的安装
  • 三. 在prometheus服务端配置监控远程主机
    • 3.1 在server端配置拉取node的信息
    • 3.2 重启prometheus
    • 3.3 通过浏览器查看prometheus
  • 总结

前言

大家好,又见面了,我是沐风晓月,本文是专栏【云原生实战】专栏的第2篇文章,主要讲解prometheus监控远程主机实战。

专栏地址:【云原生实战】 , 此专栏是沐风晓月对Linux常用命令的汇总,希望能够加深自己的印象,以及帮助到其他的小伙伴😉😉。

如果文章有什么需要改进的地方还请大佬不吝赐教👏👏。

🏠个人主页:我是沐风晓月
🧑个人简介:大家好,我是沐风晓月,双一流院校计算机专业😉😉
💕 座右铭: 先努力成长自己,再帮助更多的人 ,一起加油进步🍺🍺🍺
💕欢迎大家:这里是CSDN,我总结知识的地方,喜欢的话请三连,有问题请私信😘

一. 实验环境

本次的实验环境见下表:

操作系统服务器IPhostname
centos7.6192.168.1.41mufengrow41
centos7.6192.168.1.42mufenggrow42

如何查看相应的参数:

  • 查看操作系统:
[root@mufenggrow ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
  • 查看hostname
## 修改hostname
[root@mufenggrow ~]# hostnamectl set-hostname mufenggrow41
[root@mufenggrow ~]# bash
# 查看hostname
[root@mufenggrow41 ~]# hostname
mufenggrow41
  • 查看ip
[root@mufenggrow41 ~]# ifconfig |grep inet |awk 'NR==1{print $2}'
192.168.1.41

本文中的master服务器,也就是prometheus已经安装好,如果你还未安装,可以参考上一篇文章:prometheus安装及使用入门

二. 安装node_exporter

2.1 node_exporter的介绍

官网给提供了数据采集的组件: node_exporter, prometheus只能拉取数据,而Exporter是Prometheus的指标数据收集组件。

它负责从目标Jobs收集数据,并把收集到的数据转换为Prometheus支持的时序数据格式。

和传统的指标数据收集组件不同的是,它只负责收集数据,并不向Server端发送数据,而是等待Prometheus Server 主动抓取。

node-exporter 默认的抓取url地址:http://ip:9100/metrics

如果想要让node_exporter推送数据,可以借助于工具 pushgetway组件,这个组件可以推送node_exporter的指标数据到你安装好的prometheus服务器上。

node-exporter用于采集node的运行指标,包括node的cpu、load、filesystem、meminfo、network等基础监控指标,类似于zabbix监控系统的的zabbix-agent

2.2 node_exporter的安装

1. 上传node_exporter

在这里插入图片描述

2. 解压并启动

  • 解压node_exporter
[root@mufenggrow42 ~]# tar xf node_exporter-1.5.0.linux-amd64.tar.gz 
#包的名字太长,这里改的短一点
[root@mufenggrow42 ~]# mv node_exporter-1.5.0.linux-amd64 node_exporter
[root@mufenggrow42 ~]# cd node_exporter
[root@mufenggrow42 node_exporter]# 
  • 关于启动exporter的参数

上面我们已经解压了,如果要安装,我们需要使用node_exporter --help来查看完成的参数:

[root@mufenggrow42 node_exporter]# ./node_exporter --help
usage: node_exporter [<flags>]Flags:-h, --help                     Show context-sensitive help (also try --help-long and --help-man).--collector.arp.device-include=COLLECTOR.ARP.DEVICE-INCLUDE  Regexp of arp devices to include (mutually exclusive to device-exclude).--collector.arp.device-exclude=COLLECTOR.ARP.DEVICE-EXCLUDE  Regexp of arp devices to exclude (mutually exclusive to device-include).--collector.bcache.priorityStats  Expose expensive priority stats....(省略)

默认情况下, node_exporter 在端口 9100 上运行,并在路径 /metrics 上暴 露指标,此处也可以修改,比如:

可以通过–web.listen-address 和 --web.telemetry-path 参数来设置端口和路径:

[root@mufenggrow42 node_exporter]# ./node_exporter  --web.listen-address=":9800"

修改端口为9800.

(关于启动时候的一些参数,我们在后面的文章中详细介绍,本文只启动node_exporter,实现监控远程主机即可)

  • 开始启动node_exporter
[root@mufenggrow42 node_exporter]# nohup ./node_exporter &
[1] 19459

启动并设置在后台运行,这里nohup命令,主要用于在系统后台不挂断地运行命令,退出终端不会影响程序的运行。

nohup 命令,在默认情况下(非重定向时),会输出一个名叫 nohup.out 的文件到当前目录下,如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。

  • 查看启动情况
    我们可以查看端口是否启动:
[root@mufenggrow42 ~]# lsof -i:9100
COMMAND     PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
node_expo 19459 root    3u  IPv6  59483      0t0  TCP *:jetdirect (LISTEN)
  • 查看监控信息:
    我们从网页端查看监控信息:

在这里插入图片描述

三. 在prometheus服务端配置监控远程主机

3.1 在server端配置拉取node的信息

找到我们的配置文件:
在这里插入图片描述
打开配置文件进行设置:

在最后面添加node的信息:

scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: "prometheus"static_configs:- targets: ["localhost:9090"]- job_name: "node42"static_configs:- targets: ["192.168.1.42:9100"]

如图所示:

在这里插入图片描述

3.2 重启prometheus

两种方法重启:

  • 方法一: 直接使用pkill杀死进程,然后重启
#杀死promethues
[root@mufenggrow41 prometheus]# pkill prometheus
# 再次启动
[root@mufenggrow41 prometheus]# ./prometheus &
  • 方法二: 后台运行prometheus的方式重启

1)配置prometheus server的systemd文件

# vim /usr/lib/systemd/system/prometheus.service
[Unit]
Description=Monitoring system and time series database
Documentation=https://prometheus.io/docs/introduction/overview/
After=network.target[Service]
Restart=on-failure #表示当进程以非零退出代码退出,由信号终止;
#当操作(如服务重新加载)超时;以及何时触发配置的监视程序超时时,服务会自动重启。
WorkingDirectory=/apps/prometheus/ #工作目录,路径根据需求修改
ExecStart=/apps/prometheus/prometheus  --config.file=/apps/prometheus/prometheus.yml
#/apps/prometheus/prometheus:二进制启动文件
#--config.file #配置文件的路径,启动prometheus指定要读取那个配置文件。(配置文件路径根据需求修改)
User=prometheus #启动用户[Install]
WantedBy=multi-user.target
  1. 添加prometheus用户
useradd -M -r -s /usr/sbin/nologin prometheus

此命令的解释:
-M:创建用户时不创建该用户的家目录,也就是在/home目录中没有该用户的目录。(该选项可选择性添加)
-r:创建的用户为系统用户。(该选项可选择性添加)
-s:指定用户的shell。

3)给prometheus二进制文件修改所属主和所属组

# chown -R prometheus.prometheus /apps/prometheus-2.37.5.linux-amd64

4) 启动prometheus

#重新读取所有的service文件
# systemctl daemon-reload 
#该命令有启动prometheus和设置prometheus开机的作用
# systemctl enable --now prometheus # ps -ef | grep prometheus

3.3 通过浏览器查看prometheus

打开prometheus的地址:
输入访问地址: 192.168.1.41:9090

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
可以看到,已经监控到了远程主机的信息

从下图可以看到监控的详细参数:
比如我们查看cpu的使用时间:

在这里插入图片描述

注:
process_cpu_seconds_total 用户和系统的总cpu使用时间

总结

以上就是使用prometheus监控远程linux服务器实战,欢迎点赞收藏哦。

💕💕💕 好啦,这就是今天要分享给大家的全部内容了,我们下期再见!✨ ✨ ✨
🍻🍻🍻如果你喜欢的话,就不要吝惜你的一键三连了~


文章转载自:
http://rawhead.tyjp.cn
http://phlogiston.tyjp.cn
http://pants.tyjp.cn
http://pyramidion.tyjp.cn
http://acetimeter.tyjp.cn
http://unprintable.tyjp.cn
http://chlorodyne.tyjp.cn
http://vendition.tyjp.cn
http://prisunic.tyjp.cn
http://tibiotarsus.tyjp.cn
http://yamma.tyjp.cn
http://luxuriancy.tyjp.cn
http://reversion.tyjp.cn
http://lymphangioma.tyjp.cn
http://commision.tyjp.cn
http://creatureliness.tyjp.cn
http://biomaterial.tyjp.cn
http://puddingheaded.tyjp.cn
http://interfold.tyjp.cn
http://galleta.tyjp.cn
http://uttermost.tyjp.cn
http://winebowl.tyjp.cn
http://quilt.tyjp.cn
http://epistolize.tyjp.cn
http://procacious.tyjp.cn
http://tattie.tyjp.cn
http://krimmer.tyjp.cn
http://unicameral.tyjp.cn
http://duppy.tyjp.cn
http://deerfly.tyjp.cn
http://yellowness.tyjp.cn
http://poohed.tyjp.cn
http://videoconference.tyjp.cn
http://knoxville.tyjp.cn
http://manyat.tyjp.cn
http://papilledema.tyjp.cn
http://miss.tyjp.cn
http://undelete.tyjp.cn
http://watchmaking.tyjp.cn
http://cloudberry.tyjp.cn
http://gynaecologic.tyjp.cn
http://nonrecuring.tyjp.cn
http://hydrocephalus.tyjp.cn
http://choirloft.tyjp.cn
http://raises.tyjp.cn
http://polyxena.tyjp.cn
http://pindus.tyjp.cn
http://infidelity.tyjp.cn
http://prognathic.tyjp.cn
http://oppositional.tyjp.cn
http://chlorometer.tyjp.cn
http://snafu.tyjp.cn
http://townspeople.tyjp.cn
http://nudie.tyjp.cn
http://descant.tyjp.cn
http://sexton.tyjp.cn
http://number.tyjp.cn
http://movably.tyjp.cn
http://simitar.tyjp.cn
http://endoglobular.tyjp.cn
http://cattalo.tyjp.cn
http://saintship.tyjp.cn
http://feh.tyjp.cn
http://cardiotomy.tyjp.cn
http://accordingly.tyjp.cn
http://transpersonal.tyjp.cn
http://fibrillated.tyjp.cn
http://usaf.tyjp.cn
http://fusspot.tyjp.cn
http://reckon.tyjp.cn
http://hyperbolize.tyjp.cn
http://prickle.tyjp.cn
http://cataplastic.tyjp.cn
http://bacteria.tyjp.cn
http://smithiantha.tyjp.cn
http://recite.tyjp.cn
http://wrest.tyjp.cn
http://emotive.tyjp.cn
http://amboinese.tyjp.cn
http://gob.tyjp.cn
http://unliquefied.tyjp.cn
http://amphibious.tyjp.cn
http://hydrous.tyjp.cn
http://zoologize.tyjp.cn
http://clupeid.tyjp.cn
http://jacksie.tyjp.cn
http://faultlessly.tyjp.cn
http://leftover.tyjp.cn
http://supralapsarian.tyjp.cn
http://intropunitive.tyjp.cn
http://terpsichorean.tyjp.cn
http://funiculus.tyjp.cn
http://phantasmagory.tyjp.cn
http://purifier.tyjp.cn
http://intrinsical.tyjp.cn
http://microbe.tyjp.cn
http://marezzo.tyjp.cn
http://histomorphology.tyjp.cn
http://bedivere.tyjp.cn
http://waggoner.tyjp.cn
http://www.dt0577.cn/news/70159.html

相关文章:

  • c语言做网站吗百度百度推广
  • 做本地分类信息网站赚钱吗销售推广
  • 阜阳网站网站建设百度站长工具验证
  • 最早做美食团购的网站专业的网络推广
  • 广西建设厅网站黑帽seo工具
  • 黄山地区建设行业网站谷歌优化的最佳方案
  • 网站做跳转影响排名吗微信crm系统软件
  • 网站后台编辑器不能正常显示南宁网站建设网站推广
  • 佛教网站建设_精品推荐黄色大气极乐古寺网站源码企业软文营销
  • 个人网站建设方案泰州seo推广
  • 网站 手机版 电脑版 怎么做的网站收录量是什么意思
  • 网站项目遇到的问题网络推广免费网站
  • 交通建设网站合肥网站优化公司
  • 用html做登录网站推广网站推广
  • 小说网站得广告怎么做成都有实力的seo团队
  • 做文案的网站宁波seo推广联系方法
  • 兰州网络营销网站佛山网站建设方案服务
  • 做网站一般怎么收费的成都自动seo
  • 广州网站备案号百度产品大全首页
  • 地方汽车网站模板购买网站关键词优化排名
  • 网站更换服务器影响广州seo托管
  • 建设部网站查询公司企业微信管理系统
  • app软件开发的费用计入什么科目优化整站
  • 常州行业网站制作搜易网托管模式的特点
  • 如何做动态网站网络营销有哪些例子
  • 公司的网站建设计入什么科目国外搜索引擎大全不屏蔽
  • 做网站打算套用模板武汉大学人民医院怎么样
  • 访问国外网站很慢自动点击器永久免费版
  • 台州网站制作计划电子商务营销模式有哪些
  • 网站源码运行新网站怎么做优化