Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed extra /data from service_data_path items.

  • Loading branch information...
commit ff254139902f8704a12bba4697c81c4cd96de2c6 1 parent b3cac1e
@wayneeseguin wayneeseguin authored
View
22 postgresql/shell/functions
@@ -39,14 +39,14 @@ postgresql_initialize()
if array is empty service_flags
then
_action="${action//\(*}"
- service_flags+=(${_action//*_} -D "$service_data_path/data" -s )
+ service_flags+=(${_action//*_} -D "$service_data_path" -s )
service_stop_flags+=( -m fast -w )
fi
typeset -gx PGDATA
- PGDATA="${service_data_path}/${package_version}/data"
+ PGDATA="${service_data_path}"
- service_pid_file="${service_data_path}/data/postmaster.pid"
+ service_pid_file="/var/run/postgresql/postgresql.pid"
}
postgresql_prefetch()
@@ -66,12 +66,12 @@ postgresql_database_setup()
path chown "$service_user:$service_user" recursively "${service_data_path}"
- if ! path exists "${service_data_path}/data"
+ if ! path exists "${service_data_path}"
then
log "Initializing postgresql data directory in $service_data_path"
_initdb_flags=(
- --pgdata="'${service_data_path}/data'"
+ --pgdata="'${service_data_path}'"
--encoding=utf8
--locale=C
--username=$service_user
@@ -111,18 +111,18 @@ postgresql_service_setup()
log "service_data_path: ${service_data_path}"
for file in postgresql pg_hba pg_ident recovery
do
- if file is missing "${service_data_path}/data/${file}.conf"
+ if file is missing "${service_data_path}/${file}.conf"
then
- if file is missing "$service_data_path/data/${file}.conf.sample"
+ if file is missing "${service_data_path}/${file}.conf.sample"
then
- log "Missing $service_data_path/data/${file}.conf.sample, skipping."
+ log "Missing ${service_data_path}/${file}.conf.sample, skipping."
continue
fi
- log "Installing ${file}.conf to ${service_data_path}/data/"
+ log "Installing ${file}.conf to ${service_data_path}/"
files copy force \
- from "$service_data_path/data/${file}.conf.sample" \
- to "$service_data_path/data/${file}.conf"
+ from "$service_data_path/${file}.conf.sample" \
+ to "$service_data_path/${file}.conf"
fi
done
View
0  queue_classic/README.md
No changes.
View
1  queue_classic/VERSION
@@ -0,0 +1 @@
+0.0.1
View
0  queue_classic/map
No changes.
View
0  queue_classic/shell/functions
No changes.
View
0  queue_classic/shell/includes
No changes.
View
35 replication
@@ -0,0 +1,35 @@
+#!/bin/bash
+#
+# postgresql/replication/setup
+#
+# On the replica server perform the following:
+
+# Stop the replica server
+sm postgresql stop
+master=chargify-dbm-p0
+replica=chargify-dbr-p0 # localhost
+
+# Connect the SSH dots
+# Note that this must succeed before replication can be setup properly below.
+su - postgres -c "ssh -o StrictHostKeyChecking=no postgres@$master 'hostname; ssh -o StrictHostKeyChecking=no postgres@$replica hostname'"
+
+su - postgres -c "mkdir -p /var/db/postgresql/active/data/wal/"
+
+# Remove all wal files on the replica
+rm -f /var/db/postgresql/active/data/wal/*
+
+# Signal a start backup on the $master
+#psql -U postgres -h $master -c"select pg_start_backup('$(date)');"
+psql -U postgres -h $master -c"select pg_start_backup('replication-setup',true);"
+
+# Touch a starting wal file
+su - postgres -c "touch /var/db/postgresql/active/data/wal/00000001.history"
+
+su - postgres -c "rsync -avPz --delete --exclude .svn --exclude recovery.conf --exclude recovery.py --exclude postgresql.conf --exclude pg_log --exclude pg_xlog $master:/var/db/postgresql/active/data/ /var/db/postgresql/active/data/"
+
+find /var/db/postgresql/active/data/pg_xlog -type f | xargs rm -f
+
+psql -U postgres -h $master -c"select pg_stop_backup();"
+
+sm postgresql start
+
Please sign in to comment.
Something went wrong with that request. Please try again.