Commit Graph
285 Commits
Author SHA1 Message Date
Alexander Kukushkin 4fa9dbcf03 Merge branch 'etcd-cluster-support' of github.com:zalando/governor into etcd-cluster-support 2015-06-09 12:31:52 +02:00
Alexander Kukushkin de7630c65c Merge branch 'etcd-cluster-support' of github.com:CyberDem0n/governor into etcd-cluster-support 2015-06-09 12:31:09 +02:00
Alexander Kukushkin 57914821d0 Randomize list of etcd cluster members 2015-06-09 12:30:58 +02:00
Alexander Kukushkin a2988361c5 Retry with host from config when it failed to resolve SRV 2015-06-09 12:30:16 +02:00
Feike Steenbergen e734ac6b1d Add pythondns to the Dockerfile. 2015-06-09 12:25:30 +02:00
Alexander Kukushkin 19b0d4701b Merge branch 'etcd-cluster-support' of github.com:CyberDem0n/governor into etcd-cluster-support
Conflicts:
	requirements-py2.txt
	tests/test_governor.py
2015-06-09 11:34:14 +02:00
Alexander Kukushkin 261fbf2721 Replace logging with logger in ha.py 2015-06-09 10:27:09 +02:00
Alexander Kukushkin da4f9e8445 Make logging of http requests more verbose 2015-06-09 10:25:33 +02:00
Alexander Kukushkin 5b7a60657f Fix syntax in .travis.yml 2015-06-09 10:04:07 +02:00
Alexander Kukushkin c79fba7656 Support work with etcd as a cluster
In case if one member of a cluster is not available it will retry with
another one and fetch the new cluster configuration. Default timeout for
all requests to etcd is 5 seconds.
Initial cluster configuration can be resolved through:
1) /v2/members call on one of the cluster members on a client port
2) when it is possible to resolve hostname into multiple ip's  it will
iterate through list and try to perform action from 1)
3) If there is discovery_srv defined in etcd section of config file it
will resolve peer addresses of all cluster members and will fetch
cluster configuration with using peer protocol by doing /members call on
a peer port
2015-06-09 09:51:53 +02:00
Oleksii Kliukin dba2ced963 Merge pull request #23 from zalando/feature/awstags
Set tags on EC2 instances and EBS storage
2015-06-08 10:04:47 +02:00
Oleksii Kliukin 1fc3582e9b Merge branch 'feature/awstags' of https://github.com/zalando/governor into feature/awstags 2015-06-05 17:07:20 +02:00
Oleksii Kliukin 16a068f795 use instance-identity/document URL part to get instanceid and region at once. 2015-06-05 17:07:10 +02:00
Feike Steenbergen 92d2fda4a4 Dockerfile: Bump etcd version, include boto as a dependency 2015-06-05 10:23:49 +02:00
Oleksii Kliukin a6fcd66819 line up dependency alphabetically. 2015-06-05 10:07:24 +02:00
Oleksii Kliukin 8ab7717f13 increase test coverage for the changes in postgresql.py 2015-06-05 10:03:42 +02:00
Oleksii Kliukin cdc7526216 Merge branch 'master' into feature/awstags 2015-06-05 09:50:17 +02:00
Oleksii Kliukin 20c785b63a python3 compatibility: use isinstance instead of type() 2015-06-05 09:44:47 +02:00
Oleksii Kliukin 553b26f385 call on_change_callback only if it has been set. 2015-06-05 09:01:42 +02:00
Oleksii Kliukin e2de4c9045 add ok flag to the MockResponse object in order to be compatible with the AWS code, which examines this flag in a callback. 2015-06-05 08:59:32 +02:00
Oleksii Kliukin 1ae19f758b update requirements.txt with boto. 2015-06-05 08:48:57 +02:00
Oleksii Kliukin 3d123b41df add unittests. 2015-06-04 17:19:33 +02:00
Alexander Kukushkin e54fb8c617 Merge pull request #22 from CyberDem0n/master
Process http requests in a threads with ThreadingMixIn
2015-06-04 08:34:56 +02:00
Alexander Kukushkin fad2fbeae0 Import ThreadingMixIn for python3 2015-06-03 16:39:29 +02:00
Alexander Kukushkin 49c9c5dc6b Merge pull request #21 from zalando/features/refactoring
Customize pg_hba.conf via yml configuration file
2015-06-03 16:36:41 +02:00
Oleksii Kliukin ac46600816 more bugfixes. 2015-06-03 16:26:38 +02:00
Alexander Kukushkin aa1fc315ae Process http requests in a threads with ThreadingMixIn 2015-06-03 16:22:05 +02:00
Oleksii Kliukin fb3bf799e9 Autodetect the host role during start from the existence of recovery.conf. Fix some typos. 2015-06-03 16:18:47 +02:00
Oleksii Kliukin e06cd49deb autodetect the host role during start from the existence of recovery.conf. 2015-06-03 16:13:03 +02:00
Oleksii Kliukin 1d3a946ffb Fix wrong number of arguments for the EBS instance. 2015-06-03 15:52:35 +02:00
Oleksii Kliukin c68beda75c make sure on role change is called during the initial start of the server. 2015-06-03 15:49:38 +02:00
Oleksii Kliukin 0f518f87e7 fix a typo. 2015-06-03 14:45:02 +02:00
Oleksii Kliukin eb3a120db1 add code to set tags on AWS objects (instances and EBS storage), as well as an ability for the postgres state_handler to call a callback when the state is changed, and use the new AWS code in a callback. 2015-06-03 12:56:00 +02:00
Alexander Kukushkin f9fbe8980f Implement lsn_to_bytes bytes_to_lsn functions 2015-06-02 13:36:36 +02:00
Alexander Kukushkin 5cceac7621 Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	tests/test_postgresql.py
2015-06-02 12:38:45 +02:00
Alexander Kukushkin d9fbbf3ae9 Make pg_hba section more compact 2015-06-02 12:37:26 +02:00
Alexander Kukushkin 88631e14fa Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
	tests/test_postgresql.py
