{"_id":"54fada9b5c41173700ecf29e","__v":19,"project":"54fa004ff63cf9210041c3be","user":"54fa0018e7a0ba2f00306211","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"},"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"},"updates":["54fb5062affc960d00240c31","555763c52f6b480d0034da2b","5557650421570d170044503b"],"next":{"pages":[],"description":""},"createdAt":"2015-03-07T11:01:47.819Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Welcome to Paz. By the end of this tutorial you will be running your own installation.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Don't forget\",\n  \"body\": \"Install [Paz Dependencies](http://paz.readme.io/v1.0/docs/installation) before continuing\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/pmTitKHQpSsfykThOyAf_screenshot:::at:::2x.png\",\n        \"screenshot@2x.png\",\n        \"2106\",\n        \"1388\",\n        \"#fc5c4b\",\n        \"\"\n      ],\n      \"caption\": \"Paz Dashboard\"\n    }\n  ]\n}\n[/block]\n## Before you begin - DNS\n\nBefore you begin, determine whether or not you want Paz to manage DNS for your services for you (e.g. if your domain is \"space.com\" then Paz can configure \"api.space.com\" when you install a public-facing service called \"api\" in your cluster and mark it as \"public-facing\").\n\nIf you do want Paz to manage DNS, you will need an account with DNSimple and have a domain ready to be used for your Paz cluster that is managed by DNSimple. You will need the domain name, DNSimple API token and the email address for your DNSimple account. Currently DNSimple is the only service supported by Paz, but expect more to follow.\n\nIf you would rather handle this yourself outside of Paz, that is fine, but there are a few things you'll need to understand about how Paz's service discovery and routing work. For that see [here](https://github.com/paz-sh/paz-haproxy).\n\n## Installation\n\nRegister with Digital Ocean and add your SSH key.\n\nClick the \"Create Droplet\" button in the DigitalOcean console.\n\nGive your droplet a name and choose your droplet size and region.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/C4D5EfvsSIGDvc0w36cE_KzhhuUBp7T-2000x2000.png\",\n        \"KzhhuUBp7T-2000x2000.png\",\n        \"1023\",\n        \"748\",\n        \"#3a80b6\",\n        \"\"\n      ],\n      \"caption\": \"Creating a Droplet\"\n    }\n  ]\n}\n[/block]\nTick \"Private Networking\" and \"Enable User Data\"\n\nPaste the contents of the [digitalocean/userdata](https://github.com/paz-sh/paz/blob/master/digitalocean/user-data) file in the paz-sh/paz repository into the userdata text area.\n\nGo to [http://discovery.etcd.io/new](http://discovery.etcd.io/new) and copy the URL that it prints in the browser, pasting it into the userdata text area instead of the one that is already there.\n[block:embed]\n{\n  \"html\": false,\n  \"url\": \"http://discovery.etcd.io/new\",\n  \"title\": null,\n  \"favicon\": null,\n  \"iframe\": true\n}\n[/block]\nIn the `write_files` section, in the section for writing the `/etc/environment` file, edit `PAZ_DOMAIN`, `PAZ_DNSIMPLE_APIKEY` and `PAZ_DNSIMPLE_EMAIL` fields, putting in your DNSimple-managed domain name, DNSimple API key and DNSimple account's email address, respectively.\n\nIf you are managing DNS yourself outside of the Paz cluster, set the `PAZ_DOMAIN` variable, remove the `PAZ_DNSIMPLE_*` variables and add another: `PAZ_ORCHESTRATOR_DNS_DISABLED=true`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"write_files:\\n  - path: /etc/paz-environment\\n    permissions: 0644\\n    content: |\\n        PAZ_PLATFORM=digitalocean\\n        PAZ_DOMAIN=space.com\\n        PAZ_DNSIMPLE_APIKEY=ABcdE1fGHi2jk3LmnOP\\n        PAZ_DNSIMPLE_EMAIL=alice@space.com\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\nBefore submitting, copy this userdata to a text file or editor because we'll need to use it again unchanged\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/1qKSjKMSHGiW5d1FzZji_5AZenlluXs.thumb.png\",\n        \"5AZenlluXs.thumb.png\",\n        \"512\",\n        \"458\",\n        \"#237dc1\",\n        \"\"\n      ],\n      \"caption\": \"CoreOS User Data\"\n    }\n  ]\n}\n[/block]\n\n\nSelect the CoreOS version you want to install. The latest beta version is recommended, as this is the version on which Paz has been tested.\n\nAdd the SSH keys that will be added to the box (under core user).\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/tDSqtkiiRYehqWMqrVSh_Screen%20Shot%202015-03-07%20at%2019.21.14.png\",\n        \"Screen Shot 2015-03-07 at 19.21.14.png\",\n        \"1013\",\n        \"355\",\n        \"#3c8ccc\",\n        \"\"\n      ],\n      \"caption\": \"SSH Keys in Digital Ocean\"\n    }\n  ]\n}\n[/block]\nClick \"Create Droplet\".\n\nRepeat for the number of nodes you want in the cluster (e.g. 3), using the exact same userdata file (i.e. don't generate a new discovery token etc.).\n\nOnce all droplets have booted (test by trying to SSH into each one, run docker ps and observe that `paz-dnsmasq`, `cadvisor` and `paz-haproxy` are all running on each box), you may proceed.\n\nThe next step is to install Paz on your newly-prepared CoreOS cluster.\n\nFrom the root directory of the `paz-sh/paz` repository, type the following:\n```\n$ ssh-add ~/.ssh/id_rsa # or equivalent\n$ FLEETCTL_TUNNEL=<MACHINE_IP> fleetctl -strict-host-key-checking=false start unitfiles/1/*\n```\n...where `<MACHINE_IP>` is the public IP address of any node in your new CoreOS cluster on DigitalOcean.\n\nThis will install the first set of unit files for Paz's internal services. Be patient, this can take 10 minutes or more as it has to pull down some large Docker repositories.\n\nYou can wait for all units to be active/running like so:\n```\n$ FLEETCTL_TUNNEL=<MACHINE_IP> watch -n 5 fleetctl -strict-host-key-checking=false list-units\n```\nOnce they're up you can install the final services, which need to be done second because they depend upon the first ones:\n```\n$ FLEETCTL_TUNNEL=<MACHINE_IP> fleetctl -strict-host-key-checking=false start unitfiles/2/*\n```\n\nYou now have a working Paz installation and you can proceed to [run services on it](http://paz.readme.io/v1.0/docs/deploying-your-first-application-using-paz).","excerpt":"How to get your Paz cluster in Digital Ocean","slug":"installing-paz-on-digital-ocean","type":"basic","title":"Installing Paz on Digital Ocean"}

Installing Paz on Digital Ocean

How to get your Paz cluster in Digital Ocean

Welcome to Paz. By the end of this tutorial you will be running your own installation. [block:callout] { "type": "info", "title": "Don't forget", "body": "Install [Paz Dependencies](http://paz.readme.io/v1.0/docs/installation) before continuing" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/pmTitKHQpSsfykThOyAf_screenshot@2x.png", "screenshot@2x.png", "2106", "1388", "#fc5c4b", "" ], "caption": "Paz Dashboard" } ] } [/block] ## Before you begin - DNS Before you begin, determine whether or not you want Paz to manage DNS for your services for you (e.g. if your domain is "space.com" then Paz can configure "api.space.com" when you install a public-facing service called "api" in your cluster and mark it as "public-facing"). If you do want Paz to manage DNS, you will need an account with DNSimple and have a domain ready to be used for your Paz cluster that is managed by DNSimple. You will need the domain name, DNSimple API token and the email address for your DNSimple account. Currently DNSimple is the only service supported by Paz, but expect more to follow. If you would rather handle this yourself outside of Paz, that is fine, but there are a few things you'll need to understand about how Paz's service discovery and routing work. For that see [here](https://github.com/paz-sh/paz-haproxy). ## Installation Register with Digital Ocean and add your SSH key. Click the "Create Droplet" button in the DigitalOcean console. Give your droplet a name and choose your droplet size and region. [block:image] { "images": [ { "image": [ "https://files.readme.io/C4D5EfvsSIGDvc0w36cE_KzhhuUBp7T-2000x2000.png", "KzhhuUBp7T-2000x2000.png", "1023", "748", "#3a80b6", "" ], "caption": "Creating a Droplet" } ] } [/block] Tick "Private Networking" and "Enable User Data" Paste the contents of the [digitalocean/userdata](https://github.com/paz-sh/paz/blob/master/digitalocean/user-data) file in the paz-sh/paz repository into the userdata text area. Go to [http://discovery.etcd.io/new](http://discovery.etcd.io/new) and copy the URL that it prints in the browser, pasting it into the userdata text area instead of the one that is already there. [block:embed] { "html": false, "url": "http://discovery.etcd.io/new", "title": null, "favicon": null, "iframe": true } [/block] In the `write_files` section, in the section for writing the `/etc/environment` file, edit `PAZ_DOMAIN`, `PAZ_DNSIMPLE_APIKEY` and `PAZ_DNSIMPLE_EMAIL` fields, putting in your DNSimple-managed domain name, DNSimple API key and DNSimple account's email address, respectively. If you are managing DNS yourself outside of the Paz cluster, set the `PAZ_DOMAIN` variable, remove the `PAZ_DNSIMPLE_*` variables and add another: `PAZ_ORCHESTRATOR_DNS_DISABLED=true`. [block:code] { "codes": [ { "code": "write_files:\n - path: /etc/paz-environment\n permissions: 0644\n content: |\n PAZ_PLATFORM=digitalocean\n PAZ_DOMAIN=space.com\n PAZ_DNSIMPLE_APIKEY=ABcdE1fGHi2jk3LmnOP\n PAZ_DNSIMPLE_EMAIL=alice@space.com", "language": "text" } ] } [/block] Before submitting, copy this userdata to a text file or editor because we'll need to use it again unchanged [block:image] { "images": [ { "image": [ "https://files.readme.io/1qKSjKMSHGiW5d1FzZji_5AZenlluXs.thumb.png", "5AZenlluXs.thumb.png", "512", "458", "#237dc1", "" ], "caption": "CoreOS User Data" } ] } [/block] Select the CoreOS version you want to install. The latest beta version is recommended, as this is the version on which Paz has been tested. Add the SSH keys that will be added to the box (under core user). [block:image] { "images": [ { "image": [ "https://files.readme.io/tDSqtkiiRYehqWMqrVSh_Screen%20Shot%202015-03-07%20at%2019.21.14.png", "Screen Shot 2015-03-07 at 19.21.14.png", "1013", "355", "#3c8ccc", "" ], "caption": "SSH Keys in Digital Ocean" } ] } [/block] Click "Create Droplet". Repeat for the number of nodes you want in the cluster (e.g. 3), using the exact same userdata file (i.e. don't generate a new discovery token etc.). Once all droplets have booted (test by trying to SSH into each one, run docker ps and observe that `paz-dnsmasq`, `cadvisor` and `paz-haproxy` are all running on each box), you may proceed. The next step is to install Paz on your newly-prepared CoreOS cluster. From the root directory of the `paz-sh/paz` repository, type the following: ``` $ ssh-add ~/.ssh/id_rsa # or equivalent $ FLEETCTL_TUNNEL=<MACHINE_IP> fleetctl -strict-host-key-checking=false start unitfiles/1/* ``` ...where `<MACHINE_IP>` is the public IP address of any node in your new CoreOS cluster on DigitalOcean. This will install the first set of unit files for Paz's internal services. Be patient, this can take 10 minutes or more as it has to pull down some large Docker repositories. You can wait for all units to be active/running like so: ``` $ FLEETCTL_TUNNEL=<MACHINE_IP> watch -n 5 fleetctl -strict-host-key-checking=false list-units ``` Once they're up you can install the final services, which need to be done second because they depend upon the first ones: ``` $ FLEETCTL_TUNNEL=<MACHINE_IP> fleetctl -strict-host-key-checking=false start unitfiles/2/* ``` You now have a working Paz installation and you can proceed to [run services on it](http://paz.readme.io/v1.0/docs/deploying-your-first-application-using-paz).