mirror of https://gitee.com/bigwinds/arangodb
First complete deployment version
This commit is contained in:
parent
7d17e968a3
commit
d80ab8aa27
|
@ -1,12 +1,10 @@
|
|||
!SECTION ArangoDB and Docker
|
||||
|
||||
|
||||
|
||||
!SUBSECTION Networking
|
||||
|
||||
A bit of extra care has to be invested in how docker isolates its network. By default it fully isolates the network and by doing so an endpoint like `--server.endpoint tcp://0.0.0.0:8529` will only bind to all interfaces of the docker container which does not make it available on the machine you are starting on. This may be sufficient if you just want to access it locally but in case you want to expose it to the outside you must facilitate dockers port forwarding using the `-p` command line option. Be sure to check the [official docker documentation](https://docs.docker.com/engine/reference/run/).
|
||||
A bit of extra care has to be invested in how docker isolates its network. By default it fully isolates the network and by doing so an endpoint like `--server.endpoint tcp://0.0.0.0:8529` will only bind to all interfaces inside the docker container which does not include any external interface on the host machine. This may be sufficient if you just want to access it locally but in case you want to expose it to the outside you must facilitate dockers port forwarding using the `-p` command line option. Be sure to check the [official docker documentation](https://docs.docker.com/engine/reference/run/).
|
||||
|
||||
To simply make arangodb available on all host ports:
|
||||
To simply make arangodb available on all host interfaces on port 8529:
|
||||
|
||||
`docker run -p 8529:8529 -e ARANGO_RANDOM_ROOT_PASSWORD=1 arangodb`
|
||||
|
||||
|
@ -16,12 +14,10 @@ Another possibility is to start docker via network mode `host`. This is possible
|
|||
|
||||
To start the cluster via docker is basically the same as starting [locally](Local.md). However just like with the single networking image we will face networking issues. You can simply use the `-p` flag to make the individual task available on the host machine or you could use dockers [links](https://docs.docker.com/engine/reference/run/) to enable task intercommunication.
|
||||
|
||||
Please note that there are some flags that specify how ArangoDB can reach a task from the outside. These are very important and built for this exact usecase. For example starting the agency like this:
|
||||
Please note that there are some flags that specify how ArangoDB can reach a task from the outside. These are very important and built for this exact usecase. An example configuration might look like this:
|
||||
|
||||
```
|
||||
docker run -e ARANGO_RANDOM_ROOT_PASSWORD=1 -p 192.168.1.1:10000:8529 arangodb arangod --server.endpoint tcp://0.0.0.0:8529 --cluster.my-address tcp://192.168.1.1:10000 --cluster.my-local-info db1 --cluster.my-role PRIMARY --cluster.agency-endpoint tcp://192.168.1.1:5001
|
||||
docker run -e ARANGO_NO_AUTH=1 -p 192.168.1.1:10000:8529 arangodb arangod --server.endpoint tcp://0.0.0.0:8529 --cluster.my-address tcp://192.168.1.1:10000 --cluster.my-local-info db1 --cluster.my-role PRIMARY --cluster.agency-endpoint tcp://192.168.1.1:5001
|
||||
```
|
||||
|
||||
This will start a primary DB server within a docker container with an isolated network. Within the docker container it will bind on all interfaces (this will be 127.0.0.1:8529 and some internal docker ip on port 8529). By supplying `-p 192.168.1.1:10000:8529` we are establishing a port forwarding from our local IP (192.168.1.1 in this example) to port 8529 inside the container. Within the command we are telling arangod how it can be reached from the outside `tcp://192.168.1.1:10000`. The DBServer can now announce itself properly to the agency.
|
||||
|
||||
The agency has a similar paramter, namely the `--agency.endpoint` parameter.
|
||||
This will start a primary DB server within a docker container with an isolated network. Within the docker container it will bind on all interfaces (this will be 127.0.0.1:8529 and some internal docker ip on port 8529). By supplying `-p 192.168.1.1:10000:8529` we are establishing a port forwarding from our local IP (192.168.1.1 in this example) to port 8529 inside the container. Within the command we are telling arangod how it can be reached from the outside `--cluster.my-address tcp://192.168.1.1:10000`. This information will be forwarded to the agency so that the other tasks in your cluster can see how this particular DBServer may be reached.
|
|
@ -1,8 +1,8 @@
|
|||
!SECTION Launching a local ArangoDB cluster for testing
|
||||
|
||||
An ArangoDB cluster consists of needs several running tasks which form the cluster. ArangoDB itself won't start or monitor any of these tasks. So it will need some kind of supervisor which is monitoring and starting these tasks. For production usage we recommend using Mesos as the cluster supervisor.
|
||||
An ArangoDB cluster consists of several running tasks which form the cluster. ArangoDB itself won't start or monitor any of these tasks. So it will need some kind of supervisor which is monitoring and starting these tasks. For production usage we recommend using Mesos as the cluster supervisor.
|
||||
|
||||
However starting a cluster locally is possible and a very easy method to get a first impression of an ArangoDB cluster.
|
||||
However starting a cluster locally is possible and a very easy method to get a first impression of what an ArangoDB cluster looks like.
|
||||
|
||||
The easiest way to start a local cluster for testing purposes is to run `scripts/startLocalCluster.sh`. This will start 1 Agency, 2 DBServers and 1 Coordinator. To stop the cluster issue `scripts/stopLocalCluster.sh`.
|
||||
|
||||
|
@ -36,9 +36,11 @@ build/bin/arangod --server.authentication=false --server.endpoint tcp://0.0.0.0:
|
|||
build/bin/arangod --server.authentication=false --server.endpoint tcp://0.0.0.0:8531 --cluster.my-address tcp://127.0.0.1:8531 --cluster.my-local-info coord1 --cluster.my-role COORDINATOR --cluster.agency-endpoint tcp://127.0.0.1:5001 coordinator &
|
||||
```
|
||||
|
||||
Upon registering with the agency during startup the cluster will assign an ID to every task. Instead of starting with `--cluster.my-local-info` you can start with this ID from now on. The generated ID will be printed out to the log or can be accessed via the http API by calling `http://server-address/_admin/server/id`.
|
||||
|
||||
!SUBSECTION Secondaries
|
||||
|
||||
Secondaries need a bit more work. Secondaries need to have some primary assigned. To do that there is a special route. To register the a Secondary you must first find out the Server-ID of the primary server. This can be done by looking at the startup log or (for simple testing purposes like we do in startLocalCluster) just increment a counter because the IDs ArangoDB will generate will be DBServer1, DBServer2 and so forth. Then generate your own ID for the secondary (put it into "newSecondary") you are about to start and call one of the coordinators like this:
|
||||
Secondaries need a bit more work. Secondaries need to have some primary assigned. To do that there is a special route. To register a Secondary you must first find out the Server-ID of the primary server. Then generate your own ID for the secondary (put it into "newSecondary") you are about to start and call one of the coordinators like this:
|
||||
|
||||
`curl -f -X PUT --data "{\"primary\": \"DBServer1\", \"oldSecondary\": \"none\", \"newSecondary\": \"Secondary1\"}" -H "Content-Type: application/json" :8530/_admin/cluster/replaceSecondary`
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
!SECTION Distributed deployment using Apache Mesos
|
||||
|
||||
ArangoDB has a sophisticated yet easy to use cluster mode. To leverage the full cluster feature set (monitoring, scaling and failover) you have to run ArangoDB on some kind of cluster management system. Currently ArangoDB relies on Apache Mesos in that matter. Mesos is a cluster operating system which is powers some of the worlds biggest datacenters running several thousands of nodes. Running Arango
|
||||
ArangoDB has a sophisticated yet easy to use cluster mode. To leverage the full cluster feature set (monitoring, scaling and failover) you have to run ArangoDB on some kind of cluster management system. Currently ArangoDB relies on Apache Mesos in that matter. Mesos is a cluster operating system which powers some of the worlds biggest datacenters running several thousands of nodes.
|
||||
|
||||
!SUBSECTION DC/OS
|
||||
|
||||
|
@ -23,20 +23,23 @@ DC/OS comes with its own package management. Packages can be installed from the
|
|||
1. Install the [dcos cli](https://docs.mesosphere.com/usage/cli/)
|
||||
2. Open a terminal and issue `dcos install arangodb`
|
||||
|
||||
Both options are essentially doing the same in the background. Both are starting ArangoDB with its default options set. To review the default options click "Advanced Installation" in the webinterface or type `dcos package describe --config arangodb`.
|
||||
Both options are essentially doing the same in the background. Both are starting ArangoDB with its default options set.
|
||||
|
||||
To review the default options using the webinterface simply click "Advanced Installation" in the webinterface. There you will find a list of options including some explanation.
|
||||
|
||||
To review the default options using the CLI first type `dcos package describe --config arangodb`. This will give you a flat list of default settings.
|
||||
|
||||
To get an explanation of the various command line options please check the latest options here (choose the most recent number and have a look at config.json):
|
||||
|
||||
https://github.com/mesosphere/universe/tree/version-3.x/repo/packages/A/arangodb
|
||||
|
||||
Alternatively check the DC/OS webinterface. Hit installing ArangoDB on the "Services" tab and examine "Advanced Installation".
|
||||
|
||||
After installing DC/OS will start deploying the ArangoDB cluster on the DC/OS cluster. You can watch ArangoDB starting on the "Services" tab in the webinterface. Once it is listed as healthy click the link next to it and you should see the ArangoDB webinterface.
|
||||
|
||||
!SUBSUBSECTION ArangoDB Mesos framework
|
||||
While ArangoDB is deployed Mesos will keep your cluster running. The web interface has many monitoring facilities so be sure to make yourself familiar with the DC/OS webinterface. As a fault tolerant system Mesos will take care of most failure scenarios automatically. Mesos does that by running ArangoDB as a so called "framework". This framework has been specifically built to keep ArangoDB running in a healthy condition on the Mesos cluster. From time to time a task might fail. The ArangoDB framework will then take care of rescheduling the failed task. As it knows about the very specifics of each cluster task and its role it will automatically take care of most failure scenarios.
|
||||
|
||||
To inspect what the framework is doing go to `WEBINTERFACEURL`/mesos in your browser. Locate the task "arangodb" and inspect stderr in the "Sandbox". This can be of interest for example when a slave got lost and the framework is rescheduling the task.
|
||||
As soon as ArangoDB was deployed Mesos will keep your cluster running. The web interface has many monitoring facilities so be sure to make yourself familiar with the DC/OS webinterface. As a fault tolerant system Mesos will take care of most failure scenarios automatically. Mesos does that by running ArangoDB as a so called "framework". This framework has been specifically built to keep ArangoDB running in a healthy condition on the Mesos cluster. From time to time a task might fail. The ArangoDB framework will then take care of rescheduling the failed task. As it knows about the very specifics of each cluster task and its role it will automatically take care of most failure scenarios.
|
||||
|
||||
To inspect what the framework is doing go to `http://webinterface-url/mesos` in your browser. Locate the task "arangodb" and inspect stderr in the "Sandbox". This can be of interest for example when a slave got lost and the framework is rescheduling the task.
|
||||
|
||||
!SUBSUBSECTION Using ArangoDB
|
||||
|
||||
|
@ -48,7 +51,7 @@ To change the settings of your ArangoDB Cluster access the ArangoDB UI and hit "
|
|||
|
||||
After changing the settings the ArangoDB framework will take care of the rest. Scaling your cluster up is generally a straightforward operation as Mesos will simply launch another task and be done with it. Scaling down is a bit more complicated as the data first has to be moved to some other place so that will naturally take somewhat longer.
|
||||
|
||||
Please note that scaling operations might not always work. For example if the underlying Mesos cluster is completely saturated with tasks scaling up will not be possible. Scaling down might also fail due to not being able to move all shards of a DBServer to a new destination because of size limitations. Be sure to check the output of the ArangoDB framework.
|
||||
Please note that scaling operations might not always work. For example if the underlying Mesos cluster is completely saturated with its running tasks scaling up will not be possible. Scaling down might also fail due to not being able to move all shards of a DBServer to a new destination because of size limitations. Be sure to check the output of the ArangoDB framework.
|
||||
|
||||
!SUBSUBSECTION Deinstallation
|
||||
|
||||
|
@ -64,7 +67,7 @@ Should you forget to cleanup the state you can do so later by using the [arangod
|
|||
|
||||
The cleanup framework will announce itself as a normal ArangoDB. Mesos will recognize this and offer all persistent volumes it still has for ArangoDB to this framework. The cleanup framework will then properly free the persistent volumes. Finally it will clean up any state left in zookeeper (the central configuration manager in a Mesos cluster).
|
||||
|
||||
To deploy follow the instructions in the github repository. After deploying watch the output in the sandbox of the Mesos webinterface. After a while there shouldn't be any persistent resource offers anymore as everything was cleaned up. After that you can delete the cleanup framework again via marathon.
|
||||
To deploy the cleanup framework, follow the instructions in the github repository. After deploying watch the output in the sandbox of the Mesos webinterface. After a while there shouldn't be any persistent resource offers anymore as everything was cleaned up. After that you can delete the cleanup framework again via marathon.
|
||||
|
||||
!SUBSECTION Apache Mesos and Marathon
|
||||
|
||||
|
@ -75,7 +78,7 @@ Doing so has the following downsides:
|
|||
1. Manual Mesos cluster setup
|
||||
1. You need to implement your own service discovery
|
||||
1. You are missing the dcos cli
|
||||
1. Install and Deinstall are tedious
|
||||
1. Install and deinstall are tedious
|
||||
1. You need to setup some kind of proxy tunnel to access arangodb from the outside
|
||||
1. Sparse monitoring capabilities
|
||||
|
||||
|
@ -149,4 +152,4 @@ The easiest is to simply delete arangodb and then deploy the cleanup-framework (
|
|||
|
||||
!SUBSECTION Configuration options
|
||||
|
||||
The Arangodb Mesos framework has a ton of different options which are listed and described here: https://github.com/arangodb/arangodb-mesos-framework/tree/3.0
|
||||
The Arangodb Mesos framework has a ton of different options which are listed and described here: https://github.com/arangodb/arangodb-mesos-framework/tree/3.0
|
|
@ -1,9 +1,21 @@
|
|||
!SECTION Single instance deployment
|
||||
|
||||
TODO:
|
||||
The latest official builds of ArangoDB for all supported operating systems may be obtained from https://www.arangodb.com/download/.
|
||||
|
||||
!SUBSECTION Linux remarks
|
||||
|
||||
Besides the official images which are provided for the most popular linux distributions there are also a variety of unofficial images provided by the community. We are tracking most of the community contributions (including new or updated images) in our newsletter:
|
||||
|
||||
https://www.arangodb.com/category/newsletter/
|
||||
|
||||
!SUBSECTION Windows remarks
|
||||
|
||||
Please note that ArangoDB will only work on 64bit.
|
||||
|
||||
!SUBSECTION Docker
|
||||
|
||||
The most simple way to deploy ArangoDB is using [Docker](https://docker.io/). To get a general understanding of docker have a look at their excellent documentation.
|
||||
|
||||
!SUBSUBSECTION Authentication
|
||||
|
||||
To start the official docker container you will have to decide on an authentication method. Otherwise the container won't start.
|
||||
|
@ -28,30 +40,4 @@ To get quickly going:
|
|||
|
||||
`docker run -e ARANGO_RANDOM_ROOT_PASSWORD=1 arangodb`
|
||||
|
||||
For an in depth guide about docker and arangodb please check the official documentation: https://hub.docker.com/r/_/arangodb/
|
||||
|
||||
Basically show the startup of a Docker image and explain about
|
||||
authentication options.
|
||||
|
||||
Explain how to mount an external volume for the data (or link to external
|
||||
information).
|
||||
|
||||
Mention the official `arangodb` and `arangodb/arangodb` images
|
||||
as well as the `arangodb/arangodb-preview` image?
|
||||
|
||||
Explain specialities for Mac OSX. Say that as of June 2016, Windows not
|
||||
supported with this. List fundamental operating systems we support.
|
||||
|
||||
!SUBSECTION Precompiled binaries and packages
|
||||
|
||||
Link to download page.
|
||||
|
||||
Linux:
|
||||
For debian and rpm based Linux explain about directories of the data and
|
||||
configuration.
|
||||
|
||||
OSX:
|
||||
Explain specialities for OSX.
|
||||
|
||||
Windows:
|
||||
Explain setup as service and for a single user, both supported?
|
||||
For an in depth guide about docker and arangodb please check the official documentation: https://hub.docker.com/r/_/arangodb/
|
Loading…
Reference in New Issue