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

新余哪有做网站的公司海口专注海南网站建设

新余哪有做网站的公司,海口专注海南网站建设,网站开发运营公司绩效提成方案,做网站策划师的图片1.1 Prometheus安装部署 Prometheus监控服务 主机名IP地址系统配置作用Prometheus192.168.110.27/24CentOS 7.94颗CPU 8G内存 100G硬盘Prometheus服务器grafana192.168.110.28/24CentOS 7.94颗CPU 8G内存 100G硬盘grafana服务器 监控机器 主机名IP地址系统配置k8s-master-0…

1.1 Prometheus安装部署

  • Prometheus监控服务

主机名IP地址系统配置作用
Prometheus192.168.110.27/24CentOS 7.94颗CPU 8G内存 100G硬盘Prometheus服务器
grafana192.168.110.28/24CentOS 7.94颗CPU 8G内存 100G硬盘grafana服务器
  • 监控机器

主机名IP地址系统配置
k8s-master-01192.168.110.21/24CentOS 7.94颗CPU 8G内存 100G硬盘

1.1.1 环境准备

  • 所有机器配置Hosts解析

cat >> /etc/hosts << EOF
192.168.110.21 k8s-master-01
192.168.110.27 Prometheus
192.168.110.28 grafana
EOF
  • 关闭防护墙和SElinux

  • 设置时间同步

sed -i '3,6 s/^/# /' /etc/chrony.conf
sed -i '6 a server ntp.aliyun.com iburst' /etc/chrony.conf
systemctl restart chronyd.service
chronyc sources

1.1.2 二进制方式安装Prometheus(二选一)

  • 从 Download | Prometheus 下载相应版本,安装到服务器上官网提供的是二进制版,解压就能用,不需要编译

[root@Prometheus ~]# wget -c https://github.com/prometheus/prometheus/releases/download/v2.52.0/prometheus-2.52.0.linux-amd64.tar.gz
  • 解压软件

[root@Prometheus ~]# tar xf prometheus-2.52.0.linux-amd64.tar.gz -C /usr/local/
[root@Prometheus ~]# cd /usr/local/
[root@Prometheus local]# ln  -sv prometheus-2.52.0.linux-amd64/ prometheus
‘prometheus’ -> ‘prometheus-2.52.0.linux-amd64/’
  • 创建数据目录

[root@Prometheus ~]# mkdir /usr/local/prometheus/data
  • 创建服务运行用户

[root@Prometheus ~]# useradd prometheus -M -s /sbin/nologin
[root@Prometheus ~]# chown -R prometheus.prometheus /usr/local/prometheus/*
  • 创建服务运行脚本

[root@Prometheus ~]# vim /usr/lib/systemd/system/prometheus.service 
[Unit]
Description=prometheus
After=network.target
​
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml --storage.tsdb.path=/usr/local/prometheus/data
Restart=on-failure
ExecReload=/bin/kill -HUP $MAINPID
​
[Install]
WantedBy=multi-user.target
  • 启动服务

[root@Prometheus ~]# systemctl daemon-reload 
[root@Prometheus ~]# systemctl enable --now prometheus.service
[root@Prometheus ~]# systemctl is-active prometheus.service
active
[root@Prometheus ~]# ss -lunpt | grep 9090
tcp    LISTEN     0      128    [::]:9090               [::]:*                   users:(("prometheus",pid=2486,fd=7))
  • 访问 http://本机IP:9090 http://192.168.110.27:9090

image-20240527103638863

1.1.3 容器方式安装 Prometheus(二选一)

  • 安装Docker-ce

