{"action":"created","comment":{"url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments/68122178","id":68122178,"diff_hunk":"@@ -0,0 +1,142 @@\n+---\n+title: High Availability (Supplemental)\n+layout: website-normal\n+---\n+\n+This document supplements the High Availability documentation available [here](http://brooklyn.apache.org/v/latest/ops/high-availability.html)\n+and provides an example of how to configure a pair of Apache Brooklyn servers to run in master-standby mode with a shared NFS datastore\n+\n+### Prerequisites\n+- Two VMs (or physical machines) have been provisioned\n+- NFS or another suitable file system has been configured and is available to both VMs*\n+- An NFS folder has been mounted on both VMs at `/mnt/brooklyn-persistence` and both machines can write to the folder\n+\n+\\* Brooklyn can be configured to use either an object store such as S3, or a shared NFS mount. The recommended option is to use an object\n+store as described in the [Object Store Persistence](./persistence/#object-store-persistence) documentation. For clarity, a shared NFS folder\n+is assumed in this example\n+\n+### Launching\n+To start, download and install the latest Apache Brooklyn release on both VMs following the 'OSX / Linux' section\n+of the [Running Apache Brooklyn](../start/running.html#install-apache-brooklyn) documentation\n+\n+On the first VM, which will be the master node, run the following to start Brooklyn in high availability mode:\n+\n+{% highlight bash %}\n+$ bin/brooklyn launch --highAvailability master --persist auto --persistenceDir /mnt/brooklyn-persistence\n+{% endhighlight %}\n+\n+Once Brooklyn has launched, on the second VM, run the following command to launch Brooklyn in standby mode:\n+\n+{% highlight bash %}\n+$ bin/brooklyn launch --highAvailability auto --persist auto --persistenceDir /mnt/brooklyn-persistence\n+{% endhighlight %}\n+\n+### Testing\n+You can now confirm that Brooklyn is running in high availibility mode on the master by logging into the web console at `http://<ip-address>:8081`.\n+Similarly you can log into the web console on the standby VM where you will see a warning that the server is not the high availability master.\n+To test a failover, you can simply terminate the process on the first VM and log into the web console on the second VM. Upon launch, Brooklyn will\n+output its PID to the file `pid.txt`; you can terminate the process by running the following command from the same directory from which you \n+launched Brooklyn:\n+\n+{% highlight bash %}\n+$ kill -9 $(cat pid.txt)\n+{% endhighlight %}\n+\n+It is also possiblity to check the high availability state of a running Brooklyn server using the following curl command:\n+\n+{% highlight bash %}\n+$ curl -u myusername:mypassword http://<ip-address>:8081/v1/server/ha/state\n+{% endhighlight %}\n+\n+This will return one of the following states:\n+\n+{% highlight bash %}\n+\n+\"INITIALIZING\"\n+\"STANDBY\"\n+\"HOT_STANDBY\"\n+\"HOT_BACKUP\"\n+\"MASTER\"\n+\"FAILED\"\n+\"TERMINATED\"\n+\n+{% endhighlight %}\n+\n+Note: The quotation characters will be included in the reply\n+\n+To obtain information about all of the nodes in the cluster, run the following command against any of the nodes in the cluster:\n+\n+{% highlight bash %}\n+$ curl -u myusername:mypassword http://<ip-address>:8081/v1/server/ha/states\n+{% endhighlight %}\n+\n+This will return a JSON document describing the Brooklyn nodes in the cluster. An example of two HA Brooklyn nodes is as follows (whitespace formatting has been\n+added for clarity):\n+\n+{% highlight yaml %}\n+\n+{\n+  ownId: \"XkJeXUXE\",\n+  masterId: \"yAVz0fzo\",\n+  nodes: {\n+    yAVz0fzo: {\n+      nodeId: \"yAVz0fzo\",\n+      nodeUri: \"http://<server1-ip-address>:8081/\",\n+      status: \"MASTER\",\n+      localTimestamp: 1466414301065,\n+      remoteTimestamp: 1466414301000\n+    },\n+    XkJeXUXE: {\n+      nodeId: \"XkJeXUXE\",\n+      nodeUri: \"http://<server2-ip-address>:8081/\",\n+      status: \"STANDBY\",\n+      localTimestamp: 1466414301066,\n+      remoteTimestamp: 1466414301000\n+    }\n+  },\n+  links: { }\n+}\n+\n+{% endhighlight %}\n+\n+The examples above show how to use `curl` to manually check the status of Brooklyn via its REST API. The same REST API calls can also be used by\n+automated third party monitoring tools such as Monit \n+\n+### Failover\n+When running as a HA standby node, each standby Brooklyn server (in this case there is only one standby) will check the shared persisted state\n+every 1 second to determine the state of the HA master. If no heartbeat has been recorded for thirty seconds, then an election will be performed\n+and one of the standby nodes will be promoted to master. At this point all requests should be directed to the new master node\n+\n+In the event that tasks - such as the provisioning of a new entity - are running when a failover occurs, the new master will display the current\n+state of the entity, but will not resume its provisioning or re-run any partially completed tasks. In this case it will usually be necesarry\n+to remove the node and reprovision it\n+\n+### Client Configuration\n+It is the responsibility of the client to connect to the master Brooklyn server. This can be accomplished in a variety of ways:\n+\n+* **Reverse Proxy**","path":"guide/ops/high-availability/high-availability-supplemental.md","position":117,"original_position":117,"commit_id":"a3d0db0952cdcba697e6986ae1dfd29ec3ac9e1d","original_commit_id":"a3d0db0952cdcba697e6986ae1dfd29ec3ac9e1d","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"body":"I'd use `####`, rather than just bold. And blank lines before the \"Elastic IP\" sub-section.","created_at":"2016-06-22T19:48:52Z","updated_at":"2016-06-22T19:48:52Z","html_url":"https://github.com/apache/brooklyn-docs/pull/78#discussion_r68122178","pull_request_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78","_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments/68122178"},"html":{"href":"https://github.com/apache/brooklyn-docs/pull/78#discussion_r68122178"},"pull_request":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78"}}},"pull_request":{"url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78","id":74415900,"html_url":"https://github.com/apache/brooklyn-docs/pull/78","diff_url":"https://github.com/apache/brooklyn-docs/pull/78.diff","patch_url":"https://github.com/apache/brooklyn-docs/pull/78.patch","issue_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/78","number":78,"state":"open","locked":false,"title":"Adds details of setting up a HA master-slave pair","user":{"login":"nakomis","id":1488244,"avatar_url":"https://avatars.githubusercontent.com/u/1488244?v=3","gravatar_id":"","url":"https://api.github.com/users/nakomis","html_url":"https://github.com/nakomis","followers_url":"https://api.github.com/users/nakomis/followers","following_url":"https://api.github.com/users/nakomis/following{/other_user}","gists_url":"https://api.github.com/users/nakomis/gists{/gist_id}","starred_url":"https://api.github.com/users/nakomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakomis/subscriptions","organizations_url":"https://api.github.com/users/nakomis/orgs","repos_url":"https://api.github.com/users/nakomis/repos","events_url":"https://api.github.com/users/nakomis/events{/privacy}","received_events_url":"https://api.github.com/users/nakomis/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-20T09:47:34Z","updated_at":"2016-06-22T19:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0805770e6f7c2e8f2d25d4f1b3660f4f129b3a6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78/commits","review_comments_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78/comments","review_comment_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/78/comments","statuses_url":"https://api.github.com/repos/apache/brooklyn-docs/statuses/a3d0db0952cdcba697e6986ae1dfd29ec3ac9e1d","head":{"label":"nakomis:ha-supplemental","ref":"ha-supplemental","sha":"a3d0db0952cdcba697e6986ae1dfd29ec3ac9e1d","user":{"login":"nakomis","id":1488244,"avatar_url":"https://avatars.githubusercontent.com/u/1488244?v=3","gravatar_id":"","url":"https://api.github.com/users/nakomis","html_url":"https://github.com/nakomis","followers_url":"https://api.github.com/users/nakomis/followers","following_url":"https://api.github.com/users/nakomis/following{/other_user}","gists_url":"https://api.github.com/users/nakomis/gists{/gist_id}","starred_url":"https://api.github.com/users/nakomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakomis/subscriptions","organizations_url":"https://api.github.com/users/nakomis/orgs","repos_url":"https://api.github.com/users/nakomis/repos","events_url":"https://api.github.com/users/nakomis/events{/privacy}","received_events_url":"https://api.github.com/users/nakomis/received_events","type":"User","site_admin":false},"repo":{"id":51127289,"name":"brooklyn-docs","full_name":"nakomis/brooklyn-docs","owner":{"login":"nakomis","id":1488244,"avatar_url":"https://avatars.githubusercontent.com/u/1488244?v=3","gravatar_id":"","url":"https://api.github.com/users/nakomis","html_url":"https://github.com/nakomis","followers_url":"https://api.github.com/users/nakomis/followers","following_url":"https://api.github.com/users/nakomis/following{/other_user}","gists_url":"https://api.github.com/users/nakomis/gists{/gist_id}","starred_url":"https://api.github.com/users/nakomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nakomis/subscriptions","organizations_url":"https://api.github.com/users/nakomis/orgs","repos_url":"https://api.github.com/users/nakomis/repos","events_url":"https://api.github.com/users/nakomis/events{/privacy}","received_events_url":"https://api.github.com/users/nakomis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nakomis/brooklyn-docs","description":"Mirror of Apache Brooklyn docs","fork":true,"url":"https://api.github.com/repos/nakomis/brooklyn-docs","forks_url":"https://api.github.com/repos/nakomis/brooklyn-docs/forks","keys_url":"https://api.github.com/repos/nakomis/brooklyn-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nakomis/brooklyn-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nakomis/brooklyn-docs/teams","hooks_url":"https://api.github.com/repos/nakomis/brooklyn-docs/hooks","issue_events_url":"https://api.github.com/repos/nakomis/brooklyn-docs/issues/events{/number}","events_url":"https://api.github.com/repos/nakomis/brooklyn-docs/events","assignees_url":"https://api.github.com/repos/nakomis/brooklyn-docs/assignees{/user}","branches_url":"https://api.github.com/repos/nakomis/brooklyn-docs/branches{/branch}","tags_url":"https://api.github.com/repos/nakomis/brooklyn-docs/tags","blobs_url":"https://api.github.com/repos/nakomis/brooklyn-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nakomis/brooklyn-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nakomis/brooklyn-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/nakomis/brooklyn-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nakomis/brooklyn-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/nakomis/brooklyn-docs/languages","stargazers_url":"https://api.github.com/repos/nakomis/brooklyn-docs/stargazers","contributors_url":"https://api.github.com/repos/nakomis/brooklyn-docs/contributors","subscribers_url":"https://api.github.com/repos/nakomis/brooklyn-docs/subscribers","subscription_url":"https://api.github.com/repos/nakomis/brooklyn-docs/subscription","commits_url":"https://api.github.com/repos/nakomis/brooklyn-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/nakomis/brooklyn-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/nakomis/brooklyn-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/nakomis/brooklyn-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/nakomis/brooklyn-docs/contents/{+path}","compare_url":"https://api.github.com/repos/nakomis/brooklyn-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nakomis/brooklyn-docs/merges","archive_url":"https://api.github.com/repos/nakomis/brooklyn-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nakomis/brooklyn-docs/downloads","issues_url":"https://api.github.com/repos/nakomis/brooklyn-docs/issues{/number}","pulls_url":"https://api.github.com/repos/nakomis/brooklyn-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/nakomis/brooklyn-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/nakomis/brooklyn-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nakomis/brooklyn-docs/labels{/name}","releases_url":"https://api.github.com/repos/nakomis/brooklyn-docs/releases{/id}","deployments_url":"https://api.github.com/repos/nakomis/brooklyn-docs/deployments","created_at":"2016-02-05T05:08:55Z","updated_at":"2016-02-05T05:08:57Z","pushed_at":"2016-06-21T12:48:19Z","git_url":"git://github.com/nakomis/brooklyn-docs.git","ssh_url":"git@github.com:nakomis/brooklyn-docs.git","clone_url":"https://github.com/nakomis/brooklyn-docs.git","svn_url":"https://github.com/nakomis/brooklyn-docs","homepage":null,"size":21799,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"4cfb123ca1c73bfd69e19edd9254b40809050a7e","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":47246079,"name":"brooklyn-docs","full_name":"apache/brooklyn-docs","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/brooklyn-docs","description":"Mirror of Apache Brooklyn docs","fork":false,"url":"https://api.github.com/repos/apache/brooklyn-docs","forks_url":"https://api.github.com/repos/apache/brooklyn-docs/forks","keys_url":"https://api.github.com/repos/apache/brooklyn-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/brooklyn-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/brooklyn-docs/teams","hooks_url":"https://api.github.com/repos/apache/brooklyn-docs/hooks","issue_events_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/events{/number}","events_url":"https://api.github.com/repos/apache/brooklyn-docs/events","assignees_url":"https://api.github.com/repos/apache/brooklyn-docs/assignees{/user}","branches_url":"https://api.github.com/repos/apache/brooklyn-docs/branches{/branch}","tags_url":"https://api.github.com/repos/apache/brooklyn-docs/tags","blobs_url":"https://api.github.com/repos/apache/brooklyn-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/brooklyn-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/brooklyn-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/brooklyn-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/brooklyn-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/brooklyn-docs/languages","stargazers_url":"https://api.github.com/repos/apache/brooklyn-docs/stargazers","contributors_url":"https://api.github.com/repos/apache/brooklyn-docs/contributors","subscribers_url":"https://api.github.com/repos/apache/brooklyn-docs/subscribers","subscription_url":"https://api.github.com/repos/apache/brooklyn-docs/subscription","commits_url":"https://api.github.com/repos/apache/brooklyn-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/brooklyn-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/brooklyn-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/brooklyn-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/brooklyn-docs/contents/{+path}","compare_url":"https://api.github.com/repos/apache/brooklyn-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/brooklyn-docs/merges","archive_url":"https://api.github.com/repos/apache/brooklyn-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/brooklyn-docs/downloads","issues_url":"https://api.github.com/repos/apache/brooklyn-docs/issues{/number}","pulls_url":"https://api.github.com/repos/apache/brooklyn-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/brooklyn-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/brooklyn-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/brooklyn-docs/labels{/name}","releases_url":"https://api.github.com/repos/apache/brooklyn-docs/releases{/id}","deployments_url":"https://api.github.com/repos/apache/brooklyn-docs/deployments","created_at":"2015-12-02T08:00:06Z","updated_at":"2016-04-20T13:54:06Z","pushed_at":"2016-06-21T12:48:20Z","git_url":"git://github.com/apache/brooklyn-docs.git","ssh_url":"git@github.com:apache/brooklyn-docs.git","clone_url":"https://github.com/apache/brooklyn-docs.git","svn_url":"https://github.com/apache/brooklyn-docs","homepage":null,"size":21825,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":29,"mirror_url":"git://git.apache.org/brooklyn-docs.git","open_issues_count":5,"forks":29,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78"},"html":{"href":"https://github.com/apache/brooklyn-docs/pull/78"},"issue":{"href":"https://api.github.com/repos/apache/brooklyn-docs/issues/78"},"comments":{"href":"https://api.github.com/repos/apache/brooklyn-docs/issues/78/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/brooklyn-docs/pulls/78/commits"},"statuses":{"href":"https://api.github.com/repos/apache/brooklyn-docs/statuses/a3d0db0952cdcba697e6986ae1dfd29ec3ac9e1d"}}}}
{"actor":{"display_login":"aledsage"}}