{"_id":"5521351e29a3dc0d00fae453","githubsync":"","version":{"_id":"54fa0050f63cf9210041c3c1","__v":5,"project":"54fa004ff63cf9210041c3be","createdAt":"2015-03-06T19:30:24.258Z","releaseDate":"2015-03-06T19:30:24.258Z","categories":["54fa0050f63cf9210041c3c2","54fa42b3961fea210092068e","54facefd5c41173700ecf296","54fad9d5f63cf9210041c669","54fae9ed5c41173700ecf2ad"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"54fa42b3961fea210092068e","pages":["54fada9b5c41173700ecf29e","54fadb625c41173700ecf2a0","54fae365019b2537006d00bc","5500a5712e8c48170076d163","551a876868da7f0d00f58cbc","5521351e29a3dc0d00fae453","5522b5af85fa041700623976","556d98e442dd610d00a3cfde"],"version":"54fa0050f63cf9210041c3c1","__v":8,"project":"54fa004ff63cf9210041c3be","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-07T00:13:39.405Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting Started"},"project":"54fa004ff63cf9210041c3be","user":"54fa0018e7a0ba2f00306211","__v":12,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-05T13:14:06.251Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Back-End Services\"\n}\n[/block]\nPaz is composed of [several services](doc:components):\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nr5i4tZGR02EWWexCiFB_Paz%20Architicture.png\",\n        \"Paz Architicture.png\",\n        \"810\",\n        \"773\",\n        \"#0a0b0c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe Scheduler and Service Directory are simple Node.js services with REST interfaces. The Orchestrator is like a front-end API that pulls together functionality from the Service Directory as well as Etcd and Fleet. The Orchestrator can also update DNS records for external-facing services.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Architecture of a Paz Cluster\"\n}\n[/block]\nA Paz cluster is simply a CoreOS cluster on which some Paz services have been installed, as Docker containers. Paz leverages CoreOS' Fleet and Etcd to abstract the hosts and schedule services across the cluster as if it were one big host.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/AUMX3F5mSeuanqdccgCx_paz%20talk%20diagram.png\",\n        \"paz talk diagram.png\",\n        \"530\",\n        \"500\",\n        \"#10314b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAs can be seen in this diagram, Paz can be seen as a layer on top of Fleet. Each host run CoreOS, which is clustered by default using Etcd, and Fleet presents an abstraction of systemd across this cluster. Paz sits on top of this and utilises Fleet and Etcd under the hood.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/UDMZNVnhQd6tXhxoHkcY_Paz%20cluster%20architecture.png\",\n        \"Paz cluster architecture.png\",\n        \"517\",\n        \"640\",\n        \"#d5dfe5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nThe above stack is what comes \"out of the box\" from the Vagrant and DigitalOcean cloud-init user-data files in the [Paz repository](https://github.com/paz-sh/paz). This is what every host in a Paz cluster looks like.\n- **CoreOS** - A minimalistic, auto-updating Linux distribution designed for running Docker containers.\n- **systemd** - The init system that comes with CoreOS. systemd is ultimately what will be starting and stopping our services. systemd will run our services based on *unit files*, text files that describe how to start and stop our services, and these are submitted to systemd by Fleet.\n- **Docker** - The Docker LXC daemon. Started by systemd at boot time, and will launch Docker containers for our services when asked by systemd.\n- **Fleet** - An abstraction of systemd at a cluster rather than host level. Uses Etcd to store unit files and to coordinate the scheduling of services across the cluster. The Paz scheduler writes unit files for user services and submits them to Fleet, which ultimately means they become a systemd unit on a host in the cluster.\n- **paz-haproxy** - An instance of HAProxy that is dynamically configured by [confd](https://github.com/kelseyhightower/confd). Described in detail in the [Paz Service Discovery](doc:paz-service-discovery).\n- **paz-dnsmasq** - All DNS queries from Docker containers run through this simple service, which simply forwards all requests for other services in the cluster to paz-haproxy, and will forward everything else on to the Internet.\n- **paz-pubkey-watcher** - Because paz-scheduler runs in a Docker container and needs to communicate with Fleet via SSH, it needs to have an SSH key. paz-scheduler will generate a keypair on startup and put the public key into Etcd. paz-pubkey-watcher watches this key in Etcd and modifies the host's `~/.ssh/authorized_keys` file with that key for the `core` user, allowing the scheduler to communicate with Fleet.","excerpt":"","slug":"paz-architecture","type":"basic","title":"Paz Architecture"}
[block:api-header] { "type": "basic", "title": "Back-End Services" } [/block] Paz is composed of [several services](doc:components): [block:image] { "images": [ { "image": [ "https://files.readme.io/nr5i4tZGR02EWWexCiFB_Paz%20Architicture.png", "Paz Architicture.png", "810", "773", "#0a0b0c", "" ] } ] } [/block] The Scheduler and Service Directory are simple Node.js services with REST interfaces. The Orchestrator is like a front-end API that pulls together functionality from the Service Directory as well as Etcd and Fleet. The Orchestrator can also update DNS records for external-facing services. [block:api-header] { "type": "basic", "title": "Architecture of a Paz Cluster" } [/block] A Paz cluster is simply a CoreOS cluster on which some Paz services have been installed, as Docker containers. Paz leverages CoreOS' Fleet and Etcd to abstract the hosts and schedule services across the cluster as if it were one big host. [block:image] { "images": [ { "image": [ "https://files.readme.io/AUMX3F5mSeuanqdccgCx_paz%20talk%20diagram.png", "paz talk diagram.png", "530", "500", "#10314b", "" ] } ] } [/block] As can be seen in this diagram, Paz can be seen as a layer on top of Fleet. Each host run CoreOS, which is clustered by default using Etcd, and Fleet presents an abstraction of systemd across this cluster. Paz sits on top of this and utilises Fleet and Etcd under the hood. [block:image] { "images": [ { "image": [ "https://files.readme.io/UDMZNVnhQd6tXhxoHkcY_Paz%20cluster%20architecture.png", "Paz cluster architecture.png", "517", "640", "#d5dfe5", "" ] } ] } [/block] The above stack is what comes "out of the box" from the Vagrant and DigitalOcean cloud-init user-data files in the [Paz repository](https://github.com/paz-sh/paz). This is what every host in a Paz cluster looks like. - **CoreOS** - A minimalistic, auto-updating Linux distribution designed for running Docker containers. - **systemd** - The init system that comes with CoreOS. systemd is ultimately what will be starting and stopping our services. systemd will run our services based on *unit files*, text files that describe how to start and stop our services, and these are submitted to systemd by Fleet. - **Docker** - The Docker LXC daemon. Started by systemd at boot time, and will launch Docker containers for our services when asked by systemd. - **Fleet** - An abstraction of systemd at a cluster rather than host level. Uses Etcd to store unit files and to coordinate the scheduling of services across the cluster. The Paz scheduler writes unit files for user services and submits them to Fleet, which ultimately means they become a systemd unit on a host in the cluster. - **paz-haproxy** - An instance of HAProxy that is dynamically configured by [confd](https://github.com/kelseyhightower/confd). Described in detail in the [Paz Service Discovery](doc:paz-service-discovery). - **paz-dnsmasq** - All DNS queries from Docker containers run through this simple service, which simply forwards all requests for other services in the cluster to paz-haproxy, and will forward everything else on to the Internet. - **paz-pubkey-watcher** - Because paz-scheduler runs in a Docker container and needs to communicate with Fleet via SSH, it needs to have an SSH key. paz-scheduler will generate a keypair on startup and put the public key into Etcd. paz-pubkey-watcher watches this key in Etcd and modifies the host's `~/.ssh/authorized_keys` file with that key for the `core` user, allowing the scheduler to communicate with Fleet.