Skip to content

Commit

Permalink
remove ping, manually check master availability. Ping is not working …
Browse files Browse the repository at this point in the history
…to in kubernetes services
  • Loading branch information
ihervin committed Dec 27, 2016
1 parent a854a92 commit 3b535dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM postgres:9.6
MAINTAINER Daniel Dent (https://www.danieldent.com)
MAINTAINER Hervin I <[email protected]>
ENV PG_MAX_WAL_SENDERS 8
ENV PG_WAL_KEEP_SEGMENTS 8
COPY setup-replication.sh /docker-entrypoint-initdb.d/
Expand Down
11 changes: 6 additions & 5 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ if [ "$1" = 'postgres' ]; then
if [ "x$REPLICATE_FROM" == "x" ]; then
eval "gosu postgres initdb $POSTGRES_INITDB_ARGS"
else
until ping -c 1 -W 1 ${REPLICATE_FROM}
do
echo "Waiting for master to ping..."
sleep 1s
done
# comment this lines, can't ping kubernetes service
# until ping -c 1 -W 1 ${REPLICATE_FROM}
# do
# echo "Waiting for master to ping..."
# sleep 1s
# done
until gosu postgres pg_basebackup -h ${REPLICATE_FROM} -D ${PGDATA} -U ${POSTGRES_USER} -vP -w
do
echo "Waiting for master to connect..."
Expand Down

0 comments on commit 3b535dd

Please sign in to comment.