239 lines
8.5 KiB
YAML
239 lines
8.5 KiB
YAML
帮我整理优化补充一下项目需求:
|
||
现已有es的数据流存储了项目的日志,需要一个程序可以自动读取并告警,这个程序可以使用python语言,需要有web界面可以对告警规则进行创建设置修改,告警规则的存储尽量不要用到其他软件的支持比如mysql等,最终该程序需要打包成docker镜像进行运行。
|
||
1、目前访问该es是需要密码的,因此该程序web界面要有连接es的相关设置,可以输入es网址、账号、密码。
|
||
2、告警方式主要是使用飞书机器人,要有可以设置多个飞书机器人的相关设置,以便将不同的告警通过不同飞书机器人发出。
|
||
3、告警规则实现方式是定时查询某条数据流一定时间范围内的数据,统计其中某个字段的数量,比如查找fly-to-moon-admin.log数据流其中字段level:error的数量,达到某个数值就出发告警,通过选择的飞书机器人发出。因此创建告警规则时需要输入规则名称、数据流索引、查询筛选条件、查询到的数量阈值、查询数据流索引的时间范围、查询周期、选择通知的机器人以及消息模版等等。
|
||
4、可以创建多个消息模版。
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-2-0p8se22q
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-3-3i4bf44a
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-4-4g7eq15i
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-5-1w2ex02m
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-6-0l7dj06v
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-7-3u8tc90l
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-8-8r1us02b
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-9-5j7ff78k
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-10-0b6hf01e
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-11-6o8ud15j
|
||
|
||
|
||
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project={{loopData.suzu2.PID}}
|
||
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-1-0h5sp01y
|
||
|
||
https://console.cloud.google.com/apis/api/youtube.googleapis.com/metrics?project=youtobe-api-1-452011
|
||
|
||
|
||
|
||
https://console.cloud.google.com/apis/library/youtube.googleapis.com?project=
|
||
|
||
#cfc-table-caption-0-row-0 .cfc-purview-picker-list-id
|
||
#cfc-table-caption-0-row-1 .cfc-purview-picker-list-id
|
||
#cfc-table-caption-0-row-2 .cfc-purview-picker-list-id
|
||
|
||
|
||
jenkins 前端文件路径 域名 ng配置文件
|
||
test_deeplink_merchant /data/tengine/html/fly_moon_merchant business.deeplink.media business.deeplink.media.conf
|
||
test_deeplink_merchant_saas /data/tengine/html/fly_moon_merchant_saas/ creator.deeplink.media creator.deeplink.media.conf 【已停用】
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
发送验证码-US
|
||
|
||
|
||
|
||
【Scalelink】Your verification code has been sent, please check!
|
||
|
||
|
||
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8"/>
|
||
<meta/>
|
||
<title>Email verification code</title>
|
||
<style>
|
||
body {
|
||
font-family: Arial, sans-serif;
|
||
background-color: #f4f4f4;
|
||
padding: 20px;
|
||
margin: 0;
|
||
}
|
||
.container {
|
||
background-color: #ffffff;
|
||
border-radius: 8px;
|
||
padding: 40px;
|
||
max-width: 600px;
|
||
margin: 0 auto;
|
||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||
}
|
||
.header {
|
||
text-align: center;
|
||
color: #333;
|
||
margin-bottom: 20px;
|
||
}
|
||
.code {
|
||
font-size: 32px;
|
||
font-weight: bold;
|
||
color: #007bff;
|
||
text-align: center;
|
||
margin: 20px 0;
|
||
}
|
||
.message {
|
||
color: #555;
|
||
line-height: 1.6;
|
||
}
|
||
.footer {
|
||
text-align: center;
|
||
margin-top: 40px;
|
||
font-size: 12px;
|
||
color: #777;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<div class="header">
|
||
<h2>Your verification code</h2>
|
||
</div>
|
||
<p class="message">
|
||
Dear User,
|
||
Thank you for using our services! You are currently verifying your account. To ensure the security of your account, please use the following verification code to complete the operation:
|
||
</p>
|
||
|
||
<div class="code">
|
||
{{code}}
|
||
|
||
</div>
|
||
|
||
<p class="message">
|
||
Please enter this verification code into the verification page to complete the login or verification operation. To protect your information security, please pay attention to the following matters:
|
||
<br/>
|
||
- This verification code is only used for the current operation and will automatically expire after 10 minutes. -
|
||
<br/>
|
||
Please do not tell the verification code to anyone else, including anyone claiming to be a customer service representative. Our staff will not ask you for this verification code.
|
||
-
|
||
<br/>
|
||
If you did not request a verification code, it may be an error by someone else. You can ignore this email or contact customer support to ensure the security of your account.
|
||
If you have any questions or need help, please feel free to contact our customer support team. We'll be happy to help you!
|
||
<br/>
|
||
<br/>
|
||
【Scalelink】
|
||
<br/>
|
||
|
||
【Official Website:
|
||
<a href="https://www.scalelink.ai/" target="_blank" rel="nofollow noopener">
|
||
https://www.scalelink.ai/
|
||
</a>
|
||
】
|
||
</p>
|
||
</div>
|
||
</body>
|
||
</html>
|
||
|
||
|
||
|
||
|
||
|
||
机器1:49.51.46.148。
|
||
机器2:43.139.181.45。
|
||
域名:www.lessie.ai,通过cloudflare解析到机器1:49.51.46.148并开启了代理,别人nslookup www.lessie.ai 得到的是 104.21.10.178 和 172.67.146.41。
|
||
现在前端页面放在机器1上,后端接口放在机器2上,机器2对外提供了8070端口给前端访问。
|
||
现在机器1上的nginx的配置
|
||
location /test-api/ {
|
||
proxy_pass http://43.139.181.45:8070;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
||
proxy_intercept_errors off;
|
||
|
||
# 关闭响应缓冲
|
||
proxy_buffering off;
|
||
proxy_cache off;
|
||
proxy_set_header Connection keep-alive;
|
||
}
|
||
|
||
但是现在部署上去后,前端页面请求后端接口访问不到,查看浏览器控制台看到的是:
|
||
请求网址:https://www.lessie.ai/test-api/jenniefy/seo/creator/basic/info?creatorHandle=jojo
|
||
请求方法:GET
|
||
状态代码:302 Found
|
||
远程地址:104.21.10.178:443
|
||
|
||
|
||
|
||
|
||
案例1:
|
||
我现在 server_name jennie.deal www.jennie.deal;
|
||
nds解析是
|
||
A jennie.deal 43.159.145.241
|
||
CNAME www jennie.deal
|
||
现在我的用户访问jennie.deal登录后,再访问www.jennie.deal会要求重新登录
|
||
该怎么设置才能让访问jennie.deal,都会跳转到www.jennie.deal
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
方式一
|
||
A jennie.deal 43.159.145.241
|
||
A www 43.159.145.241
|
||
方式二
|
||
A jennie.deal 43.159.145.241
|
||
CNAME www jennie.deal
|
||
方式三
|
||
A www 43.159.145.241
|
||
CNAME ennie.deal www.jennie.deal
|
||
|
||
|
||
|
||
|
||
我的python项目的目录:/data/webapps/influencer_search_agent,用的python版本是3.12.9
|
||
|
||
现在直接物理机启动是:
|
||
cd /data/webapps/influencer_search_agent
|
||
conda activate search(pyhton版本:3.12.9)
|
||
pip install -r requirements.txt
|
||
TIMESTAMP=\$(date +"%Y%m%d_%H%M%S")
|
||
nohup env PYTHONPATH=/data/webapps/influencer_search_agent APP_ENV=prod python -m dialogue.influencer_search > /data/webapps/influencer_search_agent/log/influencer_search_\${TIMESTAMP}.log 2>&1 &
|
||
|
||
目前这台机器已经运行了这个相同的pyhton项目在运行,占用了物理机5001端口(应该是python代码里写了启动就会占用5001)
|
||
|
||
在这种情况下我该怎么多运行一个?
|
||
|
||
|
||
|
||
|
||
|
||
ln -sf "\$LOGFILE" ${REMOTE_PROJECT_PATH_B}/logs/lessie_sourcing_agents_latest.log
|
||
|
||
ln -sf lessie_sourcing_agents_20250730_220446.log /data/webapps/prod_lessie_sourcing_agents/logs/lessie_sourcing_agents_latest.log
|
||
|
||
|
||
|
||
ln -sf lessie_sourcing_agents_20250729_144153.log /data/webapps/prod_lessie_sourcing_agents/logs/lessie_sourcing_agents_latest.log |