- About MogDB Stack
- Quick Start
- Installation
- Tutorial
- Architecture
- References
- Client
- mgo
- mgo create
- mgo create mgorole
- mgo create mgouser
- mgo create cluster
- mgo show
- mgo show k8s
- mgo show mgorole
- mgo show mgouser
- mgo show cluster
- mgo show restore
- mgo delete
- mgo delete mgorole
- mgo delete mgouser
- mgo delete cluster
- mgo delete backup
- mgo delete k8s
- mgo scale
- mgo scaledown
- mgo switch
- mgo update
- mgo update mgorole
- mgo update mgouser
- mgo update cluster
- mgo version
- mgo addk8s
- mgo localk8s
- mgo backup
- mgo backup detail
- mgo restore
- mgo minio
- mgo minio object
- mgo minio object ls
- mgo minio object stat
- mgo minio object getf
- Server
- Client
- FAQ
- Release Note
mgo Client
MogDB Operator Client, mgo for short, is the easiest way to interact with the MogDB Operator. mgo provides many convenient ways to create, manage and delete MogDB clusters through a series of simple commands. MogDB Operator provides an interface to connect to the mgo client and manage authentication through RBAC and TLS.
The mgo client is available for Linux, macOS, and you can select your desired mgo client from Release Note to select the mgo client you need. Note that the version of the mgo client must match the version of MogDB Operator.
General Considerations for Using mgo
If you use the Quick Start guide to install MogDB Operator, you will install MogDB Operator under the namespace named mogdb-operator-system
.
For convenience, we recommend setting mogdb-operator-system
to the value of the environment variable MGO_NAMESPACE
. In the shell where you will execute the mgo command, run the following command.
export MGO_NAMESPACE=mogdb-operator-system
If you do not want to set this environment variable, or are in an environment where environment variables are not available, you must use the --namespace(or -n) flag for most commands, for example
mgo version -n mogdb-operator-system
Syntax
For a detailed description of the commands of the mgo client, please refer to the command line for details.
While the syntax of mgo is as simple as if you were using kubectl, one of the goals of the MogDB Operator project is to allow seamless management of MogDB clusters in Kubernetes-enabled environments, and to make the learning curve easier by following a command pattern familiar to users.
To find out what is available at the top level of the mgo command, execute the following command.
mgo
The syntax of the mgo command usually follows the following format.
pgo [command] ([TYPE] [NAME]) [flags]
Where command is a verb, e.g.
- create
- show
- delete
TYPE is a resource type, e.g.
- cluster
- mgorole
- mgouser
NAME is the name of the resource type, e.g.
- cluster1
- admin
Some global flags apply to each mgo command, and some special flags apply to specific mgo commands. To get a list of all options and flags available for a command, you can use the --help flag. For example, to see all options available for the mgo create cluster command, you can run the following command.
mgo create cluster --help