autoDeploy/startDataCenter.sh

63 lines
1.3 KiB
Bash
Raw Normal View History

2025-02-25 21:52:14 +08:00
#!/bin/bash
PATH=$PATH:/usr/bin/:/usr/local/bin/:/usr/sbin
dataCenterPath=$1
profile=$2
jars=( \
data-metadata-collect-fileset\
data-metadata-collect\
data-metadata-collect\
data-metadata-dic\
data-metadata-group\
data-metadata-mapping\
data-metadata-model\
data-sources\
data-standard\
data-metadata-interface\
data-asset\
data-quality\
)
function startModule()
{
moduleName=$1
if [ ! -f jars/"${moduleName}.jar" ];then
echo "startDtaCenter 文件 jars/${moduleName}.jar 不存在1!"
else
#${JAVA_HOME}bin/java -Xms256m -Xmx512m -Xss512K -Dspring.profiles.active=${profile} -Dspring.config.location=file:${dataCenterPath}/config/ -jar jars/${moduleName}.jar &
/usr/bin/java -Dspring.profiles.active=${profile} -jar jars/${moduleName}.jar &
# > logs/${moduleName}.log &
echo "${!}" > pids/common/${moduleName}.pid
fi
sleep 1
}
function checkDir()
{
directory_path=$1
if [ ! -d "$directory_path" ]; then
echo "目录不存在,正在创建..."
mkdir -p "$directory_path"
echo "目录创建成功!"
else
echo "目录已经存在。"
fi
}
function main(){
cd ${dataCenterPath}
checkDir "logs"
checkDir "pids"
for jar in ${jars[@]}
do
startModule $jar
done
}
main