2015-06-02 10:28:28 +02:00
Alexander Kukushkin fca987deda set value of api_url from application_name parameter of conn_url. Reset parameters of conn_url 2015-06-02 09:45:37 +02:00
Alexander Kukushkin f9ce29d49f rename address to conn_url in a Member obj
and introduce new field: api_url
2015-06-02 08:52:34 +02:00
Alexander Kukushkin bacd05d99e Determine preferable local address to connect through.
If listen contains '*' or 0.0.0.0 - connect via localhost
In all other cases pick the first one.
2015-06-01 17:00:15 +02:00
Alexander Kukushkin efccd777b2 rename pid_path to postmaster_pid 2015-06-01 16:47:56 +02:00
Alexander Kukushkin 1bcc2b5fa6 Extend postgres?.yml with pg_hba section to give possibility to customize pg_hba.conf 2015-06-01 16:05:35 +02:00
Oleksii Kliukin 9ae5998a25 Merge pull request #20 from zalando/features/refactoring
Try to avoid of double promote
2015-06-01 14:43:20 +02:00
Alexander Kukushkin ccdff5ea99 Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
	tests/test_postgresql.py
2015-06-01 14:14:53 +02:00
Alexander Kukushkin adcc7ac256 Try to avoid "double" promotion.
Also check presence of trigger_file on master after promotion when
pg_is_in_recovery() = false and if it is there - remove it.
Plus check presence of trigger_file on a new slave (after running
pg_basebackup) and if it is there - also remove it.
2015-06-01 13:48:44 +02:00
Alexander Kukushkin 8c4e547d7a Handle KeyboardInterrupt in the main loop 2015-06-01 12:02:46 +02:00
Alexander Kukushkin 939254021e Code cleanup: do not modify os.environ but pass copy of it to subprocess.call 2015-06-01 11:03:06 +02:00
Alexander Kukushkin f8c3582715 Refactor api:
Call is_running only when it's not possible to execute query against
governed postgres.
2015-06-01 10:48:16 +02:00
Alexander Kukushkin b85262637d Bugfix: do not create replication slot for master 2015-06-01 09:20:24 +02:00
Feike Steenbergen f8d4a22921 Merge pull request #19 from zalando/features/refactoring
Wrap time.sleep into wrapper function
2015-05-28 16:07:41 +02:00