Skip to content

Commit

Permalink
start directly when where is join file (#275)
Browse files Browse the repository at this point in the history
* start directly when where is join file

* fix base64 new line issue

* fix alpine issue
  • Loading branch information
weekface authored and xiaojingchen committed Jan 29, 2019
1 parent 6923a90 commit 3f74453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/tidb-cluster/templates/scripts/_start_pd.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi
cluster_name=`echo ${PEER_SERVICE_NAME} | sed 's/-pd-peer//'`
domain="${HOSTNAME}.${PEER_SERVICE_NAME}.${NAMESPACE}.svc"
discovery_url="${cluster_name}-discovery.${NAMESPACE}.svc:10261"
encoded_domain_url=`echo ${domain}:2380 | base64`
encoded_domain_url=`echo ${domain}:2380 | base64 | tr "\n" " " | sed "s/ //g"`

elapseTime=0
period=1
Expand Down Expand Up @@ -62,7 +62,7 @@ ARGS="--data-dir=/var/lib/pd \
--config=/etc/pd/pd.toml \
"

if [[ ! -d /var/lib/pd/member/wal ]]
if [[ ! -f /var/lib/pd/join && ! -d /var/lib/pd/member/wal ]]
then
until result=$(wget -qO- -T 3 http://${discovery_url}/new/${encoded_domain_url} 2>/dev/null); do
echo "waiting for discovery service returns start args ..."
Expand Down

0 comments on commit 3f74453

Please sign in to comment.