waterdrop应用提交命令
./bin/start-waterdrop.sh --master yarn --deploy-mode client --config ./config/test.conf
如果我们通过azkaban调度,可能会有大量的waterdrop配置文件,但是有很多参数是放在azkaban的配置文件之中,所以我们需要把azkaban的配置文件中的参数传递到waterdrop的conf文件中.
first.job
type=command
command=echo "start ..."
dependencies=bas
command=sh res/first.sh "${hostName}"
first.sh
echo '
spark {
......
}
input {
elasticsearch {
hosts = $1 #这里的$1代表着es的host地址
.....
}
}
filter {
}
' > first.conf
./bin/start-waterdrop.sh --master yarn --deploy-mode client --config ./first.conf
也就是不通过直接编写文件,而是在shell中通过
echo ' ' > 文件
命令将shell脚本的输入的参数输出到文件,就可以完成waterdrop的配置文件外部传参
echo后面跟单引号或者双引号都可以,但是如果跟的双引号,并且内容之中有也有双引号,那么要对内容中的双引号进行转义
echo " 他说\"你好\""
或者用单引号
echo ' 他说"你好" '