Documentation
¶
Index ¶
Constants ¶
View Source
const ( EnvMongoShardedClusterHost = "MONGO_SHARDED_CLUSTER_HOST" EnvMongoShardedClusterPort = "MONGO_SHARDED_CLUSTER_PORT" EnvMongoShardedClusterUsername = "MONGO_SHARDED_CLUSTER_USERNAME" EnvMongoShardedClusterPassword = "MONGO_SHARDED_CLUSTER_PASSWORD" EnvMongoShardedClusterAuthSource = "MONGO_SHARDED_CLUSTER_AUTH_SOURCE" )
View Source
const (
ConfigDefaultReplicaSetName = "rscfg"
)
Variables ¶
This section is empty.
Functions ¶
func InferReplicaSet ¶
func InferReplicaSet(config mongoshardedconfig.ReplicaSetConfig, defaultValue string) (string, error)
func StopCluster ¶
func StopCluster(logger log.Logger, envInfo EnvironmentInfo) error
Types ¶
type Cluster ¶
type Cluster struct { MongoSList []MongoS ShardList []ShardReplicaSet ConfigRS ConfigReplicaSet }
func StartCluster ¶
func StartCluster(logger log.Logger, envInfo EnvironmentInfo, config mongoshardedconfig.MongoShardedClusterConfig) (Cluster, error)
func (Cluster) GetAllPids ¶
type ConfigReplicaSet ¶
func LaunchConfigReplicaSet ¶
func LaunchConfigReplicaSet( logger log.Logger, binInfo EnvironmentInfo, config mongoshardedconfig.ReplicaSetConfig, ) (ConfigReplicaSet, error)
func (*ConfigReplicaSet) Close ¶
func (c *ConfigReplicaSet) Close() error
type EnvironmentInfo ¶
type EnvironmentInfo struct { BinaryPath string // path to mongo server WorkspacePath string // path with write access where to store cluster info and logs LogsPath string // separate path for logs LdPreload []string // aux dynamic libraries to preload before launch }
func (EnvironmentInfo) MongoDPath ¶
func (b EnvironmentInfo) MongoDPath() string
func (EnvironmentInfo) MongoSPath ¶
func (b EnvironmentInfo) MongoSPath() string
func (EnvironmentInfo) PidFilePath ¶
func (b EnvironmentInfo) PidFilePath() string
type MongoD ¶
func StartReplicaSet ¶
func StartReplicaSet( logger log.Logger, binInfo EnvironmentInfo, config mongoshardedconfig.ReplicaSetConfig, replicaSet string, mode MongoDMode, ) ([]MongoD, error)
type MongoDMode ¶
type MongoDMode string
var ( MongoDConfigSvr MongoDMode = "configsvr" MongoDShardSvr MongoDMode = "shardsvr" )
type MongoS ¶
type MongoS struct { Host string Port int PidFilePath string Config ConfigReplicaSet Shards []ShardReplicaSet }
func StartSingleMongos ¶
func StartSingleMongos( logger log.Logger, binInfo EnvironmentInfo, configReplicaSet ConfigReplicaSet, shardReplicaSets []ShardReplicaSet, config interface{}) (MongoS, error)
type ShardReplicaSet ¶
func LaunchMongoShard ¶
func LaunchMongoShard( logger log.Logger, binInfo EnvironmentInfo, config mongoshardedconfig.ReplicaSetConfig, defaultShardName string, ) (ShardReplicaSet, error)
LaunchMongoShardWithParams length of auxiliary `params` array equals mongod instances to be launched.
func (*ShardReplicaSet) Close ¶
func (c *ShardReplicaSet) Close() error
Click to show internal directories.
Click to hide internal directories.