java-mall/README.MD

106 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

项目启动顺序:
mall-gateway
mall-auth
mall-account
mall-admin
mall-shop
mall-sns
mall-pay
mall-cms
mall-search
mall-im
cd /data/sh
./mall-gateway.sh
./mall-auth.sh
./mall-account.sh
./mall-admin.sh
./mall-shop.sh
./mall-sns.sh
./mall-pay.sh
./mall-cms.sh
./mall-search.sh
./mall-im.sh
微信支付配置
{
"mchid": 商户ID,
"key": "商户API秘钥",
"wechat_app_id": "公众号开发者ID",
"wechat_app_secret": "公众号开发者密码",
"wechat_xcx_app_id": "小程序开发者ID",
"wechat_xcx_app_secret": "小程序开发者秘钥",
"weixin_app_id": "开放平台移动应用开发者ID",
"weixin_app_key": "开放平台移动应用开发者密钥",
"weixin_mchid": 商户ID,
"weixin_key": "商户API秘钥",
"apiclient_cert": "apiclient_cert.pem",
"sslkey_name": "apiclient_key.pem"
}
手动备份数据库
```shell
进入 docker 控制台
cd /var/lib/mysql
mysqldump -u root -p mall_prod | gzip > mall_prod_20250729.sql.gz
在宿主机找到:
/data/mysql/data/mall_prod_20250729.sql.gz
```
清除 docker 日志
查看哪个文件夹占空间
du -sh * | sort -h
cd /data/docker/overlay2
查看哪个文件夹占空间
du -sh * | sort -h
### 删除 docker 产生的日志文件update:2025-05-21
* 避免误删: 先用 -print 参数预览匹配的文件,确认无误后再执行 -delete
* 删除 7 天前
``` bash
-- 打印所有匹配文件路径
find /data/docker/overlay2 -type f \( \
-name "*.log" \
-o -name "*.log.[0-9]*" \
-o -name "*.log.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" \
\) -not \( \
-name "mysql*.log*" \
-o -name "*.idx" \
-o -name "*.lck" \
-o -name "*.js" \
-o -name "*.yml" \
-o -name "*.toml" \
-o -name "*.gz" \
-o -name "*mysql*" \
\) -print
-- 删除 7 天前的日志文件
find /data/docker/overlay2 -type f \( \
-name "*.log" \
-o -name "*.log.[0-9]*" \
-o -name "*.log.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" \
\) -not \( \
-name "mysql*.log*" \
-o -name "*.idx" \
-o -name "*.lck" \
-o -name "*.js" \
-o -name "*.yml" \
-o -name "*.toml" \
-o -name "*.gz" \
-o -name "*mysql*" \
\) -mtime +7 -delete
```
```shell
# 截断所有容器日志
docker ps -q | while read container_id; do
log_file=$(docker inspect --format='{{.LogPath}}' "$container_id")
[ -f "$log_file" ] && truncate -s 0 "$log_file"
done
```