代码拉取完成,页面将自动刷新
同步操作将从 feiyu563/PrometheusAlert 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
PrometheusAlert可以部署在本地和云平台上,支持windows、linux、公有云、私有云、混合云、容器和kubernetes。你可以根据实际场景或需求,选择相应的方式来部署PrometheusAlert:
#clone项目源代码
git clone https://github.com/feiyu563/PrometheusAlert.git
#创建配置文件
mkdir /etc/prometheusalert-center/
cp PrometheusAlert/conf/app.conf /etc/prometheusalert-center/
#启动PrometheusAlert并挂载配置文件
docker run -d -p 8080:8080 -v /etc/prometheusalert-center:/app/conf --name prometheusalert-center feiyu563/prometheus-alert:latest
#启动后可使用浏览器打开以下地址查看:http://127.0.0.1:8080
#clone项目源代码
git clone https://github.com/feiyu563/PrometheusAlert.git
#进入程序目录并运行PrometheusAlert
cd PrometheusAlert/example/linux/
./PrometheusAlert #后台运行请执行nohup ./PrometheusAlert &
#启动后可使用浏览器打开以下地址查看:http://127.0.0.1:8080
#clone项目源代码
git clone https://github.com/feiyu563/PrometheusAlert.git
#进入程序目录并双击运行 PrometheusAlert.exe即可
cd PrometheusAlert/example/windows/
#启动后可使用浏览器打开测试地址:http://127.0.0.1:8080
#Kubernetes中运行可以直接执行以下命令行即可(注意默认的部署模版中未挂载模版数据库文件 db/PrometheusAlertDB.db,为防止模版数据丢失,请自行增加挂载配置 )
kubectl apply -n monitoring -f https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/example/kubernetes/PrometheusAlert-Deployment.yaml
#启动后可使用浏览器打开以下地址查看:http://[YOUR-PrometheusAlert-URL]:8080
#clone项目源代码
git clone https://github.com/feiyu563/PrometheusAlert.git
cd PrometheusAlert/example/helm
#如需修改配置文件,请更新config中的app.conf
#helm部署模版支持配置Ingress域名,可在values.yaml中进行配置
#配置修改完成后,通过以下命令启动即可(注意默认的部署模版中未挂载模版数据库文件 db/PrometheusAlertDB.db,为防止模版数据丢失,请自行增加挂载配置 )
helm upgrade --install monitor prometheusalert -n monitoring
#启动后可使用浏览器打开以下地址查看: http://[Ingress_url]:[Ingress_port]
PrometheusAlert默认使用sqlite3作为后端自定义模板的存储,这种方式适合于单机部署,满足绝大部分生产场景使用。考虑到部分企业对于服务的高可用要求较高,同时也为了让PrometheusAlert更易于横向扩展,用户可以更改PrometheusAlert的默认存储为mysql。(推荐使用mysql 5.7及以上版本)
1.创建数据库
CREATE DATABASE prometheusalert CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
2.利用Navicat
或命令行将db目录
中的 prometheusalert.sql
导入数据库prometheusalert
use prometheusalert
source prometheusalert.sql
3.开启PrometheusAlert配置文件中关于mysql的配置 conf/app.conf,数据库名称与上面创建的数据一致
#数据库驱动,支持sqlite3,mysql,如使用mysql,请开启db_host,db_user,db_password,db_name的注释
db_driver=mysql
db_host=127.0.0.1:3306
db_user=root
db_password=root
db_name=prometheusalert
重启PrometheusAlert,这样即完成配置PrometheusAlert使用mysql数据库作为默认后端存储。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。