Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zalando/spilo
Browse files Browse the repository at this point in the history
  • Loading branch information
feikesteenbergen committed Apr 23, 2015
2 parents 74e4b1f + 9439b9f commit 3069808
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion etcd-cluster-appliance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Currently the following scenarios are supported:
TODO
====
- [ ] Periodically one of the cluster members must check cluster health and remove unhealthy members from it.
- [ ] Periodically one of the cluster members should update SRV record in a predifined zone via AWS api.
- [ ] Periodically one of the cluster members should update SRV record in a predefined zone via AWS api.
6 changes: 4 additions & 2 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM zalando/ubuntu:14.04.1-1
MAINTAINER Oleksii Kliukin <oleksii.kliukin@zalando.de>

# Add PGDG repositories
Expand Down Expand Up @@ -45,10 +45,12 @@ ADD postgres_ha.sh /home/postgres/
RUN chown postgres:postgres /home/postgres/postgres_ha.sh
RUN chmod 700 /home/postgres/postgres_ha.sh

ENV ETCD_CLUSTER "default=http://127.0.0.1:7001"
ENV SCOPE "batman"
ENV DEBUG 0
# run subsequent commands as user postgres
USER postgres
WORKDIR /home/postgres
ENTRYPOINT ["/bin/bash", "/home/postgres/postgres_ha.sh"]
CMD ["batman"]
EXPOSE 5432

13 changes: 8 additions & 5 deletions postgres-appliance/postgres_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ PATH=$PATH:/usr/lib/postgresql/${PGVERSION}/bin

function write_postgres_yaml
{
local SCOPE=$1
cat >> postgres.yml <<__EOF__
loop_wait: 10
etcd:
scope: $SCOPE
ttl: 30
host: 127.0.0.1:4001
host: 127.0.0.1:8080
postgresql:
name: postgresql-${hostname}
listen: 0.0.0.0:5432
Expand All @@ -33,12 +32,16 @@ __EOF__
# get governor code
git clone https://github.com/compose/governor.git

write_postgres_yaml

# start etcd proxy
# for the -proxy on TDB the url of the etcd cluster
etcd --data-dir=data/etcd &
if [ "$DEBUG" -eq 1 ]
then
exec /bin/bash
fi
etcd -name "proxy-$SCOPE" -proxy on -bind-addr 127.0.0.1:8080 --data-dir=data/etcd -initial-cluster $ETCD_CLUSTER &

write_postgres_yaml "$@"
#exec "/bin/bash"
exec governor/governor.py "/home/postgres/postgres.yml"


Expand Down

0 comments on commit 3069808

Please sign in to comment.