Skip to content

Commit

Permalink
fix join script (pingcap#285)
Browse files Browse the repository at this point in the history
* fix join script
  • Loading branch information
weekface authored and shuijing198799 committed Mar 15, 2019
1 parent 27010a4 commit acc125f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion charts/tidb-cluster/templates/scripts/_start_pd.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,16 @@ ARGS="--data-dir=/var/lib/pd \
--config=/etc/pd/pd.toml \
"

if [[ ! -f /var/lib/pd/join && ! -d /var/lib/pd/member/wal ]]
if [[ -f /var/lib/pd/join ]]
then
# The content of the join file is:
# demo-pd-0=http://demo-pd-0.demo-pd-peer.demo.svc:2380,demo-pd-1=http://demo-pd-1.demo-pd-peer.demo.svc:2380
# The --join args must be:
# --join=http://demo-pd-0.demo-pd-peer.demo.svc:2380,http://demo-pd-1.demo-pd-peer.demo.svc:2380
join=`cat /var/lib/pd/join | tr "," "\n" | awk -F'=' '{print $2}' | tr "\n" ","`
join=${join%,}
ARGS="${ARGS} --join=${join}"
elif [[ ! -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 acc125f

Please sign in to comment.