diff --git a/.gitignore b/.gitignore index b100abb9d..f31e99f01 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ Session.vim # bin/ /gopath/ +/release/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..d67e16b7a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ + +### v0.2.0 + +* A stolon client (stolonctl) is provided. At the moment it can be used to get clusters list, cluster status and get/replace/patch cluster config ([#28](https://github.com/sorintlab/stolon/pull/28) [#64](https://github.com/sorintlab/stolon/pull/64)). In future multiple additional functions will be added. See [doc/stolonctl.md](doc/stolonctl.md). +* The cluster config is now configurable using stolonctl ([#2](https://github.com/sorintlab/stolon/pull/2)). See [doc/cluster_config.md](doc/cluster_config.md). +* Users can directly put their preferred postgres configuration files inside a configuration directory ($dataDir/postgres/conf.d or provided with --pg-conf-dir) (see [doc/postgres_parameters.md](doc/postgres_parameters.md)) +* Users can centrally manage global postgres parameters. They can be configured in the cluster configuration (see [doc/postgres_parameters.md](doc/postgres_parameters.md)) +* Now the stolon-proxy closes connections on etcd error. This will help load balancing multiple stolon proxies ([#74](https://github.com/sorintlab/stolon/pull/74) [#76](https://github.com/sorintlab/stolon/pull/76) [#80](https://github.com/sorintlab/stolon/pull/80)). +* kubernetes: added readiness probe for stolon proxy ([#82](https://github.com/sorintlab/stolon/pull/82)) +* The keeper takes an exclusive fs lock on its datadir ([#48](https://github.com/sorintlab/stolon/pull/48)) +* Numerous bug fixes and improved tests. diff --git a/README.md b/README.md index 6cc8c1e36..79c1eaffc 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ stolon is a cloud native PostgreSQL manager for PostgreSQL high availability. It ## Features -* leverages PostgreSQL streaming replication +* Leverages PostgreSQL streaming replication. * [kubernetes integration](examples/kubernetes/README.md) letting you achieve postgreSQL high availability. -* uses [etcd](https://github.com/coreos/etcd) as an high available data store and for leader election -* asynchronous (default) and [synchronous](doc/syncrepl.md) replication. +* Uses [etcd](https://github.com/coreos/etcd) as an high available data store and for leader election +* Asynchronous (default) and [synchronous](doc/syncrepl.md) replication. +* Full cluster setup in minutes. +* Easy [cluster admininistration](doc/stolonctl.md) ## Architecture diff --git a/examples/kubernetes/README.md b/examples/kubernetes/README.md index d58798206..0581b1b0c 100644 --- a/examples/kubernetes/README.md +++ b/examples/kubernetes/README.md @@ -6,13 +6,13 @@ In this example you'll see how stolon can provide an high available postgreSQL c ## Docker image Prebuilt images are available on the dockerhub, the images' tags are their release version. Additional images are available: -* `latest`: latest released image (actually not existing, it will apppear when the first release is done) +* `latest`: latest released image (actually v0.2.0). * `master`: automatically built after every commit to the master branch. In the [image](examples/kubernetes/image/docker) directory you'll find the Dockerfile to build the image used in this example. Once the image is built you should push it to the docker registry used by your kubernetes infrastructure. -`sorintlab/stolon:master` is the one used by the kubernetes definitions in this example. +`sorintlab/stolon:v0.2.0` is the one used by the kubernetes definitions in this example. For a more stable testing you can use `sorintlab/stolon:latest` (when available) ## Cluster setup and tests diff --git a/examples/kubernetes/stolon-keeper.yaml b/examples/kubernetes/stolon-keeper.yaml index 963ed5d0e..db80ebd11 100644 --- a/examples/kubernetes/stolon-keeper.yaml +++ b/examples/kubernetes/stolon-keeper.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: stolon-keeper - image: sorintlab/stolon:master + image: sorintlab/stolon:v0.2.0 env: - name: KEEPER value: "true" diff --git a/examples/kubernetes/stolon-proxy.yaml b/examples/kubernetes/stolon-proxy.yaml index 85748721e..e0de37f37 100644 --- a/examples/kubernetes/stolon-proxy.yaml +++ b/examples/kubernetes/stolon-proxy.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: stolon-proxy - image: sorintlab/stolon:master + image: sorintlab/stolon:v0.2.0 env: - name: PROXY value: "true" diff --git a/examples/kubernetes/stolon-sentinel.yaml b/examples/kubernetes/stolon-sentinel.yaml index 328fd835f..6f7c39b8e 100644 --- a/examples/kubernetes/stolon-sentinel.yaml +++ b/examples/kubernetes/stolon-sentinel.yaml @@ -15,7 +15,7 @@ spec: spec: containers: - name: stolon-sentinel - image: sorintlab/stolon:master + image: sorintlab/stolon:v0.2.0 env: - name: SENTINEL value: "true" diff --git a/scripts/build-binary b/scripts/build-binary new file mode 100755 index 000000000..134ee771f --- /dev/null +++ b/scripts/build-binary @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +set -e + +VER=$1 +PROJ="stolon" + +if [ -z "$1" ]; then + echo "Usage: ${0} VERSION" >> /dev/stderr + exit 255 +fi + +set -u + +function setup_env { + local proj=${1} + local ver=${2} + + if [ ! -d ${proj} ]; then + git clone https://github.com/sorintlab/${proj} + fi + + pushd ${proj} >/dev/null + git checkout master + git fetch --all + git reset --hard origin/master + git checkout $ver + popd >/dev/null +} + + +function package { + local target=${1} + local srcdir="${2}/bin" + + local ccdir="${srcdir}/${GOOS}_${GOARCH}" + if [ -d ${ccdir} ]; then + srcdir=${ccdir} + fi + for bin in stolon-keeper stolon-sentinel stolon-proxy stolonctl; do + cp ${srcdir}/${bin} ${target}/${bin} + done + + cp stolon/README.md ${target}/README.md + + cp -R stolon/doc ${target}/doc + cp -R stolon/examples ${target}/examples +} + +function main { + mkdir -p release + cd release + setup_env ${PROJ} ${VER} + + for os in linux; do + export GOOS=${os} + export GOARCH="amd64" + + pushd stolon >/dev/null + ./build + popd >/dev/null + + TARGET="stolon-${VER}-${GOOS}-${GOARCH}" + mkdir -p ${TARGET} + package ${TARGET} ${PROJ} + + if [ ${GOOS} == "linux" ]; then + tar cfz ${TARGET}.tar.gz ${TARGET} + echo "Wrote release/${TARGET}.tar.gz" + else + zip -qr ${TARGET}.zip ${TARGET} + echo "Wrote release/${TARGET}.zip" + fi + done +} + +main diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 000000000..7ea331eec --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Build all release binaries and sources into "./release" directory. +# + +set -e + +VERSION=$1 +if [ -z "${VERSION}" ]; then + echo "Usage: ${0} VERSION" >> /dev/stderr + exit 255 +fi + +BASEDIR=$(readlink -f $(dirname $0))/.. +BINDIR=${BASEDIR}/bin + +if [ $PWD != $BASEDIR ]; then + cd $BASEDIR +fi + + +echo Building stolon binary... +./scripts/build-binary ${VERSION}