|
@@ -0,0 +1,310 @@
|
|
|
+
|
|
|
+
|
|
|
+workDir=`/opt/easyscheduler`
|
|
|
+workDir=`cd ${workDir};pwd`
|
|
|
+
|
|
|
+
|
|
|
+txt=""
|
|
|
+if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
+
|
|
|
+ txt="''"
|
|
|
+elif [[ "$OSTYPE" == "linux-gnu" ]]; then
|
|
|
+
|
|
|
+ txt=""
|
|
|
+elif [[ "$OSTYPE" == "cygwin" ]]; then
|
|
|
+
|
|
|
+ echo "Easy Scheduler not support Windows operating system"
|
|
|
+ exit 1
|
|
|
+elif [[ "$OSTYPE" == "msys" ]]; then
|
|
|
+
|
|
|
+ echo "Easy Scheduler not support Windows operating system"
|
|
|
+ exit 1
|
|
|
+elif [[ "$OSTYPE" == "win32" ]]; then
|
|
|
+ echo "Easy Scheduler not support Windows operating system"
|
|
|
+ exit 1
|
|
|
+elif [[ "$OSTYPE" == "freebsd"* ]]; then
|
|
|
+
|
|
|
+ txt=""
|
|
|
+else
|
|
|
+
|
|
|
+ echo "Operating system unknown, please tell us(submit issue) for better service"
|
|
|
+ exit 1
|
|
|
+fi
|
|
|
+
|
|
|
+source ${workDir}/conf/config/run_config.conf
|
|
|
+source ${workDir}/conf/config/install_config.conf
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+mysqlHost="127.0.0.1:3306"
|
|
|
+
|
|
|
+
|
|
|
+mysqlDb="easyscheduler"
|
|
|
+
|
|
|
+
|
|
|
+mysqlUserName="easyscheduler"
|
|
|
+
|
|
|
+
|
|
|
+mysqlPassword="easyschedulereasyscheduler"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+installPath="/opt/easyscheduler"
|
|
|
+
|
|
|
+
|
|
|
+deployUser="escheduler"
|
|
|
+
|
|
|
+
|
|
|
+zkQuorum="192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181"
|
|
|
+
|
|
|
+
|
|
|
+ips="ark0,ark1,ark2,ark3,ark4"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+masters="ark0,ark1"
|
|
|
+
|
|
|
+
|
|
|
+workers="ark2,ark3,ark4"
|
|
|
+
|
|
|
+
|
|
|
+alertServer="ark3"
|
|
|
+
|
|
|
+
|
|
|
+apiServers="ark1"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+mailProtocol="SMTP"
|
|
|
+
|
|
|
+
|
|
|
+mailServerHost="smtp.exmail.qq.com"
|
|
|
+
|
|
|
+
|
|
|
+mailServerPort="25"
|
|
|
+
|
|
|
+
|
|
|
+mailSender="xxxxxxxxxx"
|
|
|
+
|
|
|
+
|
|
|
+mailPassword="xxxxxxxxxx"
|
|
|
+
|
|
|
+
|
|
|
+xlsFilePath="/tmp/xls"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+hdfsStartupSate="false"
|
|
|
+
|
|
|
+
|
|
|
+namenodeFs="hdfs://mycluster:8020"
|
|
|
+
|
|
|
+
|
|
|
+yarnHaIps="192.168.xx.xx,192.168.xx.xx"
|
|
|
+
|
|
|
+
|
|
|
+singleYarnIp="ark1"
|
|
|
+
|
|
|
+
|
|
|
+hdfsPath="/escheduler"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+programPath="/tmp/escheduler"
|
|
|
+
|
|
|
+
|
|
|
+downloadPath="/tmp/escheduler/download"
|
|
|
+
|
|
|
+
|
|
|
+execPath="/tmp/escheduler/exec"
|
|
|
+
|
|
|
+
|
|
|
+shellEnvPath="$installPath/conf/env/.escheduler_env.sh"
|
|
|
+
|
|
|
+
|
|
|
+pythonEnvPath="$installPath/conf/env/escheduler_env.py"
|
|
|
+
|
|
|
+
|
|
|
+resSuffixs="txt,log,sh,conf,cfg,py,java,sql,hql,xml"
|
|
|
+
|
|
|
+
|
|
|
+devState="true"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+zkRoot="/escheduler"
|
|
|
+
|
|
|
+
|
|
|
+zkDeadServers="/escheduler/dead-servers"
|
|
|
+
|
|
|
+
|
|
|
+zkMasters="/escheduler/masters"
|
|
|
+
|
|
|
+
|
|
|
+zkWorkers="/escheduler/workers"
|
|
|
+
|
|
|
+
|
|
|
+mastersLock="/escheduler/lock/masters"
|
|
|
+
|
|
|
+
|
|
|
+workersLock="/escheduler/lock/workers"
|
|
|
+
|
|
|
+
|
|
|
+mastersFailover="/escheduler/lock/failover/masters"
|
|
|
+
|
|
|
+
|
|
|
+workersFailover="/escheduler/lock/failover/masters"
|
|
|
+
|
|
|
+
|
|
|
+zkSessionTimeout="300"
|
|
|
+
|
|
|
+
|
|
|
+zkConnectionTimeout="300"
|
|
|
+
|
|
|
+
|
|
|
+zkRetrySleep="100"
|
|
|
+
|
|
|
+
|
|
|
+zkRetryMaxtime="5"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+masterExecThreads="100"
|
|
|
+
|
|
|
+
|
|
|
+masterExecTaskNum="20"
|
|
|
+
|
|
|
+
|
|
|
+masterHeartbeatInterval="10"
|
|
|
+
|
|
|
+
|
|
|
+masterTaskCommitRetryTimes="5"
|
|
|
+
|
|
|
+
|
|
|
+masterTaskCommitInterval="100"
|
|
|
+
|
|
|
+
|
|
|
+masterMaxCupLoadAvg="10"
|
|
|
+
|
|
|
+
|
|
|
+masterReservedMemory="1"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+workerExecThreads="100"
|
|
|
+
|
|
|
+
|
|
|
+workerHeartbeatInterval="10"
|
|
|
+
|
|
|
+
|
|
|
+workerFetchTaskNum="10"
|
|
|
+
|
|
|
+
|
|
|
+workerMaxCupLoadAvg="10"
|
|
|
+
|
|
|
+
|
|
|
+workerReservedMemory="1"
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+apiServerPort="12345"
|
|
|
+
|
|
|
+
|
|
|
+apiServerSessionTimeout="7200"
|
|
|
+
|
|
|
+
|
|
|
+apiServerContextPath="/escheduler/"
|
|
|
+
|
|
|
+
|
|
|
+springMaxFileSize="1024MB"
|
|
|
+
|
|
|
+
|
|
|
+springMaxRequestSize="1024MB"
|
|
|
+
|
|
|
+
|
|
|
+apiMaxHttpPostSize="5000000"
|
|
|
+
|
|
|
+
|
|
|
+echo "1,替换文件"
|
|
|
+sed -i ${txt} "s#spring.datasource.url.*#spring.datasource.url=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/dao/data_source.properties
|
|
|
+sed -i ${txt} "s#spring.datasource.username.*#spring.datasource.username=${mysqlUserName}#g" conf/dao/data_source.properties
|
|
|
+sed -i ${txt} "s#spring.datasource.password.*#spring.datasource.password=${mysqlPassword}#g" conf/dao/data_source.properties
|
|
|
+
|
|
|
+sed -i ${txt} "s#org.quartz.dataSource.myDs.URL.*#org.quartz.dataSource.myDs.URL=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/quartz.properties
|
|
|
+sed -i ${txt} "s#org.quartz.dataSource.myDs.user.*#org.quartz.dataSource.myDs.user=${mysqlUserName}#g" conf/quartz.properties
|
|
|
+sed -i ${txt} "s#org.quartz.dataSource.myDs.password.*#org.quartz.dataSource.myDs.password=${mysqlPassword}#g" conf/quartz.properties
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#fs.defaultFS.*#fs.defaultFS=${namenodeFs}#g" conf/common/hadoop/hadoop.properties
|
|
|
+sed -i ${txt} "s#yarn.resourcemanager.ha.rm.ids.*#yarn.resourcemanager.ha.rm.ids=${yarnHaIps}#g" conf/common/hadoop/hadoop.properties
|
|
|
+sed -i ${txt} "s#yarn.application.status.address.*#yarn.application.status.address=http://${singleYarnIp}:8088/ws/v1/cluster/apps/%s#g" conf/common/hadoop/hadoop.properties
|
|
|
+
|
|
|
+sed -i ${txt} "s#data.basedir.path.*#data.basedir.path=${programPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#data.download.basedir.path.*#data.download.basedir.path=${downloadPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#process.exec.basepath.*#process.exec.basepath=${execPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#data.store2hdfs.basepath.*#data.store2hdfs.basepath=${hdfsPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#hdfs.startup.state.*#hdfs.startup.state=${hdfsStartupSate}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#escheduler.env.path.*#escheduler.env.path=${shellEnvPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#escheduler.env.py.*#escheduler.env.py=${pythonEnvPath}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#resource.view.suffixs.*#resource.view.suffixs=${resSuffixs}#g" conf/common/common.properties
|
|
|
+sed -i ${txt} "s#development.state.*#development.state=${devState}#g" conf/common/common.properties
|
|
|
+
|
|
|
+sed -i ${txt} "s#zookeeper.quorum.*#zookeeper.quorum=${zkQuorum}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.root.*#zookeeper.escheduler.root=${zkRoot}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.dead.servers.*#zookeeper.escheduler.dead.servers=${zkDeadServers}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.masters.*#zookeeper.escheduler.masters=${zkMasters}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.workers.*#zookeeper.escheduler.workers=${zkWorkers}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.lock.masters.*#zookeeper.escheduler.lock.masters=${mastersLock}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.lock.workers.*#zookeeper.escheduler.lock.workers=${workersLock}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.lock.failover.masters.*#zookeeper.escheduler.lock.failover.masters=${mastersFailover}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.escheduler.lock.failover.workers.*#zookeeper.escheduler.lock.failover.workers=${workersFailover}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.session.timeout.*#zookeeper.session.timeout=${zkSessionTimeout}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.connection.timeout.*#zookeeper.connection.timeout=${zkConnectionTimeout}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.retry.sleep.*#zookeeper.retry.sleep=${zkRetrySleep}#g" conf/zookeeper.properties
|
|
|
+sed -i ${txt} "s#zookeeper.retry.maxtime.*#zookeeper.retry.maxtime=${zkRetryMaxtime}#g" conf/zookeeper.properties
|
|
|
+
|
|
|
+sed -i ${txt} "s#master.exec.threads.*#master.exec.threads=${masterExecThreads}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.exec.task.number.*#master.exec.task.number=${masterExecTaskNum}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.heartbeat.interval.*#master.heartbeat.interval=${masterHeartbeatInterval}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.task.commit.retryTimes.*#master.task.commit.retryTimes=${masterTaskCommitRetryTimes}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.task.commit.interval.*#master.task.commit.interval=${masterTaskCommitInterval}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.max.cpuload.avg.*#master.max.cpuload.avg=${masterMaxCupLoadAvg}#g" conf/master.properties
|
|
|
+sed -i ${txt} "s#master.reserved.memory.*#master.reserved.memory=${masterReservedMemory}#g" conf/master.properties
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#worker.exec.threads.*#worker.exec.threads=${workerExecThreads}#g" conf/worker.properties
|
|
|
+sed -i ${txt} "s#worker.heartbeat.interval.*#worker.heartbeat.interval=${workerHeartbeatInterval}#g" conf/worker.properties
|
|
|
+sed -i ${txt} "s#worker.fetch.task.num.*#worker.fetch.task.num=${workerFetchTaskNum}#g" conf/worker.properties
|
|
|
+sed -i ${txt} "s#worker.max.cpuload.avg.*#worker.max.cpuload.avg=${workerMaxCupLoadAvg}#g" conf/worker.properties
|
|
|
+sed -i ${txt} "s#worker.reserved.memory.*#worker.reserved.memory=${workerReservedMemory}#g" conf/worker.properties
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#server.port.*#server.port=${apiServerPort}#g" conf/application.properties
|
|
|
+sed -i ${txt} "s#server.session.timeout.*#server.session.timeout=${apiServerSessionTimeout}#g" conf/application.properties
|
|
|
+sed -i ${txt} "s#server.context-path.*#server.context-path=${apiServerContextPath}#g" conf/application.properties
|
|
|
+sed -i ${txt} "s#spring.http.multipart.max-file-size.*#spring.http.multipart.max-file-size=${springMaxFileSize}#g" conf/application.properties
|
|
|
+sed -i ${txt} "s#spring.http.multipart.max-request-size.*#spring.http.multipart.max-request-size=${springMaxRequestSize}#g" conf/application.properties
|
|
|
+sed -i ${txt} "s#server.max-http-post-size.*#server.max-http-post-size=${apiMaxHttpPostSize}#g" conf/application.properties
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#mail.protocol.*#mail.protocol=${mailProtocol}#g" conf/alert.properties
|
|
|
+sed -i ${txt} "s#mail.server.host.*#mail.server.host=${mailServerHost}#g" conf/alert.properties
|
|
|
+sed -i ${txt} "s#mail.server.port.*#mail.server.port=${mailServerPort}#g" conf/alert.properties
|
|
|
+sed -i ${txt} "s#mail.sender.*#mail.sender=${mailSender}#g" conf/alert.properties
|
|
|
+sed -i ${txt} "s#mail.passwd.*#mail.passwd=${mailPassword}#g" conf/alert.properties
|
|
|
+sed -i ${txt} "s#xls.file.path.*#xls.file.path=${xlsFilePath}#g" conf/alert.properties
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#installPath.*#installPath=${installPath}#g" conf/config/install_config.conf
|
|
|
+sed -i ${txt} "s#deployUser.*#deployUser=${deployUser}#g" conf/config/install_config.conf
|
|
|
+sed -i ${txt} "s#ips.*#ips=${ips}#g" conf/config/install_config.conf
|
|
|
+
|
|
|
+
|
|
|
+sed -i ${txt} "s#masters.*#masters=${masters}#g" conf/config/run_config.conf
|
|
|
+sed -i ${txt} "s#workers.*#workers=${workers}#g" conf/config/run_config.conf
|
|
|
+sed -i ${txt} "s#alertServer.*#alertServer=${alertServer}#g" conf/config/run_config.conf
|
|
|
+sed -i ${txt} "s#apiServers.*#apiServers=${apiServers}#g" conf/config/run_config.conf
|