Commit df8f6c53 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Tower 0.1a3

parent f67d76ea
# NOC Tower
NOC Tower is the tool for deployment and maintaining multiple
NOC (http://nocproject.org/) installations.
## Installation
- Create Tower directory
$ mkdir tower
$ cd tower
- Create virtualenv
$ virtualenv .
- Install tower
$ ./bin/pip install https://cdn.nocproject.org/tower/noc-tower-0.1a3.tar.gz
- Run tower
$ TOWER_REPO_URL=http://<IP>:8888/hg ./bin/tower-web
where <IP> is external IP address of your tower server
- Enter the magical mistery tower
Open http://<IP>:8888/ in your browser. Login as admin/admin
......@@ -39,7 +39,7 @@ class TowerSdist(sdist):
def main():
kwargs = {}
with open("README.rst") as f:
with open("Readme.md") as f:
kwargs["long_description"] = f.read()
with open("VERSION") as f:
......
......@@ -197,6 +197,18 @@ class Environment(Model):
r["svc-mongod-arbiter"] = {"hosts": []}
if not len(service_data["mongod"]) % 2:
r["svc-mongod-arbiter"]["hosts"] = [pri.node.name]
# Calculate postgres primary
if "postgres" in service_data:
# Elect master
# As node with largest n_instances
# and lowest address
pri = sorted(
service_data["postgres"],
key=lambda ss: [-ss.n_instances] + [int(x) for x in ss.node.address.split(".")]
)[0]
r["svc-postgres-master"] = {
"hosts": [pri.node.name]
}
return r
@property
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment