Alexander Kukushkin
abcaf2b94a
Possibility to protect some endpoints with basic-auth
...
user:passwd pair should be configured in restapi section of main
configuration file in following format:
restapi:
auth: 'username:password'
Plus implemented some simple routing mechanisms:
GET /foo => do_GET_foo()
POST /bar => do_POST_bar()
2015-09-10 15:25:08 +02:00
Alexander Kukushkin
1774d6e31a
Merge branches watch-leader-key and package-refactoring
2015-09-05 16:09:28 +02:00
Alexander Kukushkin
3a4a2dbb94
Merge branch 'master' of github.com:zalando/patroni into feature/watch-leader-key
2015-09-05 15:31:37 +02:00
Alexander Kukushkin
ac2740eeb9
Drop unused variable server_version
2015-09-05 15:22:38 +02:00
Alexander Kukushkin
7cce02ae95
Always use pg_xlog_location_diff to calculate bytes written to xlog
...
Drop unused functionality (lsn_to_bytes, bytes_to_lsn)
Revert some changes.
2015-09-05 15:19:17 +02:00
Alexander Kukushkin
650e244904
Refactor directory structure in preparation for building pypi-package
2015-09-04 16:06:44 +02:00
Alexander Kukushkin
c913c8ad92
Calculate xlog bytes with using lsn_to_bytes method
...
This method behaves differently depending on server version and will
allow to use patroni with postgres older than 9.3
2015-09-04 12:11:55 +02:00
Alexander Kukushkin
8b9e99090f
Move lsn_to_bytes and bytes_to_lsn into Postgresql class
...
and make their behavior version specific
2015-09-04 10:41:59 +02:00
Alexander Kukushkin
9361732722
Fix pep8 formatting and unit-tests
2015-09-04 08:29:16 +02:00
Alexander Kukushkin
df06860bde
Merge pull request #23 from pgexperts/93compat
...
93compat
2015-09-04 08:14:13 +02:00
Josh Berkus
f5627a498e
Fixed test_postgresql.py to include use_slots.
2015-09-03 18:41:30 -07:00
Alexander Kukushkin
50420771ce
Retry when executing take_leader method.
2015-09-03 16:53:15 +02:00
Alexander Kukushkin
2f6399de27
More unit-tests for etcd
2015-09-03 16:35:58 +02:00
Alexander Kukushkin
58410db9dd
Implemented Retry class inspired by KazooRetry
2015-09-03 11:47:08 +02:00
Alexander Kukushkin
7456662eef
Merge branch 'master' of github.com:zalando/patroni into feature/watch-leader-key
2015-09-03 10:33:26 +02:00
Alexander Kukushkin
a670b598f4
Implement unit test for reap_children function
2015-09-02 16:48:40 +02:00
Alexander Kukushkin
c6abf85740
Bugfix: sleep method was renamed to watch
2015-09-02 08:42:47 +02:00
Alexander Kukushkin
eb85caa3bd
Remove spurious print
2015-09-01 17:16:15 +02:00
Alexander Kukushkin
10c95a23e4
Rename sleep to watch in a AbstractDCS
...
This method suppose to watch for changes of leader key if current node
is not leader and also it could watch for changes in a members list if
current conde is the leader.
2015-09-01 09:59:37 +02:00
Alexander Kukushkin
fab321c6b0
Watch for changes of leader key
2015-09-01 09:54:57 +02:00
Alexander Kukushkin
3b1efff53e
Refactor Cluster object
...
`Cluster.leader` is not reference to `Member` anymore, but to `Leader`
`Leader` class contains field `index` (update index). This field is very
useful for watching for events which changing leader key. Also `Leader`
contains `member` field, which should reference real member.
2015-08-27 10:53:22 +02:00
Alexander Kukushkin
353fc58bee
Do not inherit rest api port on fork
2015-08-26 15:14:44 +02:00
Alexander Kukushkin
420176aa75
Merge branch 'master' of github.com:zalando/patroni into feature/python-etcd
2015-08-25 10:11:29 +02:00
Alexander Kukushkin
befd33555d
Refactor helpers/etcd.py
...
Work with etcd cluster via high-level python-etcd module.
Plus change all unit tests accordingly.
2015-08-24 16:58:08 +02:00
Oleksii Kliukin
29434e24ea
Allow relative paths to external scripts.
2015-08-24 16:53:57 +02:00
Feike Steenbergen
b0707c8ddd
Merge branch 'master' of github.com:zalando/patroni into feature/external_backup
...
Conflicts:
requirements-py2.txt
2015-08-11 11:27:53 +02:00
Feike Steenbergen
e51ea4c1ca
Merge pull request #4 from zalando/feature/lost-dcs-data
...
Run is_healthiest_node against last know healthy configuration of cluster
2015-08-11 11:22:46 +02:00
Alexander Kukushkin
ce6d1c69d8
Merge branch 'master' of github.com:zalando/patroni into feature/six
2015-08-11 10:19:35 +02:00
Alexander Kukushkin
e9d46b0adb
Merge branch 'master' of github.com:zalando/patroni into feature/lost-dcs-data
2015-08-11 10:19:07 +02:00
Oleksii Kliukin
164b5760a4
remove line too long warnings where possible.
2015-08-07 16:35:00 +02:00
Oleksii Kliukin
5d1d59a42b
Add mock-based unit tests for the restore module.
...
- add unit tests for the restore module
- additional dependencies in requirement
- harden the code that calls restore callbacks
- remove WAL-E related code from postgresql.py
2015-08-07 16:05:17 +02:00
Oleksii Kliukin
7f2dcc0a95
Move replica creation code into a separte file. So far, only the class that makes replicas with pg_basebackup is called.
2015-08-03 11:44:11 +02:00
Oleksii Kliukin
5171964758
Merge branch 'master' into feature/callbacks
2015-07-27 16:19:03 +02:00
Oleksii Kliukin
d85451efae
Increase test coverage for aws script.
2015-07-27 13:04:45 +02:00
Oleksii Kliukin
b92bfb34a5
Futher test for postgresql module (includes callbacks)
2015-07-27 13:04:01 +02:00
Oleksii Kliukin
859da0db0a
Make unit tets run again.
2015-07-27 10:10:29 +02:00
Alexander Kukushkin
b6c2061f3a
Merge branch 'master' of github.com:zalando/patroni into feature/six
2015-07-15 12:49:51 +02:00
Alexander Kukushkin
26935c3725
Merge branch 'master' of github.com:zalando/patroni into feature/lost-dcs-data
2015-07-15 12:49:38 +02:00
Alexander Kukushkin
66f4f790d2
Improve test coverage
2015-07-15 12:49:17 +02:00
Alexander Kukushkin
9df783cf9d
use six module to support python 2 and 3 instead of conditional imports
2015-07-15 12:03:28 +02:00
Alexander Kukushkin
b54119b918
Run is_healthiest_node against last know healthy configuration of cluster
...
This will help to survive when everything was wiped from configuration
store.
2015-07-15 11:20:25 +02:00
Alexander Kukushkin
71fce312c2
Enforce flake8 check
2015-07-10 10:53:04 +02:00
Alexander Kukushkin
dcad7a3229
Add exhibitor support
...
List of ZooKeeper nodes could be periodically updated from Exhibitor
Since we know that each Exhibitor accompanies one ZooKeeper node, list
of Exhibitor nodes also maintained. Exhibitor assumes that all ZooKeeper
nodes are using the same client port, 2181. The same assumption is valid
for Exhibitor, it should always listen on the same port on all nodes.
Original list of Exhibitor nodes is cached and used as a fallback when
it failed ito query information with using maintained list.
2015-07-10 10:46:33 +02:00
Alexander Kukushkin
c49580d6a7
Rename governor into patroni
2015-07-08 10:37:35 +02:00
Alexander Kukushkin
54400c6dec
Merge branch 'multidcs' of github.com:CyberDem0n/governor into feature/multidcs
...
Conflicts:
governor.py
tests/test_governor.py
tests/test_postgresql.py
2015-07-08 08:47:26 +02:00
Alexander Kukushkin
43b12af3a7
Implement possibility to work against ZooKeeper
...
This implementation is using the same interface (AbstractDCS) as Etcd
class. It means that there should be no problem to implement another
plugin to work agains Consul for example.
2015-07-07 12:45:14 +02:00
Alexander Kukushkin
7445590546
Keep node name in AbstractDCS class
...
It eliminates need to pass this name into most of the methods
2015-07-07 12:26:52 +02:00
Alexander Kukushkin
c5edcb589b
return result of last_operation as a string
2015-07-07 12:24:02 +02:00
Alexander Kukushkin
ae689a2f83
Rename ha.etcd into ha.dcs
2015-07-02 15:33:21 +02:00
Alexander Kukushkin
cc71906009
Inherit Etcd from abstract class
2015-07-02 15:15:07 +02:00