# prometheus-install2 **Repository Path**: jbjb123/prometheus-install2 ## Basic Information - **Project Name**: prometheus-install2 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-26 - **Last Updated**: 2022-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # monit ### prometheus+ granfana+ kube-state-metrics安装 ===========服务可以访问公网跳过这步====================== # 如果当前服务器无法访问公网,请先将镜像下载,再导入k3s集群中,为了确保顺利安装,每台机都倒入镜像 1. 离线安装需导入镜像以下镜像: ``` prom/prometheus:v2.31.1 jimmidyson/configmap-reload:v0.5.0 grafana/grafana:8.3.1 registry.cn-shenzhen.aliyuncs.com/jbjb/csi:metrics-v2.4.2 ------------------------------------------ ##### 离线安装kuboard需要以下镜像: questdb/questdb:6.0.5 eipwork/etcd-host:3.4.16-1 eipwork/kuboard:v3 eipwork/kuboard-agent:v3 ``` #### 拉取脚本地址: ``` http://gitlab.iottepa.cn/devops/monit.git ``` #### .开始部署应用 ##### 创建一个命名空间 ``` kubectl create ns istio-system ``` ##### 创建你的应用 ``` kubectl create -f monit/yml/ ``` ##### 使用以下命令查看pods确保都为Running状态 ``` # kubectl get pods -n kuboard NAME READY STATUS RESTARTS AGE kuboard-agent-2-584969bb5d-5lw6t 1/1 Running 21 (12h ago) 4d7h kuboard-agent-7d968f77bb-684nm 1/1 Running 20 (13h ago) 4d7h kuboard-etcd-nlmfh 1/1 Running 10 (6h19m ago) 4d7h kuboard-questdb-7d5c4d9547-8cs9h 1/1 Running 7 (13h ago) 4d7h kuboard-v3-56b4b954c9-k969g 1/1 Running 9 (6h19m ago) 4d7h # kubectl get pods -n istio-system NAME READY STATUS RESTARTS AGE grafana-67f5ccd9d7-kbq6v 1/1 Running 4 (13h ago) 37h kube-state-metrics-77487788b7-258mp 1/1 Running 0 48m prometheus-7cc96d969f-5fm9q 2/2 Running 8 (13h ago) 37h ``` ==================================== #### ++++++++++++在线安装++++++++++++++++++++++++++++ 拉取脚本地址: ``` http://gitlab.iottepa.cn/devops/monit.git ``` ### 2.开始部署应用 ``` 创建一个命名空间 kubectl create ns istio-system 创建你的应用 kubectl create -f monit/yml/ ``` ##### +++++++++++++++++++++++++++++++++++++++ ``` 访问你的K8S web ui 任意节点上的IP+端口都可以访问 http://主机ip+30080端口 登陆后请将admin密码更改,(初始化用户admin密码kuboard123) ``` ## 3 ==在线安装node_exporter== ``` #在线安装 sh script/install-1.sh ``` ### 离线安装需要提前将离线包 ``` gitgub下载地址: wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz ``` ### 将下载好的tar包放在与monit文件夹同级运行以下脚本 ``` sh monit/script/ins-2.sh ``` ###测试可以访问,有输出就算成功 ``` curl 127.0.0.1:9100/metrics ``` ``` # HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 0 go_gc_duration_seconds{quantile="0.25"} 0 go_gc_duration_seconds{quantile="0.5"} 0 go_gc_duration_seconds{quantile="0.75"} 0 go_gc_duration_seconds{quantile="1"} 0 go_gc_duration_seconds_sum 0 go_gc_duration_seconds_count 0 ``` ##最后配置prometheus+ granfana+ kube-state-metrics #### 查看prometheus_kube.docx文件