Commit db18c390 authored by frank.chen's avatar frank.chen

服务器文档

parent 10aec370
...@@ -3,71 +3,71 @@ ...@@ -3,71 +3,71 @@
- int 32 位 - int 32 位
- long 64 位 - long 64 位
| 字段名 | 类型 | 说明 | 例子 | | 字段名 | 类型 | 说明 | 例子 |
| ---------------- | ------ | ------------------------------------------- | ---------------------------------------------------------------------------------------- | | ---------------- | ------ | -------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| appStoreLogId | string | 广告匹配日志id | 157dd3ac-a26a-4ac8-a92c-d01376bf4cd5 | | appStoreLogId | string | 广告匹配日志id | 157dd3ac-a26a-4ac8-a92c-d01376bf4cd5 |
| batchLogId | string | 请求ID,标识一次请求 | 239410ed-01b5-409a-9324-7211c0fcaa52 | | batchLogId | string | 请求ID,标识一次请求 | 239410ed-01b5-409a-9324-7211c0fcaa52 |
| referLogId | string | trace 日志ID | 239410ed-01b5-409a-9324-7211c0fcaa52 | | referLogId | string | trace 日志ID | 239410ed-01b5-409a-9324-7211c0fcaa52 |
| originAdsourceId | string | URL中的参数 original,具体不明 | | | originAdsourceId | string | URL中的参数 original,具体不明 | |
| matchOrder | int | 原来有其他用途,后来改为当前服务器IP的整数形式 | | | matchOrder | int | 原来有其他用途,后来改为当前服务器IP的整数形式 | |
| appId | long | appid | 19641 | | appId | long | appid | 19641 |
| sourcePorductId | string | 广告 product id | 000000798071 | | sourcePorductId | string | 广告 product id | 000000798071 |
| sourceAppId | string | 包名 | com.Qunar | | sourceAppId | string | 包名 | com.Qunar |
| creativeClickUrl | string | 创意的点击跳转地址 | samsungapps://PromotionDetail/1000000972 | | creativeClickUrl | string | 创意的点击跳转地址 | samsungapps://PromotionDetail/1000000972 |
| campaignId | long | 活动 ID | 23354 | | campaignId | long | 活动 ID | 23354 |
| strategyId | long | 策略 ID | 59192 | | strategyId | long | 策略 ID | 59192 |
| creativeId | long | 创意 ID | 42386 | | creativeId | long | 创意 ID | 42386 |
| mediaId | long | 流量媒体 ID | | | mediaId | long | 流量媒体 ID | |
| adPosId | long | | 351 | | adPosId | long | | 351 |
| strategyPrice | long | 竞价价格值 | | | strategyPrice | long | 竞价价格值 | |
| dealPrice | long | 竞价价格值 | 63000 | | dealPrice | long | 竞价价格值 | 63000 |
| payPrice | long | 广告匹配无值,广告通知才有值 | 63000 | | payPrice | long | 广告匹配无值,广告通知才有值 | 63000 |
| encodeAdsource | string | 广告匹配的adsource | | | encodeAdsource | string | 广告匹配的adsource | |
| decodeAdsource | string | 广告通知里记录的url参数中的adsource | | | decodeAdsource | string | 广告通知里记录的url参数中的adsource | |
| logType | int | 日志类型,1 匹配;2 展示;3 action(点击、下载或安装、等等其他类型) | | | logType | int | 日志类型,1 匹配;2 展示;3 action(点击、下载或安装、等等其他类型) | |
| matchType | int | 广告匹配类型,1 普通;2 搜索。 | | | matchType | int | 广告匹配类型,1 普通;2 搜索。 | |
| isMatched | int | 是否成功匹配到广告,1 成功;0 失败 | | | isMatched | int | 是否成功匹配到广告,1 成功;0 失败 | |
| isImpression | int | 日志是否为展示通知 | | | isImpression | int | 日志是否为展示通知 | |
| isClick | int | 日志是否为点击通知 | | | isClick | int | 日志是否为点击通知 | |
| actionType | int | 日志是否为其他事件通知,即url路径为 store/action | | | actionType | int | 日志是否为其他事件通知,即url路径为 store/action | |
| isHome | int | 日志是否为进入主页通知 | | | isHome | int | 日志是否为进入主页通知 | |
| isDownload | int | 日志是否为下载通知 | | | isDownload | int | 日志是否为下载通知 | |
| isInstall | int | 日志是否为安装通知 | | | isInstall | int | 日志是否为安装通知 | |
| logTimestamp | long | 时间戳 | | | logTimestamp | long | 时间戳 | |
| logDate | string | 无值 | | | logDate | string | 无值 | |
| logTime | string | 无值 | | | logTime | string | 无值 | |
| userIp | string | 终端 IP | | | userIp | string | 终端 IP | |
| zoneCountry | string | 由终端IP推算的国家名 | | | zoneCountry | string | 由终端IP推算的国家名 | |
| zoneProvince | string | 由终端IP推算的省份名 | | | zoneProvince | string | 由终端IP推算的省份名 | |
| zoneCity | string | 由终端IP推算的城市名 | | | zoneCity | string | 由终端IP推算的城市名 | |
| userId | string | 用户ID | Yjg0OWY1ZTgxYWY5OTc3MzQ0NzRlMjhkYmE0N2Y2MmMzMzIyOTQyZGY3MzM1N2I4NTljNjU5OTdkZmJhNjRiNA== | | userId | string | 用户ID | Yjg0OWY1ZTgxYWY5OTc3MzQ0NzRlMjhkYmE0N2Y2MmMzMzIyOTQyZGY3MzM1N2I4NTljNjU5OTdkZmJhNjRiNA== |
| userPhone | string | 无值 | | | userPhone | string | 无值 | |
| userAgent | string | useragent,即 UA | | | userAgent | string | useragent,即 UA | |
| userOs | string | 操作系统, url 参数 dos | 33 | | userOs | string | 操作系统, url 参数 dos | 33 |
| userDeviceBrand | string | 品牌, 参数 db | Samsung | | userDeviceBrand | string | 品牌, 参数 db | Samsung |
| userDeviceModel | string | 型号, 参数 dt | SM-C9000 | | userDeviceModel | string | 型号, 参数 dt | SM-C9000 |
| userLanguage | string | 参数vc | 4.5.26.2 | | userLanguage | string | 参数vc | 4.5.26.2 |
| userDisplaySize | string | 分辨率 参数 dis | | | userDisplaySize | string | 分辨率 参数 dis | |
| usernetWork | string | 网络链接方式, 参数 nt | | | usernetWork | string | 网络链接方式, 参数 nt | |
| deviceApps | string | 用户手机上已经安装的app列表,url 参数 apps | | | deviceApps | string | 用户手机上已经安装的app列表,url 参数 apps | |
| searchKeyWords | string | 用户搜索关键字,或url参数 pkgname | 赶走野蜂方法 | | searchKeyWords | string | 用户搜索关键字,或url参数 pkgname | 赶走野蜂方法 |
| cheatType | int | 匹配广告时,活动有没有匹配到请求时的搜索关键字 | | | cheatType | int | 匹配广告时,活动有没有匹配到请求时的搜索关键字 | |
| voucherFlag | int | 是否优先消耗虚拟币(0为现金优先,1为优先虚拟币),取自共享内存里的广告策略 | | | voucherFlag | int | 是否优先消耗虚拟币(0为现金优先,1为优先虚拟币),取自共享内存里的广告策略 | |
| matchKeyWords | string | 匹配到的平台设置的关键词 | | | matchKeyWords | string | 匹配到的平台设置的关键词 | |
| reserveInt | int | ctr class | | | reserveInt | int | ctr class | |
| reserveLong | long | 无值 | 0 | | reserveLong | long | 无值 | 0 |
| reserveString | string | 切词匹配时候,记录切词信息 | | | reserveString | string | 切词匹配时候,记录切词信息 | |
| oaid | string | | 9c7ba72d2f5ce06ac3fa46cd329cac2f957cb0552b505ead22a43e97e155fd58 | | oaid | string | | 9c7ba72d2f5ce06ac3fa46cd329cac2f957cb0552b505ead22a43e97e155fd58 |
| imei | string | | | | imei | string | | |
| cost_price | double | 广告 app 配置的 CostRatio | | | cost_price | double | 广告 app 配置的 CostRatio | |
| from_mediaid | int | from_mediaid 当前广告位是详情页时,该参数指示,详情页由哪个前置广告位带来 | | | from_mediaid | int | from_mediaid 当前广告位是详情页时,该参数指示,详情页由哪个前置广告位带来 | |
| dspEcpm | long | dsp返回的ecpm,单位做了转换,万分之一元 | | | dspEcpm | long | dsp返回的ecpm,单位做了转换,万分之一元 | |
| CPM2CPDRatio | double | 我们配置的转换因子 | | | CPM2CPDRatio | double | 我们配置的转换因子 | |
| ctr | double | 预测时的转换率 | 0.0045 | | ctr | double | 预测时的转换率 | 0.0045 |
| ctrFactor | double | 配置的ctr提升因子 | 90 | | ctrFactor | double | 配置的ctr提升因子 | 90 |
| adIndex | int | 同一个广告位中匹配到的创意次序 | | | adIndex | int | 同一个广告位中匹配到的创意次序 | |
| llmtags | string | url 参数 llmtags | `野蜂驱赶*方法查询*生活技巧` | | llmtags | string | url 参数 llmtags | `野蜂驱赶*方法查询*生活技巧` |
| llmapps | string | url 参数 llmapps | `百度经验*知乎*豆丁网` | | llmapps | string | url 参数 llmapps | `百度经验*知乎*豆丁网` |
## schema ## schema
......
## 格式
- int 32 位
- long 64 位
| <img width=300px/></br>字段名 | <img width=180px/></br>类型 | <img width=400px/></br>说明 | <img width=200px/></br>例子 |
|:------------------------:| ----------------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| appStoreLogId | string | 广告匹配日志id | 157dd3ac-a26a-4ac8-a92c-d01376bf4cd5 |
| batchLogId | string | 请求ID,标识一次请求 | 239410ed-01b5-409a-9324-7211c0fcaa52 |
| referLogId | string | trace 日志ID | 239410ed-01b5-409a-9324-7211c0fcaa52 |
| originAdsourceId | string | URL中的参数 original,具体不明 | |
| matchOrder | int | 原来有其他用途,后来改为当前服务器IP的整数形式 | |
| appId | long | appid | 19641 |
| sourcePorductId | string | 广告 product id | 000000798071 |
| sourceAppId | string | 包名 | com.Qunar |
| creativeClickUrl | string | 创意的点击跳转地址 | samsungapps://PromotionDetail/1000000972 |
| campaignId | long | 活动 ID | 23354 |
| strategyId | long | 策略 ID | 59192 |
| creativeId | long | 创意 ID | 42386 |
| mediaId | long | 流量媒体 ID | |
| adPosId | long | | 351 |
| strategyPrice | long | 竞价价格值 | |
| dealPrice | long | 竞价价格值 | 63000 |
| payPrice | long | 广告匹配无值,广告通知才有值 | 63000 |
| encodeAdsource | string | 广告匹配的adsource | |
| decodeAdsource | string | 广告通知里记录的url参数中的adsource | |
| logType | int | 日志类型,1 匹配;2 展示;3 action(点击、下载或安装、等等其他类型) | |
| matchType | int | 广告匹配类型,1 普通;2 搜索。 | |
| isMatched | int | 是否成功匹配到广告,1 成功;0 失败 | |
| isImpression | int | 日志是否为展示通知 | |
| isClick | int | 日志是否为点击通知 | |
| actionType | int | 日志是否为其他事件通知,即url路径为 store/action | |
| isHome | int | 日志是否为进入主页通知 | |
| isDownload | int | 日志是否为下载通知 | |
| isInstall | int | 日志是否为安装通知 | |
| logTimestamp | long | 时间戳 | |
| logDate | string | 无值 | |
| logTime | string | 无值 | |
| userIp | string | 终端 IP | |
| zoneCountry | string | 由终端IP推算的国家名 | |
| zoneProvince | string | 由终端IP推算的省份名 | |
| zoneCity | string | 由终端IP推算的城市名 | |
| userId | string | 用户ID | Yjg0OWY1ZTgxYWY5OTc3MzQ0NzRlMjhkYmE0N2Y2MmMzMzIyOTQyZGY3MzM1N2I4NTljNjU5OTdkZmJhNjRiNA== |
| userPhone | string | 无值 | |
| userAgent | string | useragent,即 UA | |
| userOs | string | 操作系统, url 参数 dos | 33 |
| userDeviceBrand | string | 品牌, 参数 db | Samsung |
| userDeviceModel | string | 型号, 参数 dt | SM-C9000 |
| userLanguage | string | 参数vc | 4.5.26.2 |
| userDisplaySize | string | 分辨率 参数 dis | |
| usernetWork | string | 网络链接方式, 参数 nt | |
| deviceApps | string | 用户手机上已经安装的app列表,url 参数 apps | |
| searchKeyWords | string | 用户搜索关键字,或url参数 pkgname | 赶走野蜂方法 |
| cheatType | int | 匹配广告时,活动有没有匹配到请求时的搜索关键字 | |
| voucherFlag | int | 是否优先消耗虚拟币(0为现金优先,1为优先虚拟币),取自共享内存里的广告策略 | |
| matchKeyWords | string | 匹配到的平台设置的关键词 | |
| reserveInt | int | ctr class | |
| reserveLong | long | 无值 | 0 |
| reserveString | string | 切词匹配时候,记录切词信息 | |
| oaid | string | | 9c7ba72d2f5ce06ac3fa46cd329cac2f957cb0552b505ead22a43e97e155fd58 |
| imei | string | | |
| cost_price | double | 广告 app 配置的 CostRatio | |
| from_mediaid | int | from_mediaid 当前广告位是详情页时,该参数指示,详情页由哪个前置广告位带来 | |
| dspEcpm | long | dsp返回的ecpm,单位做了转换,万分之一元 | |
| CPM2CPDRatio | double | 我们配置的转换因子 | |
| ctr | double | 预测时的转换率 | 0.0045 |
| ctrFactor | double | 配置的ctr提升因子 | 90 |
| adIndex | int | 同一个广告位中匹配到的创意次序 | |
| llmtags | string | url 参数 llmtags | `野蜂驱赶*方法查询*生活技巧` |
| llmapps | string | url 参数 llmapps | `百度经验*知乎*豆丁网` |
| cvr | double | TODO: 预测时返回的 cvr | 0.000147 |
| ocpxstage | int | TODO: ocpx 阶段 | 1 |
| ecpm | double | TODO: 最初为zzy预测返回的ecpm,未来可能作它用,注意zzy返回的是单次展示价格,不是千次 | 0.00257 |
## schema
- 代码里会用到
```
{
"name" : "appStoreLog", "type" : "record",
"fields" : [
{ "name" : "appStoreLogId", "type" : "string" },
{ "name" : "batchLogId", "type" : "string" },
{ "name" : "referLogId", "type" : "string" },
{ "name" : "originAdsourceId", "type" : "string" },
{ "name" : "matchOrder", "type" : "int" },
{ "name" : "appId", "type" : "long" },
{ "name" : "sourcePorductId", "type" : "string" },
{ "name" : "sourceAppId", "type" : "string" },
{ "name" : "creativeClickUrl", "type" : "string" },
{ "name" : "campaignId", "type" : "long" },
{ "name" : "strategyId", "type" : "long" },
{ "name" : "creativeId", "type" : "long" },
{ "name" : "mediaId", "type" : "long" },
{ "name" : "adPosId", "type" : "long" },
{ "name" : "strategyPrice", "type" : "long" },
{ "name" : "dealPrice", "type" : "long" },
{ "name" : "payPrice", "type" : "long" },
{ "name" : "encodeAdsource", "type" : "string" },
{ "name" : "decodeAdsource", "type" : "string" },
{ "name" : "logType", "type" : "int" },
{ "name" : "matchType", "type" : "int" },
{ "name" : "isMatched", "type" : "int" },
{ "name" : "isImpression", "type" : "int" },
{ "name" : "isClick", "type" : "int" },
{ "name" : "actionType", "type" : "int" },
{ "name" : "isHome", "type" : "int" },
{ "name" : "isDownload", "type" : "int" },
{ "name" : "isInstall", "type" : "int" },
{ "name" : "logTimestamp", "type" : "long" },
{ "name" : "logDate", "type" : "string" },
{ "name" : "logTime", "type" : "string" },
{ "name" : "userIp", "type" : "string" },
{ "name" : "zoneCountry", "type" : "string" },
{ "name" : "zoneProvince", "type" : "string" },
{ "name" : "zoneCity", "type" : "string" },
{ "name" : "userId", "type" : "string" },
{ "name" : "userPhone", "type" : "string" },
{ "name" : "userAgent", "type" : "string" },
{ "name" : "userOs", "type" : "string" },
{ "name" : "userDeviceBrand", "type" : "string" },
{ "name" : "userDeviceModel", "type" : "string" },
{ "name" : "userLanguage", "type" : "string" },
{ "name" : "userDisplaySize", "type" : "string" },
{ "name" : "usernetWork", "type" : "string" },
{ "name" : "deviceApps", "type" : "string" },
{ "name" : "searchKeyWords", "type" : "string" },
{ "name" : "cheatType", "type" : "int" },
{ "name" : "voucherFlag", "type" : "int" },
{ "name" : "matchKeyWords", "type" : "string" },
{ "name" : "reserveInt", "type" : "int" },
{ "name" : "reserveLong", "type" : "long" },
{ "name" : "reserveString", "type" : "string" },
{ "name" : "oaid", "type" : "string" },
{ "name" : "imei", "type" : "string" },
{ "name" : "cost_price", "type" : "double" },
{ "name" : "from_mediaid", "type" : "int" },
{ "name" : "dspEcpm", "type" : "long" },
{ "name" : "CPM2CPDRatio", "type" : "double" },
{ "name" : "ctr", "type" : "double" },
{ "name" : "ctrFactor", "type" : "double" },
{ "name" : "adIndex", "type" : "int" },
{ "name" : "llmtags", "type" : "string" },
{ "name" : "llmapps", "type" : "string" },
{ "name" : "cvr", "type" : "double" },
{ "name" : "ocpxstage", "type" : "int" },
{ "name" : "ecpm", "type" : "double" }
]
}
```
## 基本信息
- adx-web
- 4台服务器,每台一样。
## adx-web
- 程序路径 `/data/adx/release/adx-web`
- systemctl 常驻
## 业务监控
- 程序路径 `/data/adx/shell/AdxMonitor`
## 完整定时任务
```
/var/spool/cron/adx-user
*/5 * * * * cd /data/adx/shell/AdxMonitor && python adxWeb.py >> adxweb.log
/var/spool/cron/root
0 3 1 * * systemctl restart adx-web
```
## 日志压缩
-
\ No newline at end of file
## 概述 ## 基本信息
- 服务器地址 192.168.0.47 180.76.188.27 - 192.168.2.4 180.184.61.34
- 有多个程序在这台服务器上运行:数据拉取落盘,数据修正 - 安装卸载数据落盘
- 大数据端有程序执行 - 数据修正,早起使用,现在已不再使用。
## 用户安装卸载数据落盘
- 从 redis 拉取数据,然后写到本地文件。
- 数据来源: 由ssp nginx 上的 php 脚本接收并放入 redis。
### 程序说明 ## 安装卸载数据落盘
- http://git.dt-dtg5.com/t1/tools.git - 代码在git `http://git.dt-dtg5.com/t1/tools.git`
- 程序原来在 /data/appstore-api/sync_appstore_userdata,后来代码整理到git,程序改到 /data/appstore-api/tools/installer_sync - 程序原来在 /data/appstore-api/sync_appstore_userdata,后来代码整理到git,程序改到 /data/appstore-api/tools/installer_sync
- 程序编译的可执行文件为 sync - 程序编译的可执行文件为 sync
- 程序以crontab方式被执行,启动脚本在 `/etc/cron.d/sync-userdata` - 程序以crontab方式被执行,启动脚本在 `/etc/cron.d/sync-userdata`
...@@ -20,4 +16,25 @@ ...@@ -20,4 +16,25 @@
- update_oaid - update_oaid
- 源码位置 /root/frank/update_oaid - 源码位置 /root/frank/update_oaid
- redis集群的用户信息,以前接收的oaid,是个base64值,后来变为原始值。所以中间有部分数据冲突。某些数据为base64值,某些为原始oaid。 - redis集群的用户信息,以前接收的oaid,是个base64值,后来变为原始值。所以中间有部分数据冲突。某些数据为base64值,某些为原始oaid。
- 这个程序,前面执行过,将数据修正,就行了。后面几乎不会再用到。 - 这个程序,以前执行过,将数据修正,就行了。后面几乎不会再用到此功能。
## 完整定时任务
```
/var/spool/cron/root
#给头条 appstore-interface project
#*/30 * * * * sh /data/appstore/sync_interface/sync_interface.sh
#给三星
*/10 * * * * sh /data/appstore/sync_interface_samsung/sync_interface.sh
#头条个模型的数据
#30 * * * * sh /data/appstore/rtdata/rtdata.sh >> /data/appstore/rtdata/rtdata.sh.log 2>&1
#删除本地的log 留存近多少天的
0 6 * * * sh /data/www/data/rmData.sh
10 0 * * * sh /data/appstore/ctrdata/ctrdata.sh
10 0 * * * sh /data/appstore/ctrdataback/ctrdata.sh
```
## 日志压缩
-
## 基本信息
- 3台服务器
- 联盟广告投放
- 共享内存数据接收
- 信息流广告投放与数据接收
## 联盟广告投放
- ssp-web ssp-core
- 程序位置 `/data/adx/release`
- ssp-web 较简单,基本无需修改。
- systemctl 常驻
## 完整定时任务
```
/var/spool/cron/root
#--scan-transfer start-----
*/15 * * * * sh /data/appstore/shell/scan-transfer-transferbmr-defend.sh
0 18 * * 1 sh /data/appstore/shell/rm_backup.sh
0 6 * * * sh /data/appstore/shell/rmlog.sh
#--scan-transfer end-----
```
## 日志压缩
-
\ No newline at end of file
## 基本信息
- 192.168.20.5 180.184.56.143
- 日志落盘
- 掌阅上报
- 普罗米修斯
- 检查redis缓存
## 日志落盘
- 程序路径 `/data/adx/release/adx-cron`
- 源码 `adx-cn/adx-cron`
- systemctl 常驻
## 掌阅上报
- 程序路径 `/data/adx/release/action-report`
- 源码 `adx-cn/action-report`
- crontab 定期执行
## 普罗米修斯
- 原来在 root 下弄的,所以路径为 `/root/app/prometheus-2.47.0.linux-amd64`
- exporter 程序在 adx-stg 服务器上,`/home/adx-user/frank/gocode/exporter_adx`
- 处于尝试状态
## redis 缓存检查
- `/data/shell/AdxMonitor`
- crontab 定期执行
## 业务监控
- 定期重启 filebeat
## 完整定时任务
```
/var/spool/cron/root
25 */1 * * * sh /data/shell/adx_log_monitor_new.sh > /data/shell/adx_log_monitor_new.sh.log
*/1 * * * * cd /data/adx/release/action-report && ./actionReport -f ./conf/app-prd.ini > /dev/null 2>&1
30 3,8,13,16,19,22 * * * systemctl restart filebeatd
/var/spool/cron/adminuser
* * * * * cd /data/shell/AdxMonitor && python redis_llen.py >> redis_llen.log
/etc/cron.d/ 未使用
```
## 日志压缩
```
/data/shell/AdxMonitor/*.log
```
\ No newline at end of file
## 基本信息
- 3台
- 代理http请求
- 预测服务超时率汇报
- dsp超时报警
- dsp转发winloss
## 代理http请求
- 使用 nginx
- 配置位置 `/etc/nginx/conf.d/default.conf`
## 预测服务超时率汇报
- proxy-1 才有
- `/data/pycode/proxy_dmp_analyze2`
## dsp超时报警
- `/data/pycode/proxy_status`
## dsp转发winloss
- `/data/dsp-notify`
## 完整定时任务
```
/var/spool/cron/root
*/10 * * * * cd /data/pycode/proxy_status && python main.py mail> /dev/null 2>&1
0 0,6,9,12,15,18,21 * * * /usr/sbin/logrotate -vf /etc/logrotate.d/nginx-dsp
#0 7 * * * cd /data/pycode/proxy_dmp_analyze2 && nohup python main.py colourdata >>log.log &
5 7 * * * cd /data/pycode/proxy_dmp_analyze2 && nohup python main.py samsung-proxy >>log.log &
#10 7 * * * cd /data/pycode/proxy_dmp_analyze2 && nohup python main.py toutiao >>log.log &
```
## 日志压缩
```
nginx
/var/log/nginx/toutiao-access.log
/var/log/nginx/samsung-proxy-access.log
/var/log/nginx/colourdata-access.log
nginx-dsp
/var/log/nginx/error.log
/var/log/nginx/yyb-access.log
/var/log/nginx/toutiao_rta-access.log
/var/log/nginx/qimao_rta-access.log
/var/log/nginx/pangolin-access.log
/var/log/nginx/oppo-access.log
/var/log/nginx/kuaishou-access.log
/var/log/nginx/iflytek-access.log
/var/log/nginx/domob-access.log
/var/log/nginx/baidu-access.log
/var/log/nginx/ylh-access.log
/var/log/nginx/yybnew-access.log
/var/log/nginx/meizu-access.log
/var/log/nginx/qihu-access.log
```
\ No newline at end of file
- 这里描述服务器功能,部署了什么代码,有哪些定时任务。
- 服务器有 stg 和 prd 之分。一般来说,重点描述prd。
- 实际服务器不一定被文档完全描述,记得及时更新。
- stg 服务器可能会有额外功能。
\ No newline at end of file
## 说明
- nginx-1 的额外功能。
## 计算 ctr
- 程序路径 `/data/appstore/shell/monitor/`
- crontab 定期执行
## 业务监控
- AdsNum.py 监测广告位的活动,太多会邮件报警。
- coredmpClean.py 清理coredump,防止文件太多。
## 定时任务-额外
```
/etc/cron.d/monitor
0 */4 * * * root cd /data/appstore/shell/monitor/ && python AdsNum.py >> /var/log/checkAds.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python coredmpClean.py >> /var/log/monitor.log 2>&1
/var/spool/cron/root
*/5 * * * * cd /data/appstore/IntimeStat/ && python main.py >> /data/log/IntimeStat.log 2>&1
*/5 * * * * cd /data/appstore/IntimeStat/ && python ctr-keywords.py >> /data/log/ctrKeywords.log 2>&1
```
\ No newline at end of file
## 基本信息
- 10台prd
- 1台stg
- nginx-1 有额外功能
### 功能
- 广告投放
- 安装卸载接收
- 共享内存接收
- 共享内存查看
## 广告投放
- 程序路径 `/data/appstore/nginx`
- 由 fabric 在 nginx-stg 服务器上远程部署
## 安装卸载接收
- nginx php
- 程序路径 `/var/www/appstore-adsurvey`
- 由 fabric 在 nginx-stg 服务器上远程部署
## 共享内存接收
- 程序路径 `/usr/local/bin/Thriftc`
- 由 fabric 在 nginx-stg 服务器上远程部署
- 较少更新,一般手动升级
- 程序日志 `/data/log/appstore-thrift`
## 共享内存查看
- 一般使用时才执行,程序位置不定。比如 `/home/adminuser/frank/thrift_watch/build`
- nginx-1 部署了一个定时任务,用于监控广告位投放活动数是否太多,需要用到这个程序。
## 业务监控
- 程序路径 `/data/appstore/shell/monitor/`
- 代码在git上
- 注意
```
/usr/local/bin/thrift_watch 这个程序会往redis推送数据,类似健康检查数据,但不知道被谁检查。
```
## 完整定时任务
```
/etc/cron.d/monitor
*/5 * * * * root cd /data/appstore/shell/monitor/ && python UserdataServiceMonitor.py >> /var/log/monitor.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python AppStoreLogMonitor.py >> /var/log/monitor.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python ProcessAliveMonitor.py >> /var/log/monitor.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python DataMonitor.py >> /var/log/monitor.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python DiskMonitor.py >> /var/log/monitor.log 2>&1
*/5 * * * * root cd /data/appstore/shell/monitor/ && python CheckFolderSize.py >> /var/log/monitor.log 2>&1
#1 17 * * * root cd /data/appstore/shell/monitor/ && python ClearLogs.py >> /var/log/monitor.log 2>&1
/etc/cron.d/thrift_watch
*/1 * * * * root /usr/local/bin/thrift_watch > /var/log/thrift_watch 2>&1
/var/spool/cron/root
0 19 * * * /usr/sbin/logrotate -v /etc/logrotate.d/nginx-match
#定期删除bakuplog
0 6 * * * sh /data/appstore/shell/rmlog.sh
#每隔1分钟监控一次scan transfer 并发送告警邮件
*/1 * * * * sh /data/appstore/shell/monitor_scan_transfer.sh
```
## 日志压缩
```
nginx-match
/data/appstore/nginx/logs/match.log
/data/appstore/nginx/logs/error.log
/data/appstore/nginx/logs/storedatasync-ad-survey-access.log
/data/appstore/nginx/logs/storedatasync-ad-survey-error.log
php-fpm
/var/log/php-fpm/*log
```
\ No newline at end of file
## 基本信息
- 192.168.30.66 180.184.61.54
- 集中发送邮件
## 集中发送邮件
- `/data/ops-notify`
- 代码在git上
\ No newline at end of file
## 基本信息
- 2台服务器
- adx-trace
- ssp-notify
## adx 广告通知
- `/data/adx/release/adx-trace`
- systemctl 常驻
## ssp nginx 通知后续处理
- `/data/adx/release/ssp-notify`
- systemctl 常驻
## 完整定时任务
-
## 日志压缩
-
\ No newline at end of file
## 命令
- 所用线程堆栈信息 `thread apply all bt`
## 技巧
- gdb重启,在命令里执行:kill,然后run
- 按 Ctrl-X 再按 A,就会出现一个窗口可以查看源代码
- 打印完整字符串:set print elements 0
- gdb中设置参数:set args
- `gdb --batch --pid 5664 --ex 'call malloc_stats()'` 内存信息
### 打印关键信息
```
set print elements 0
p _ppt->m_par_ori
```
### nginx core dump
```
nginx.conf
worker_rlimit_core 2048m;
working_directory core_files;
主要保证 nginx 路径下,存在 core_files 文件夹,且注意文件夹权限。
系统 /etc/security/limits.conf
* soft core unlimited
* hard core unlimited
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment