Fork me on GitHub

Prometheus+Grafana 企业实践应用 (一) : 安装和部署

参考连接:https://prometheus.io/docs/prometheus/latest/installation/

1.安装prometheus 

下载docker镜像 prom/prometheus,运行下面命令

docker run \
-p 9090:9090 \
-v /root/k8s/prometheus/config:/etc/prometheus \
--name prometheus-k8s \
-d prom/prometheus \

 

lsof -i:9090 查看端口号

 

https://mirrors.aliyun.com/repo/Centos-8.repo

下载后vim repo文件 执行命令 ":%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g "
和 ”:%s/$releasever/$releasever-stream/g“   否则会出现下面错误

”
[root@master yum.repos.d]# yum makecache
CentOS-8 - Base - mirrors.aliyun.com 77 B/s | 2.3 kB 00:30
Errors during downloading metadata for repository 'base':
- Curl error (6): Couldn't resolve host name for http://mirrors.cloud.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Could not resolve host: mirrors.cloud.aliyuncs.com]
- Curl error (28): Timeout was reached for http://mirrors.aliyuncs.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml [Connection timed out after 30000 milliseconds]
- Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 117.34.47.243)
Error: Failed to download metadata for repo 'base': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
“

 需要安装epel包  ,执行命令  : yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

 在CentOS8.0中默认不再支持ntp软件包,时间同步将由chrony来实现

sysemctl start chronyd 开启服务
chronyc sources 命令确定已经配置好同步时间服务
chronyc -a makestep 同步时间

 

下载开源grafana镜像
docker pull grafana/grafana-oss
docker run -d -p 3000:3000 --name grafana docker.io/grafana/grafana-oss:latest

登录地址将会运行,如下:http://192.168.50.xx:3000/login   默认admin/admin

 

 

posted @ 2022-05-11 22:41  低调的神  阅读(115)  评论(0编辑  收藏  举报