This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
galaxy-deployment-k8s/storm/topo/storm_topology/completion/alone/startall.sh
2020-05-25 16:48:37 +08:00

35 lines
1.1 KiB
Bash
Executable File

#! /bin/bash
#启动storm任务脚本
#任务jar所在目录
BASE_DIR=$2
#jar name
JAR_NAME='log-stream-completion.jar'
#nimbus ip
LOCAL_IP=$3
cd $BASE_DIR
function read_dir(){
for file in `ls $1` #注意此处这是两个反引号,表示运行系统命令
do
if [ -d $1"/"$file ] #注意此处之间一定要加上空格,否则会报错
then
read_dir $1"/"$file
else
jar -xvf $BASE_DIR/$JAR_NAME service_flow_config.properties
cat $1$file > $BASE_DIR/service_flow_config.properties
sed -i 's/ipaddress/'$LOCAL_IP'/' $BASE_DIR/service_flow_config.properties
jar -uvf $BASE_DIR/$JAR_NAME service_flow_config.properties
kubectl exec -c k8s-nimbus nimbus-0 -n default -- storm jar /opt/test/topo/storm_topology/completion/alone/$JAR_NAME cn.ac.iie.topology.LogFlowWriteTopology TEST1 remote
fi
done
}
if [ $# != 3 ];then
echo "usage: ./startall.sh [Configuration path] [Path of jar] [nimbus ip]"
exit 1
fi
#读取第一个参数 为配置文件目录名称
read_dir $1