Browse Source

修改sh

pull/1/head
dailidong 6 years ago
parent
commit
ffdab1baf8
  1. 2
      escheduler-common/src/main/resources/bin/escheduler-daemon.sh
  2. 338
      install.sh
  3. 2
      script/scp_hosts.sh
  4. 3
      script/start_all.sh
  5. 4
      script/stop_all.sh

2
escheduler-common/src/main/resources/bin/escheduler-daemon.sh

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
usage="Usage: escheduler-daemon.sh (start|stop) <command> "

338
install.sh

@ -1,91 +1,92 @@
#!/bin/bash
#!/bin/sh
workDir=`dirname $0`
workDir=`cd ${workDir};pwd`
source $workDir/conf/config/run_config.conf
source $workDir/conf/config/install_config.conf
wokDir=`dirname $0`
wokDir=`cd ${wokDir};pwd`
source ${wokDir}/conf/config/run_config.conf
source ${wokDir}/conf/config/install_config.conf
# mysql配置
# mysql 地址,端口
mysqlHost="192.168.xx.xx:3306"
# mysql 数据库名称
mysqlDb="escheduler"
mysqlDb="eschedule"
# mysql 用户名
mysqlUserName="xx"
mysqlUseName="xx"
# mysql 密码
mysqlPassword="xx"
mysqlPasswod="xx"
# hadoop 配置
# namenode地址,支持HA,需要将core-site.xml和hdfs-site.xml放到conf目录下
namenodeFs="hdfs://mycluster:8020"
# namenode地址,支持HA,需要将coe-site.xml和hdfs-site.xml放到conf目录下
namenodeFs="hdfs://mycluste:8020"
# resourcemanager HA配置,如果是单resourcemanager,这里为空即可
yarnHaIps="192.168.xx.xx,192.168.xx.xx"
# esourcemanager HA配置,如果是单resourcemanager,这里为空即可
yanHaIps="192.168.xx.xx,192.168.xx.xx"
# 如果是单 resourcemanager,只需要配置一个主机名称,如果是resourcemanager HA,则默认配置就好
singleYarnIp="ark1"
# 如果是单 esourcemanager,只需要配置一个主机名称,如果是resourcemanager HA,则默认配置就好
singleYanIp="ark1"
# common 配置
# 程序路径
programPath="/tmp/escheduler"
pogramPath="/tmp/escheduler"
#下载路径
downloadPath="/tmp/escheduler/download"
downloadPath="/tmp/eschedule/download"
# 任务执行路径
execPath="/tmp/escheduler/exec"
execPath="/tmp/eschedule/exec"
# hdfs根路径
hdfsPath="/escheduler"
hdfsPath="/eschedule"
# 是否启动hdfs,如果启动则为true,不启动设置为false
hdfsStartupSate="true"
# 是否启动hdfs,如果启动则为tue,不启动设置为false
hdfsStatupSate="true"
# SHELL环境变量路径
shellEnvPath="/opt/.escheduler_env.sh"
shellEnvPath="/opt/.eschedule_env.sh"
# Python换将变量路径
pythonEnvPath="/opt/escheduler_env.py"
pythonEnvPath="/opt/eschedule_env.py"
# 资源文件的后缀
resSuffixs="txt,log,sh,conf,cfg,py,java,sql,hql,xml"
esSuffixs="txt,log,sh,conf,cfg,py,java,sql,hql,xml"
# 开发状态,如果是true,对于SHELL脚本可以在execPath目录下查看封装后的SHELL脚本,如果是false则执行完成直接删除
devState="true"
# 开发状态,如果是tue,对于SHELL脚本可以在execPath目录下查看封装后的SHELL脚本,如果是false则执行完成直接删除
devState="tue"
# zk 配置
# zk集群
zkQuorum="192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181"
zkQuoum="192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181"
# zk根目录
zkRoot="/escheduler"
zkRoot="/eschedule"
# 用来记录挂掉机器的zk目录
zkDeadServers="/escheduler/dead-servers"
zkDeadSevers="/escheduler/dead-servers"
# masters目录
zkMasters="/escheduler/masters"
# mastes目录
zkMastes="/escheduler/masters"
# workers目录
zkWorkers="/escheduler/workers"
# wokers目录
zkWokers="/escheduler/workers"
# zk master分布式锁
mastersLock="/escheduler/lock/masters"
# zk maste分布式锁
mastesLock="/escheduler/lock/masters"
# zk worker分布式锁
workersLock="/escheduler/lock/workers"
# zk woker分布式锁
wokersLock="/escheduler/lock/workers"
# zk master容错分布式锁
mastersFailover="/escheduler/lock/failover/masters"
# zk maste容错分布式锁
mastesFailover="/escheduler/lock/failover/masters"
# zk worker容错分布式锁
workersFailover="/escheduler/lock/failover/masters"
# zk woker容错分布式锁
wokersFailover="/escheduler/lock/failover/masters"
# zk session 超时
zkSessionTimeout="300"
@ -94,198 +95,198 @@ zkSessionTimeout="300"
zkConnectionTimeout="300"
# zk 重试间隔
zkRetrySleep="100"
zkRetySleep="100"
# zk重试最大次数
zkRetryMaxtime="5"
zkRetyMaxtime="5"
# master 配置
# master执行线程最大数,流程实例的最大并行度
masterExecThreads="100"
# maste 配置
# maste执行线程最大数,流程实例的最大并行度
masteExecThreads="100"
# master任务执行线程最大数,每一个流程实例的最大并行度
masterExecTaskNum="20"
# maste任务执行线程最大数,每一个流程实例的最大并行度
masteExecTaskNum="20"
# master心跳间隔
masterHeartbeatInterval="10"
# maste心跳间隔
masteHeartbeatInterval="10"
# master任务提交重试次数
masterTaskCommitRetryTimes="5"
# maste任务提交重试次数
masteTaskCommitRetryTimes="5"
# master任务提交重试时间间隔
masterTaskCommitInterval="100"
# maste任务提交重试时间间隔
masteTaskCommitInterval="100"
# master最大cpu平均负载,用来判断master是否还有执行能力
masterMaxCupLoadAvg="10"
# maste最大cpu平均负载,用来判断master是否还有执行能力
masteMaxCupLoadAvg="10"
# master预留内存,用来判断master是否还有执行能力
masterReservedMemory="1"
# maste预留内存,用来判断master是否还有执行能力
masteReservedMemory="1"
# worker 配置
# worker执行线程
workerExecThreads="100"
# woker 配置
# woker执行线程
wokerExecThreads="100"
# worker心跳间隔
workerHeartbeatInterval="10"
# woker心跳间隔
wokerHeartbeatInterval="10"
# worker一次抓取任务数
workerFetchTaskNum="10"
# woker一次抓取任务数
wokerFetchTaskNum="10"
# worker最大cpu平均负载,用来判断master是否还有执行能力
workerMaxCupLoadAvg="10"
# woker最大cpu平均负载,用来判断master是否还有执行能力
wokerMaxCupLoadAvg="10"
# worker预留内存,用来判断master是否还有执行能力
workerReservedMemory="1"
# woker预留内存,用来判断master是否还有执行能力
wokerReservedMemory="1"
# api 配置
# api 服务端口
apiServerPort="12345"
apiSeverPort="12345"
# api session 超时
apiServerSessionTimeout="7200"
apiSeverSessionTimeout="7200"
# api 上下文路径
apiServerContextPath="/escheduler/"
apiSeverContextPath="/escheduler/"
# spring 最大文件大小
springMaxFileSize="1024MB"
# sping 最大文件大小
spingMaxFileSize="1024MB"
# spring 最大请求文件大小
springMaxRequestSize="1024MB"
# sping 最大请求文件大小
spingMaxRequestSize="1024MB"
# api 最大post请求大小
apiMaxHttpPostSize="5000000"
# alert配置
# alet配置
# 邮件协议
mailProtocol="SMTP"
mailPotocol="SMTP"
# 邮件服务host
mailServerHost="smtp.exmail.qq.com"
mailSeverHost="smtp.exmail.qq.com"
# 邮件服务端口
mailServerPort="25"
mailSeverPort="25"
# 发送人
mailSender="xxxxxxxxxx"
mailSende="xxxxxxxxxx"
# 发送人密码
mailPassword="xxxxxxxxxx"
mailPasswod="xxxxxxxxxx"
# 下载Excel路径
xlsFilePath="/opt/xls"
# conf/config/install_config.conf配置
# 安装路径
installPath="/data1_1T/escheduler"
installPath="/data1_1T/eschedule"
# 部署用户
deployUser="escheduler"
deployUse="escheduler"
# 安装hosts
ips="ark0,ark1,ark2,ark3,ark4"
ips="ak0,ark1,ark2,ark3,ark4"
# conf/config/run_config.conf配置
# 运行Master的机器
masters="ark0,ark1"
# conf/config/un_config.conf配置
# 运行Maste的机器
mastes="ark0,ark1"
# 运行Worker的机器
workers="ark2,ark3,ark4"
# 运行Woker的机器
wokers="ark2,ark3,ark4"
# 运行Alert的机器
alertServer="ark3"
# 运行Alet的机器
aletServer="ark3"
# 运行Api的机器
apiServers="ark1"
apiSevers="ark1"
# 1,替换文件
echo "1,替换文件"
sed -i "s#spring.datasource.url.*#spring.datasource.url=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/dao/data_source.properties
sed -i "s#spring.datasource.username.*#spring.datasource.username=${mysqlUserName}#g" conf/dao/data_source.properties
sed -i "s#spring.datasource.password.*#spring.datasource.password=${mysqlPassword}#g" conf/dao/data_source.properties
sed -i '' "s#sping.datasource.url.*#spring.datasource.url=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/dao/data_source.properties
sed -i '' "s#sping.datasource.username.*#spring.datasource.username=${mysqlUserName}#g" conf/dao/data_source.properties
sed -i '' "s#sping.datasource.password.*#spring.datasource.password=${mysqlPassword}#g" conf/dao/data_source.properties
sed -i "s#org.quartz.dataSource.myDs.URL.*#org.quartz.dataSource.myDs.URL=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/quartz.properties
sed -i "s#org.quartz.dataSource.myDs.user.*#org.quartz.dataSource.myDs.user=${mysqlUserName}#g" conf/quartz.properties
sed -i "s#org.quartz.dataSource.myDs.password.*#org.quartz.dataSource.myDs.password=${mysqlPassword}#g" conf/quartz.properties
sed -i '' "s#og.quartz.dataSource.myDs.URL.*#org.quartz.dataSource.myDs.URL=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/quartz.properties
sed -i '' "s#og.quartz.dataSource.myDs.user.*#org.quartz.dataSource.myDs.user=${mysqlUserName}#g" conf/quartz.properties
sed -i '' "s#og.quartz.dataSource.myDs.password.*#org.quartz.dataSource.myDs.password=${mysqlPassword}#g" conf/quartz.properties
sed -i "s#fs.defaultFS.*#fs.defaultFS = ${namenodeFs}#g" conf/common/hadoop/hadoop.properties
sed -i "s#yarn.resourcemanager.ha.rm.ids.*#yarn.resourcemanager.ha.rm.ids=${yarnHaIps}#g" conf/common/hadoop/hadoop.properties
sed -i "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 '' "s#fs.defaultFS.*#fs.defaultFS = ${namenodeFs}#g" conf/common/hadoop/hadoop.properties
sed -i '' "s#yan.resourcemanager.ha.rm.ids.*#yarn.resourcemanager.ha.rm.ids=${yarnHaIps}#g" conf/common/hadoop/hadoop.properties
sed -i '' "s#yan.application.status.address.*#yarn.application.status.address=http://${singleYarnIp}:8088/ws/v1/cluster/apps/%s#g" conf/common/hadoop/hadoop.properties
sed -i "s#data.basedir.path.*#data.basedir.path=${programPath}#g" conf/common/common.properties
sed -i "s#data.download.basedir.path.*#data.download.basedir.path=${downloadPath}#g" conf/common/common.properties
sed -i "s#process.exec.basepath.*#process.exec.basepath=${execPath}#g" conf/common/common.properties
sed -i "s#data.store2hdfs.basepath.*#data.store2hdfs.basepath=${hdfsPath}#g" conf/common/common.properties
sed -i "s#hdfs.startup.state.*#hdfs.startup.state=${hdfsStartupSate}#g" conf/common/common.properties
sed -i "s#escheduler.env.path.*#escheduler.env.path=${shellEnvPath}#g" conf/common/common.properties
sed -i "s#escheduler.env.py.*#escheduler.env.py=${pythonEnvPath}#g" conf/common/common.properties
sed -i "s#resource.view.suffixs.*#resource.view.suffixs=${resSuffixs}#g" conf/common/common.properties
sed -i "s#development.state.*#development.state=${devState}#g" conf/common/common.properties
sed -i '' "s#data.basedi.path.*#data.basedir.path=${programPath}#g" conf/common/common.properties
sed -i '' "s#data.download.basedi.path.*#data.download.basedir.path=${downloadPath}#g" conf/common/common.properties
sed -i '' "s#pocess.exec.basepath.*#process.exec.basepath=${execPath}#g" conf/common/common.properties
sed -i '' "s#data.stoe2hdfs.basepath.*#data.store2hdfs.basepath=${hdfsPath}#g" conf/common/common.properties
sed -i '' "s#hdfs.statup.state.*#hdfs.startup.state=${hdfsStartupSate}#g" conf/common/common.properties
sed -i '' "s#eschedule.env.path.*#escheduler.env.path=${shellEnvPath}#g" conf/common/common.properties
sed -i '' "s#eschedule.env.py.*#escheduler.env.py=${pythonEnvPath}#g" conf/common/common.properties
sed -i '' "s#esource.view.suffixs.*#resource.view.suffixs=${resSuffixs}#g" conf/common/common.properties
sed -i '' "s#development.state.*#development.state=${devState}#g" conf/common/common.properties
sed -i "s#zookeeper.quorum.*#zookeeper.quorum=${zkQuorum}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.root.*#zookeeper.escheduler.root=${zkRoot}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.dead.servers.*#zookeeper.escheduler.dead.servers=${zkDeadServers}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.masters.*#zookeeper.escheduler.masters=${zkMasters}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.workers.*#zookeeper.escheduler.workers=${zkWorkers}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.lock.masters.*#zookeeper.escheduler.lock.masters=${mastersLock}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.lock.workers.*#zookeeper.escheduler.lock.workers=${workersLock}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.lock.masters.failover.*#zookeeper.escheduler.lock.masters.failover=${mastersFailover}#g" conf/zookeeper.properties
sed -i "s#zookeeper.escheduler.lock.workers.failover.*#zookeeper.escheduler.lock.workers.failover=${workersFailover}#g" conf/zookeeper.properties
sed -i "s#zookeeper.session.timeout.*#zookeeper.session.timeout=${zkSessionTimeout}#g" conf/zookeeper.properties
sed -i "s#zookeeper.connection.timeout.*#zookeeper.connection.timeout=${zkConnectionTimeout}#g" conf/zookeeper.properties
sed -i "s#zookeeper.retry.sleep.*#zookeeper.retry.sleep=${zkRetrySleep}#g" conf/zookeeper.properties
sed -i "s#zookeeper.retry.maxtime.*#zookeeper.retry.maxtime=${zkRetryMaxtime}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.quorum.*#zookeeper.quorum=${zkQuorum}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.root.*#zookeeper.escheduler.root=${zkRoot}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.dead.servers.*#zookeeper.escheduler.dead.servers=${zkDeadServers}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.masters.*#zookeeper.escheduler.masters=${zkMasters}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.workers.*#zookeeper.escheduler.workers=${zkWorkers}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.lock.masters.*#zookeeper.escheduler.lock.masters=${mastersLock}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.lock.workers.*#zookeeper.escheduler.lock.workers=${workersLock}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.lock.masters.failover.*#zookeeper.escheduler.lock.masters.failover=${mastersFailover}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.escheduler.lock.workers.failover.*#zookeeper.escheduler.lock.workers.failover=${workersFailover}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.session.timeout.*#zookeeper.session.timeout=${zkSessionTimeout}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.connection.timeout.*#zookeeper.connection.timeout=${zkConnectionTimeout}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.retry.sleep.*#zookeeper.retry.sleep=${zkRetrySleep}#g" conf/zookeeper.properties
sed -i '' "s#zookeepe.retry.maxtime.*#zookeeper.retry.maxtime=${zkRetryMaxtime}#g" conf/zookeeper.properties
sed -i "s#master.exec.threads.*#master.exec.threads=${masterExecThreads}#g" conf/master.properties
sed -i "s#master.exec.task.number.*#master.exec.task.number=${masterExecTaskNum}#g" conf/master.properties
sed -i "s#master.heartbeat.interval.*#master.heartbeat.interval=${masterHeartbeatInterval}#g" conf/master.properties
sed -i "s#master.task.commit.retryTimes.*#master.task.commit.retryTimes=${masterTaskCommitRetryTimes}#g" conf/master.properties
sed -i "s#master.task.commit.interval.*#master.task.commit.interval=${masterTaskCommitInterval}#g" conf/master.properties
sed -i "s#master.max.cpuload.avg.*#master.max.cpuload.avg=${masterMaxCupLoadAvg}#g" conf/master.properties
sed -i "s#master.reserved.memory.*#master.reserved.memory=${masterReservedMemory}#g" conf/master.properties
sed -i '' "s#maste.exec.threads.*#master.exec.threads=${masterExecThreads}#g" conf/master.properties
sed -i '' "s#maste.exec.task.number.*#master.exec.task.number=${masterExecTaskNum}#g" conf/master.properties
sed -i '' "s#maste.heartbeat.interval.*#master.heartbeat.interval=${masterHeartbeatInterval}#g" conf/master.properties
sed -i '' "s#maste.task.commit.retryTimes.*#master.task.commit.retryTimes=${masterTaskCommitRetryTimes}#g" conf/master.properties
sed -i '' "s#maste.task.commit.interval.*#master.task.commit.interval=${masterTaskCommitInterval}#g" conf/master.properties
sed -i '' "s#maste.max.cpuload.avg.*#master.max.cpuload.avg=${masterMaxCupLoadAvg}#g" conf/master.properties
sed -i '' "s#maste.reserved.memory.*#master.reserved.memory=${masterReservedMemory}#g" conf/master.properties
sed -i "s#worker.exec.threads.*#worker.exec.threads=${workerExecThreads}#g" conf/worker.properties
sed -i "s#worker.heartbeat.interval.*#worker.heartbeat.interval=${workerHeartbeatInterval}#g" conf/worker.properties
sed -i "s#worker.fetch.task.num.*#worker.fetch.task.num=${workerFetchTaskNum}#g" conf/worker.properties
sed -i "s#worker.max.cpuload.avg.*#worker.max.cpuload.avg=${workerMaxCupLoadAvg}#g" conf/worker.properties
sed -i "s#worker.reserved.memory.*#worker.reserved.memory=${workerReservedMemory}#g" conf/worker.properties
sed -i '' "s#woker.exec.threads.*#worker.exec.threads=${workerExecThreads}#g" conf/worker.properties
sed -i '' "s#woker.heartbeat.interval.*#worker.heartbeat.interval=${workerHeartbeatInterval}#g" conf/worker.properties
sed -i '' "s#woker.fetch.task.num.*#worker.fetch.task.num=${workerFetchTaskNum}#g" conf/worker.properties
sed -i '' "s#woker.max.cpuload.avg.*#worker.max.cpuload.avg=${workerMaxCupLoadAvg}#g" conf/worker.properties
sed -i '' "s#woker.reserved.memory.*#worker.reserved.memory=${workerReservedMemory}#g" conf/worker.properties
sed -i "s#server.port.*#server.port=${apiServerPort}#g" conf/application.properties
sed -i "s#server.session.timeout.*#server.session.timeout=${apiServerSessionTimeout}#g" conf/application.properties
sed -i "s#server.context-path.*#server.context-path=${apiServerContextPath}#g" conf/application.properties
sed -i "s#spring.http.multipart.max-file-size.*#spring.http.multipart.max-file-size=${springMaxFileSize}#g" conf/application.properties
sed -i "s#spring.http.multipart.max-request-size.*#spring.http.multipart.max-request-size=${springMaxRequestSize}#g" conf/application.properties
sed -i "s#server.max-http-post-size.*#server.max-http-post-size=${apiMaxHttpPostSize}#g" conf/application.properties
sed -i '' "s#sever.port.*#server.port=${apiServerPort}#g" conf/application.properties
sed -i '' "s#sever.session.timeout.*#server.session.timeout=${apiServerSessionTimeout}#g" conf/application.properties
sed -i '' "s#sever.context-path.*#server.context-path=${apiServerContextPath}#g" conf/application.properties
sed -i '' "s#sping.http.multipart.max-file-size.*#spring.http.multipart.max-file-size=${springMaxFileSize}#g" conf/application.properties
sed -i '' "s#sping.http.multipart.max-request-size.*#spring.http.multipart.max-request-size=${springMaxRequestSize}#g" conf/application.properties
sed -i '' "s#sever.max-http-post-size.*#server.max-http-post-size=${apiMaxHttpPostSize}#g" conf/application.properties
sed -i "s#mail.protocol.*#mail.protocol=${mailProtocol}#g" conf/alert.properties
sed -i "s#mail.server.host.*#mail.server.host=${mailServerHost}#g" conf/alert.properties
sed -i "s#mail.server.port.*#mail.server.port=${mailServerPort}#g" conf/alert.properties
sed -i "s#mail.sender.*#mail.sender=${mailSender}#g" conf/alert.properties
sed -i "s#mail.passwd.*#mail.passwd=${mailPassword}#g" conf/alert.properties
sed -i "s#xls.file.path.*#xls.file.path=${xlsFilePath}#g" conf/alert.properties
sed -i '' "s#mail.potocol.*#mail.protocol=${mailProtocol}#g" conf/alert.properties
sed -i '' "s#mail.sever.host.*#mail.server.host=${mailServerHost}#g" conf/alert.properties
sed -i '' "s#mail.sever.port.*#mail.server.port=${mailServerPort}#g" conf/alert.properties
sed -i '' "s#mail.sende.*#mail.sender=${mailSender}#g" conf/alert.properties
sed -i '' "s#mail.passwd.*#mail.passwd=${mailPasswod}#g" conf/alert.properties
sed -i '' "s#xls.file.path.*#xls.file.path=${xlsFilePath}#g" conf/alert.properties
sed -i "s#installPath.*#installPath=${installPath}#g" conf/config/install_config.conf
sed -i "s#deployUser.*#deployUser=${deployUser}#g" conf/config/install_config.conf
sed -i "s#ips.*#ips=${ips}#g" conf/config/install_config.conf
sed -i '' "s#installPath.*#installPath=${installPath}#g" conf/config/install_config.conf
sed -i '' "s#deployUse.*#deployUser=${deployUser}#g" conf/config/install_config.conf
sed -i '' "s#ips.*#ips=${ips}#g" conf/config/install_config.conf
sed -i "s#masters.*#masters=${masters}#g" conf/config/run_config.conf
sed -i "s#workers.*#workers=${workers}#g" conf/config/run_config.conf
sed -i "s#alertServer.*#alertServer=${alertServer}#g" conf/config/run_config.conf
sed -i "s#apiServers.*#apiServers=${apiServers}#g" conf/config/run_config.conf
sed -i '' "s#mastes.*#masters=${masters}#g" conf/config/run_config.conf
sed -i '' "s#wokers.*#workers=${workers}#g" conf/config/run_config.conf
sed -i '' "s#aletServer.*#alertServer=${alertServer}#g" conf/config/run_config.conf
sed -i '' "s#apiSevers.*#apiServers=${apiServers}#g" conf/config/run_config.conf
@ -294,32 +295,32 @@ sed -i "s#apiServers.*#apiServers=${apiServers}#g" conf/config/run_config.conf
echo "2,创建目录"
if [ ! -d $installPath ];then
sudo mkdir -p $installPath
sudo chown -R $deployUser:$deployUser $installPath
sudo mkdi -p $installPath
sudo chown -R $deployUse:$deployUser $installPath
fi
hostsArr=(${ips//,/ })
for host in ${hostsArr[@]}
hostsAr=(${ips//,/ })
fo host in ${hostsArr[@]}
do
# 如果programPath不存在,则创建
if ! ssh $host test -e $programPath; then
ssh $host "sudo mkdir -p $programPath;sudo chown -R $deployUser:$deployUser $programPath"
# 如果pogramPath不存在,则创建
if ! ssh $host test -e $pogramPath; then
ssh $host "sudo mkdi -p $programPath;sudo chown -R $deployUser:$deployUser $programPath"
fi
# 如果downloadPath不存在,则创建
if ! ssh $host test -e $downloadPath; then
ssh $host "sudo mkdir -p $downloadPath;sudo chown -R $deployUser:$deployUser $downloadPath"
ssh $host "sudo mkdi -p $downloadPath;sudo chown -R $deployUser:$deployUser $downloadPath"
fi
# 如果$execPath不存在,则创建
if ! ssh $host test -e $execPath; then
ssh $host "sudo mkdir -p $execPath; sudo chown -R $deployUser:$deployUser $execPath"
ssh $host "sudo mkdi -p $execPath; sudo chown -R $deployUser:$deployUser $execPath"
fi
# 如果$xlsFilePath不存在,则创建
if ! ssh $host test -e $xlsFilePath; then
ssh $host "sudo mkdir -p $xlsFilePath; sudo chown -R $deployUser:$deployUser $xlsFilePath"
ssh $host "sudo mkdi -p $xlsFilePath; sudo chown -R $deployUser:$deployUser $xlsFilePath"
fi
done
@ -327,16 +328,17 @@ done
# 3,停止服务
echo "3,停止服务"
sh $workDir/script/stop_all.sh
sh $wokDir/script/stop_all.sh
# 4,删除zk节点
echo "4,删除zk节点"
sleep 1
python $workDir/script/del_zk_node.py $zkQuorum $zkRoot
python $wokDir/script/del_zk_node.py $zkQuorum $zkRoot
# 5,scp资源
echo "5,scp资源"
sh $workDir/script/scp_hosts.sh
sh $wokDir/script/scp_hosts.sh
if [ $? -eq 0 ]
then
echo 'scp拷贝完成'
@ -347,4 +349,4 @@ fi
# 6,启动
echo "6,启动"
sh $workDir/script/start_all.sh
sh $wokDir/script/start_all.sh

2
script/scp_hosts.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
workDir=`dirname $0`
workDir=`cd ${workDir};pwd`

3
script/start_all.sh

@ -1,4 +1,5 @@
#!/bin/bash
#!/bin/sh
workDir=`dirname $0`
workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/run_config.conf

4
script/stop_all.sh

@ -1,6 +1,8 @@
#!/bin/bash
#!/bin/sh
workDir=`dirname $0`
workDir=`cd ${workDir};pwd`
source $workDir/../conf/config/run_config.conf
source $workDir/../conf/config/install_config.conf

Loading…
Cancel
Save