summaryrefslogtreecommitdiff
path: root/README
diff options
Diffstat (limited to 'README')
-rw-r--r--README193
1 files changed, 187 insertions, 6 deletions
diff --git a/README b/README
index 9cef823..801e7a2 100644
--- a/README
+++ b/README
@@ -40,20 +40,150 @@ The MongoDB charm allows for certain values to be configurable via the config.ya
A sample of the default settings of the config.yaml file at the time of writing are as follows:
options:
+ dbpath:
+ default: "/var/lib/mongodb"
+ type: string
+ description: The path where the data files will be kept.
+ logpath:
+ default: "/var/log/mongodb/mongodb.log"
+ type: string
+ description: The path where to send log data.
+ logappend:
+ default: True
+ type: boolean
+ description: Append log entries to existing log file
+ bind_ip:
+ default: "all"
+ type: string
+ description: IP address that mongodb should listen for connections.
+ port:
+ default: 27017
+ type: int
+ description: Default MongoDB port
+ journal:
+ default: True
+ type: boolean
+ description: Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
+ cpu:
+ default: False
+ type: boolean
+ description: Enables periodic logging of CPU utilization and I/O wait
+ auth:
+ default: False
+ type: boolean
+ description: Turn on/off security
+ verbose:
+ default: False
+ type: boolean
+ description: Verbose logging output
+ objcheck:
+ default: False
+ type: boolean
+ description: Inspect all client data for validity on receipt (useful for developing drivers)
+ quota:
+ default: False
+ type: boolean
+ description: Enable db quota management
+ diaglog:
+ default: 0
+ type: int
+ description: Set oplogging level where n is 0=off (default), 1=W, 2=R, 3=both, 7=W+some reads
+ nocursors:
+ default: False
+ type: boolean
+ description: Diagnostic/debugging option
+ nohints:
+ default: False
+ type: boolean
+ description: Ignore query hints
+ noscripting:
+ default: False
+ type: boolean
+ description: Turns off server-side scripting. This will result in greatly limited functionality
+ notablescan:
+ default: False
+ type: boolean
+ description: Turns off table scans. Any query that would do a table scan fails
+ noprealloc:
+ default: False
+ type: boolean
+ description: Disable data file preallocation
+ nssize:
+ default: "default"
+ type: string
+ description: Specify .ns file size for new databases
+ mms-token:
+ default: "disabled"
+ type: string
+ description: Accout token for Mongo monitoring server
+ mms-name:
+ default: "disabled"
+ type: string
+ description: Server name for Mongo monitoring server
+ mms-interval:
+ default: "disabled"
+ type: string
+ description: Ping interval for Mongo monitoring server ( in number of seconds )
+ autoresync:
+ default: False
+ type: boolean
+ description: Automatically resync if slave data is stale
+ oplogSize:
+ default: "default"
+ type: string
+ description: Custom size for replication operation log
+ opIdMem:
+ default: "default"
+ type: string
+ description: Size limit for in-memory storage of op ids
replicaset:
default: myset
type: string
description: Name of the replica set
web_admin_ui:
- default: yes
- type: string
- description: Replica Set Admin UI ( yes / no )
+ default: True
+ type: boolean
+ description: Replica Set Admin UI ( accessible via default_port + 1000 )
replicaset_master:
default: auto
type: string
- description: Replica Set master ( optional ). Possible values are 'auto' for automatic
- detection based on install time or 'host:port' to connect to 'host' on
- 'port' and register as a member.
+ description: Replica Set master ( optional ). Possible values are 'auto' for automatic detection based on install time or 'host:port' to connect to 'host' on 'port' and register as a member.
+ master:
+ default: "self"
+ type: string
+ description: Who is the master DB. If not "self", put the Master DB here as "host:port"
+ config_server_port:
+ default: 27019
+ type: int
+ description: Port number to use for the config-server
+ config_server_dbpath:
+ default: "/mnt/var/lib/mongodb/configsvr"
+ type: string
+ description: The path where the config server data files will be kept.
+ config_server_logpath:
+ default: "/mnt/var/log/mongodb/configsvr.log"
+ type: string
+ description: The path where to send config server log data.
+ arbiter:
+ default: "disabled"
+ type: string
+ description: Enable arbiter mode. Possible values are 'disabled' for no arbiter, 'enable' to become an arbiter or 'host:port' to declare another host as an arbiter. replicaset_master must be set for this option to work.
+ mongos_logpath:
+ default: "/mnt/var/log/mongodb/mongos.log"
+ type: string
+ description: The path where to send log data from the mongo router.
+ mongos_port:
+ default: 27021
+ type: int
+ description: Port number to use for the mongo router
+ extra_config_options:
+ default: "none"
+ type: string
+ description: Extra options ( comma separated ) to be included ( at the end ) in the mongodb.conf file.
+ extra_daemon_options:
+ default: "none"
+ type: string
+ description: Extra options ( exactly as you would type them in the command line ) to be added via the command line to the mongodb daemon
Where:
@@ -74,6 +204,8 @@ Where:
- ie: hostname ( will connect to hostname on the default port of 27017 )
- ie: hostname:port ( will connect to hostname on port number <port> )
+Most of the options in config.yaml have been modeled after the default configuration file for mongodb (normally in /etc/mongodb.conf) and should be familiar to most mongodb admins. Each option in this charm have a brief description of what it does.
+
Deployment
==========
@@ -149,6 +281,55 @@ Add multiple nodes to your replicaset
We now have a working MongoDB replica-set.
+Sharding
+--------
+
+According the the mongodb documentation found on their website (http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/), one way of deploying a Shard Cluster is as follows:
+
+- deploy config servers
+- deploy a mongo shell (mongos)
+- deploy shards
+- connect the config servers to the mongo shell
+- add the shards to the mongo shell
+
+
+Using Juju we can deploy a sharded cluster using the following commands:
+
+- Bootstrap the environment
+--- juju bootstrap
+
+- Config Servers ( we'll deploy 3 of them )
+--- juju deploy mongodb configsvr
+
+- Mongo Shell ( We just deploy one for now )
+--- juju deploy mongodb mongos
+
+- Shards ( We'll deploy three replica-sets )
+--- juju deploy mongodb shard1 -n3
+--- juju deploy mongodb shard2 -n3
+--- juju deploy mongodb shard3 -n3
+
+- Connect the Config Servers to the Mongo shell (mongos)
+--- juju add-relation mongos:mongos configsvr:configsvr
+
+- Connect each Shard to the Mongo shell (mongos)
+--- juju add-realtion mongos:mongos shard1:database
+--- juju add-realtion mongos:mongos shard2:database
+--- juju add-realtion mongos:mongos shard3:database
+
+With the above commands, we should now have a three replica-set sharded cluster running.
+Using the default configuration, here are some details of our sharded cluster:
+- mongos is running on port 27021
+- configsvr is running on port 27019
+- the shards are running on the default mongodb port of 27017
+- The web admin is turned on by default and accessible with your browser on port 28017 on each of the shards.
+
+To verify that your sharded cluster is running, connect to the mongo shell and run sh.status():
+- mongo --host <mongos_host>:<mongos_port>
+- run sh.status()
+You should see your the hosts for your shards in the status output.
+
+
Troubleshooting
===============