mongodbcatalog

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

The FireCamp MongoDB container is based on Debian. The data volume will be mounted to the /data directory inside container. The MongoDB data will be stored at the /data/db directory, and the config files are at the /data/conf directory.

Security

The FireCamp MongoDB follows the offical security checklist. The Authentication is enabled by default. The Admin user is created and the Keyfile is created for the access control between members of a Replica Set.

Logging

The MongoDB logs are sent to the Cloud Logs, such as AWS CloudWatch logs. Could easily check what happens to MongoDB through CloudWatch logs.

The current latest Amazon Linux AMI uses Docker 17.03, which does not support the custom logging driver. So the awslogs driver is directly used.

Every service will have its own log group. For example, create the MongoDB service, mymongo, on cluster t1. The log group t1-mymongo-uuid will be created for the service. A log stream is created for every container. The FireCamp MongoDB container will log its service member at startup. We could get the full logs of one service member by simply checking the server member log entry in the log streams.

The custom logging driver is supported from Docker 17.05. Once Amazone Linux AMI updates to use higher Docker version and supports the custom loggint driver, we will switch to the FireCamp CloudWatch log driver. The FireCamp CloudWatch log driver will send the logs of one service member to one log stream, no matter where the container runs on.

Cache

By default, the MongoDB instance inside the container assumes the whole node's memory could be used, and calculate the cache size accordingly. In case you want to limit the memory size, could set the max-memory when creating the service.

Documentation

Index

Constants

View Source
const (
	// ContainerImage is the main MongoDB running container.
	ContainerImage = common.ContainerNamePrefix + "mongodb:" + common.Version
	// InitContainerImage initializes the MongoDB ReplicaSet.
	InitContainerImage = common.ContainerNamePrefix + "mongodb-init:" + common.Version
)

Variables

This section is empty.

Functions

func EnableMongoDBAuth

func EnableMongoDBAuth(content string) string

EnableMongoDBAuth enables the MongoDB user authentication, after replset initialized and user created.

func GenDefaultCreateServiceRequest

func GenDefaultCreateServiceRequest(platform string, region string, azs []string, cluster string,
	service string, replicas int64, volSizeGB int64, res *common.Resources) (*manage.CreateServiceRequest, error)

GenDefaultCreateServiceRequest returns the default MongoDB ReplicaSet creation request.

func GenDefaultInitTaskRequest

func GenDefaultInitTaskRequest(req *manage.ServiceCommonRequest, logConfig *cloudlog.LogConfig,
	serviceUUID string, replicas int64, manageurl string, admin string, adminPass string) *containersvc.RunTaskOptions

GenDefaultInitTaskRequest returns the default MongoDB ReplicaSet init task request.

func GenInitTaskEnvKVPairs

func GenInitTaskEnvKVPairs(region string, cluster string, service string,
	replSetName string, replicas int64, manageurl string, admin string, adminPass string) []*common.EnvKeyValuePair

GenInitTaskEnvKVPairs generates the environment key-values for the init task.

func GenReplicaConfigs

func GenReplicaConfigs(platform string, azs []string, cluster string, service string,
	replicas int64, replSetName string, port int64, maxMemMB int64) ([]*manage.ReplicaConfig, error)

GenReplicaConfigs generates the replica configs. Note: if the number of availability zones is less than replicas, 2 or more replicas will run on the same zone.

func IsAuthEnabled

func IsAuthEnabled(content string) bool

IsAuthEnabled checks if auth is already enabled.

func IsMongoDBConfFile

func IsMongoDBConfFile(filename string) bool

IsMongoDBConfFile checks if the file is the MongoDB config file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL