zhangjf 734dafe975 docs: 新增单机部署文档和服务部署脚本
包含内容:
- 单机部署文档(环境安装、数据库初始化、服务部署指南)
- 9个微服务的启动/停止/重启脚本
- 一键启动/停止/重启所有服务脚本
- 服务状态查看脚本
- 日志统一存放在/datacfs/applogs/服务名称目录
2026-02-22 13:48:23 +08:00

42 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# 查看所有服务状态
DEPLOY_HOME="/opt/fundplatform/deploy"
SERVICES=(
"fund-gateway:8000"
"fund-sys:8100"
"fund-cust:8200"
"fund-proj:8300"
"fund-req:8400"
"fund-exp:8500"
"fund-receipt:8600"
"fund-report:8700"
"fund-file:8800"
)
echo "=========================================="
echo " Service Status"
echo "=========================================="
printf "%-20s %-10s %-10s %s\n" "Service" "Port" "Status" "PID"
echo "------------------------------------------"
for item in "${SERVICES[@]}"; do
service="${item%%:*}"
port="${item##*:}"
pid_file="${DEPLOY_HOME}/${service}/${service}.pid"
if [ -f "$pid_file" ]; then
PID=$(cat $pid_file)
if ps -p $PID > /dev/null 2>&1; then
printf "%-20s %-10s \033[32m%-10s\033[0m %s\n" "$service" "$port" "RUNNING" "$PID"
else
printf "%-20s %-10s \033[31m%-10s\033[0m %s\n" "$service" "$port" "STOPPED" "-"
fi
else
printf "%-20s %-10s \033[31m%-10s\033[0m %s\n" "$service" "$port" "STOPPED" "-"
fi
done
echo "=========================================="