|
@@ -26,6 +26,18 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
txt="''"
|
|
|
fi
|
|
|
|
|
|
+declare -A workersGroupMap=()
|
|
|
+
|
|
|
+workersGroup=(${workers//,/ })
|
|
|
+for workerGroup in ${workersGroup[@]}
|
|
|
+do
|
|
|
+ echo $workerGroup;
|
|
|
+ worker=`echo $workerGroup|awk -F':' '{print $1}'`
|
|
|
+ groupName=`echo $workerGroup|awk -F':' '{print $2}'`
|
|
|
+ workersGroupMap+=([$worker]=$groupName)
|
|
|
+done
|
|
|
+
|
|
|
+
|
|
|
hostsArr=(${ips//,/ })
|
|
|
for host in ${hostsArr[@]}
|
|
|
do
|
|
@@ -39,9 +51,9 @@ do
|
|
|
|
|
|
for dsDir in bin conf lib script sql ui install.sh
|
|
|
do
|
|
|
- # if worker in workersGroup
|
|
|
- if [[ "${workersGroup[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
|
|
|
- sed -i ${txt} "s#worker.group.*#worker.group=${workersGroup[${host}]}#g" ${dsDir}/worker.properties
|
|
|
+ # if worker in workersGroupMap
|
|
|
+ if [[ "${workersGroupMap[${host}]}" ]] && [[ "${dsDir}" == "conf" ]]; then
|
|
|
+ sed -i ${txt} "s#worker.group.*#worker.group=${workersGroupMap[${host}]}#g" ${dsDir}/worker.properties
|
|
|
fi
|
|
|
|
|
|
echo "start to scp $dsDir to $host/$installPath"
|