[root@Prometheus ~]# wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.huaweicloud.com/docker-ce/linux/centos/docker-ce.repo
[root@Prometheus ~]# sed -i 's+download.docker.com+mirrors.huaweicloud.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
[root@Prometheus ~]# sed -i 's/$releasever/7Server/g' /etc/yum.repos.d/docker-ce.repo
[root@Prometheus ~]# mkdir -p /etc/docker
[root@Prometheus ~]# tee /etc/docker/daemon.json <<-'EOF'
{
"exec-opts": ["native.cgroupdriver=systemd"],
"registry-mirrors": [
"https://dbckerproxy.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}
EOF
​
[root@Prometheus ~]# systemctl daemon-reload
[root@Prometheus ~]# systemctl enable --now docker.service
[root@Prometheus ~]# docker --version
Docker version 20.10.21, build baeda1
  • 拉取Prometheus镜像

[root@Prometheus ~]# docker pull prom/prometheus
[root@Prometheus ~]# docker image ls
REPOSITORY        TAG       IMAGE ID       CREATED       SIZE
prom/prometheus   latest    ecb74a3b23a9   2 weeks ago   272MB
[root@Prometheus ~]# docker save -o prometheus.tar prom/prometheus:latest
[root@Prometheus ~]# ls
anaconda-ks.cfg  prometheus.tar
  • 直接使用官方的镜像启动,并映射prometheus.yml配置文件到本地进行管理

[root@Prometheus ~]# mkdir /data
[root@Prometheus ~]# vim /data/prometheus.yml
global:scrape_interval: 15s
​
scrape_configs:- job_name: 'local'metrics_path: '/metrics'scrape_interval: 5sstatic_configs:- targets: ['192.168.110.27:9090']
​
[root@Prometheus ~]# docker run -d --name prometheus -v /data:/data -p 9090:9090 prom/prometheus --config.file=/data/prometheus.yml
eb149926e5cb74c4a3f0641e82d40c590118647297676c862280b559213f3ca6

image-20240527105703939

1.1.4 主机数据展示

  • 通过http://服务器IP:9090/metrics可以查看到监控的数据

[root@Prometheus ~]# curl http://192.168.110.27:9090/metrics

1.1.5 Grafana安装部署

  • 下载地址:Download Grafana | Grafana Labs

[root@grafana ~]# yum install https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/Packages/grafana-8.0.4-1.x86_64.rpm -y
[root@grafana ~]# systemctl enable --now grafana-server
[root@grafana ~]# netstat -lnupt | grep 3000
tcp6       0      0 :::3000                 :::*                    LISTEN      13068/grafana-serve 
  • 使用grafana-cli 安装插件

[root@grafana ~]# grafana-cli plugins list-remote    # 列出所有可用的插件
[root@grafana ~]# grafana-cli plugins install grafana-worldmap-panel   # 安装世界地图插件
[root@grafana ~]# grafana-cli plugins install grafana-clock-panel   # 安装时间插件
[root@grafana ~]# grafana-cli plugins install grafana-piechart-panel   # 安装圆饼插件
[root@grafana ~]# grafana-cli plugins ls
installed plugins:
grafana-clock-panel @ 2.1.5
grafana-piechart-panel @ 1.6.4
grafana-worldmap-panel @ 1.0.6
Please restart Grafana after installing plugins. Refer to Grafana documentation for instructions if necessary.
​
[root@grafana ~]# systemctl restart grafana-server
  • 使用Grafana连接Prometheus

    • 登录grafana

    • 通过浏览器访问 http:// grafana服务器IP:3000就到了登录界面,使用默认的admin用户,admin密码就可以登陆了

    • 第一次需要修改admin密码,可以直接跳过,用户名密码都为admin

image-20240527153727191

image-20240527155608386

image-20240527155632935

image-20240527155747036

image-20240527155840658

image-20240527155918518

http://www.yayakq.cn/news/489383/

相关文章:

  • 佛山市企业网站seo联系方式免费入驻的跨境电商平台
  • 想做一个自己设计公司的网站怎么做室内设计效果图片
  • 提升自己网站查备案怎么查询
  • 网站店招用什么软件做的wordpress网银插件下载
  • 网站深圳优化建设去哪个网站做吃播
  • 盘锦威旺做网站建设公司wordpress头像修改
  • 免费网站建设模板下载七七网站建设
  • 给网站开发APP网站自助建设推广
  • 番禺网站建设培训怎么做消费信贷网站
  • wx5 做网站可以么壁纸公司网站源码
  • 做爰全过程免费网站查网站开通时间
  • 18末年年禁止观看网站西安高新区网站制作
  • 做网站 图片格式简书 wordpress
  • 传媒公司php网站源码郴州市地图全图
  • 哪里可以接做ppt的网站五八同城58同城找工作
  • 天津网站建设兼职免费不良网站代码是多少
  • 网站需要流量黄石港区建设局网站
  • 官方网站查询叉车证公司网站运营方案策划
  • 西安建站软件备案需要网站建设方案书
  • wordpress 笑话源码湖南广告优化
  • 网站推广建设阶段泰州品牌网站建设
  • 怎么把自己做的网站放在rewrite.php wordpress 缓存 固定连接
  • 购物网站 备案wordpress文章内链
  • 申请域名之后如何做网站品牌网站制作方案
  • 洛阳网站设计网站建设的7种流程
  • 农业科技公司网站模板.net开发微信网站
  • 可视化响应式网站建设做直播网站的上市公司
  • 敦煌做网站 条件域名和空间的定义
  • wordpress中英文网站模板网站后台用什么语言合适
  • 外国人做的购物网站my网站域名