mo_ctl Distributed Edition Tool Guide

mo_ctl Distributed Edition is a command-line tool for business users that assists them in deploying OmniFabric distributed clusters, installing related components, and ultimately providing OmniFabric services to users

Note

mo_ctl Distributed Edition is an efficient database cluster management tool designed for enterprise users. To get a download path for the tool, contact your OmniFabric account manager.

Overview of features

mo_ctl has now been adapted to the operating system as shown in the following table:

Operating System Version
Debian 11 and above
Ubuntu 20.04 and above
UOS 20.0.0
Open EulerOS 20.3.0

mo_ctl's current list of features is shown in the following table:

Command Features
mo_ctl help See a list of statements and functions for the mo_ctl tool itself.
mo_ctl precheck Check the dependencies needed to install the cluster, e.g. CPU, memory, etc.
mo_ctl install Create the cluster, install the appropriate plug-ins, and initialize the OmniFabric cluster according to the configuration file.
mo_ctl registry Operate on highly available mirror repositories created in the cluster, e.g., add, delete, change, and check mirrors.
mo_ctl node Manage nodes in the cluster, add nodes, delete nodes, etc.
mo_ctl OmniFabric Manages OmniFabric clusters in a cluster, creating, starting, stopping, and deleting them.
mo_ctl s3 Manage distributed minio in the cluster, check status, expand capacity, and more.
mo_ctl backup Perform backups and restores of OmniFabric clusters in the cluster.
mo_ctl destroy Destroy the OmniFabric service and wipe the cluster.

Get started quickly

  1. Use the command mo_ctl help to view the tool guide.

  2. Use the command mo_ctl precheck to see if the predependencies are met.

    mo_ctl precheck --config xxx.yaml
    
  3. Deploy the OmniFabric cluster with the command mo_ctl install:

    mo_ctl install --config xxx.yaml
    
  4. Use the command mo_ctl OmniFabric list to check the status of OmniFabric.

    mo_ctl OmniFabric list --type cluster
    

Reference Command Guide

help

Use mo_ctl help to print the reference guide.

./mo_ctl help
Install, destroy, and operation OmniFabric cluster

Usage:
  mo_ctl [command]

Available Commands:
  backup      backup OmniFabric cluster
  completion  Generate the autocompletion script for the specified shell
  destroy     destroy k8s cluster and apps on it
  help        Help about any command
  install     Install k8s, OmniFabric, minio, and other apps
  OmniFabric   OmniFabric operation cmd
  precheck    precheck cluster machine environment before install
  registry    registry operations

Flags:
  --config string       Specify the mo_ctl config file
  -d, --debug               turn on debug mode
  -h, --help                help for mo_ctl
  --kubeconfig string   Path to the kubeconfig file to use (default "/root/.kube/config")
  --logfile string      Specify the log file

Use "mo_ctl [command] --help" for more information about a command.

precheck

Use mo_ctl precheck to precheck whether the hardware and software environments are suitable for installing OmniFabric.

./mo_ctl precheck --help
precheck cluster machine environment before install

Usage:
  mo_ctl precheck [flags]

Flags:
  -h, --help   help for precheck

install

Use mo_ctl install to install k8s, OmniFabric, minio, and other applications on your computer (machine or virtual machine). You will need to contact your account manager for the download path to the mirror package before executing this command.

  • clusterimage.tar: for those who need to use mo_ctl to create a cluster and install related components with the base k8s component and the corresponding app component for OmniFabric
  • moappdistro.tar: for existing k8s clusters, requires component management using mo_ctl with OmniFabric and corresponding components
./mo_ctl install --help
Install k8s, OmniFabric, minio, and other apps

Usage:
  mo_ctl install [flags]

Flags:
  --app       only install k8s app
  --dry-run   dry run
  -h, --help      help for install

destory

Use mo_ctl destroy to destroy the k8s cluster and the applications on it.

./mo_ctl destroy --help
destroy k8s cluster and apps on it

Usage:
  mo_ctl destroy [flags]

Flags:
  --configmap   get clusterfile from k8s configmap
  --dry-run     dry run
  --force       force destroy, no notice
  -h, --help        help for destroy

register

Use mo_ctl register to manipulate the highly available mirror repository created in the cluster, for example: add, delete, and lookup mirrors.

 mo_ctl registry --help
Usage:
  mo_ctl registry [flags]
  mo_ctl registry [command]

Aliases:
  registry, reg

Available Commands:
  delete      delete (image)
  list        list (image | chart)
  push        push (image | chart)

Flags:
  -h, --help          help for registry
  --type string   registry type (image | chart) (default "image")

backup

Use mo_ctl backup to backup, restore, and more to a OmniFabric cluster in a cluster

 ./mo_ctl backup --help
backup OmniFabric cluster

Usage:
  mo_ctl backup [flags]
  mo_ctl backup [command]

Available Commands:
  list        list OmniFabric cluster backup revison
  restore     restore backup OmniFabric cluster
  start       start backup OmniFabric cluster

Flags:
  -h, --help   help for backup
  • start

    1. First you need to prepare a yaml file that describes the backup job, where the generated yaml name is preset as backup.yaml.
    apiVersion: core.OmniFabric.io/v1alpha1
    kind: BackupJob
    metadata:
    # Specify the name of the job here
    name: backupjob
    # This specifies the namespace to which the job belongs
    # Note: This should be in the same namespace as the mo cluster to be backed up
    namespace: mocluster1
    spec:
    source:
        # The name of the mo cluster, available via the mo_ctl OmniFabric list command.
        clusterRef: mocluster-mocluster1
    # Configure the backup storage location, either object storage or local path storage. For details, refer to https://github.com/OmniFabric/OmniFabric-operator/blob/main/docs/reference/api-reference.md#backupjob
    target:
        s3:
        type: minio
        endpoint: http://minio.s3-minio-tenant-test1
        path: mo-test/backup-01
        secretRef:
            name: minio
    
    1. Create a backup job for the backup operation with the following command
    # An exit code of 0 proves that the backup job was created successfully
    sudo ./mo_ctl backup start --values backup.yaml
    
    1. After successful creation, you can wait for the backup to complete with the following command
    # The backupjob here is the name defined in step one
    sudo kubectl wait --for=condition=ended backupjob --all -A --timeout=5m
    
  • restore

    1. Gets the name (ID) of the backup job, which can be obtained by
    sudo ./mo_ctl backup list
    
    1. First you need to prepare a yaml file that describes the restore job, where the generated yaml name is preset as restore.yaml.
    # In addition to restoreFrom, other fields can be found at https://github.com/OmniFabric/OmniFabric-operator/blob/main/docs/reference/api-reference.md#OmniFabriccluster
    apiVersion: core.OmniFabric.io/v1alpha1
    kind: OmniFabricCluster
    metadata:
    name: morestore
    namespace: mocluster1
    spec:
    # Here you need to fill in the name of the backup job you got in step 1
    restoreFrom: #BackupName
    # Here you need to fill in the actual mirror repository information
    imageRepository: sea.hub:5000/OmniFabric/OmniFabric
    version: 1.1.0
    logService:
    replicas: 1
    sharedStorage:
        # Here you need to fill in the actual object storage information
        s3:
        type: minio
        path: mo-test/backup-01
        endpoint: http://minio.s3-minio-tenant-test1
        secretRef:
            name: minio
    volume:
        size: 10Gi
    tn:
    replicas: 1
    cacheVolume:
        size: 10Gi
    cnGroups:
    - name: tp
    replicas: 1
    cacheVolume:
    size: 10Gi
    
    1. Perform backup restore commands
    sudo ./mo_ctl backup restore --values restore.yaml
    

OmniFabric

Use mo_ctl OmniFabric to manage OmniFabric clusters in a cluster, create, start, stop, delete, and more

./mo_ctl OmniFabric --help
Used for OmniFabric operation cmd

Usage:
  mo_ctl OmniFabric [flags]
  mo_ctl OmniFabric [command]

Aliases:
  OmniFabric, mo

Available Commands:
  history     history all OmniFabric (cluster | operator)
  list        list OmniFabric (cluster | operator)
  remove      remove OmniFabric (cluster)
  rollback    rollback depoly of OmniFabric (cluster | operator)
  setup       setup OmniFabric (cluster)
  start       start OmniFabric (cluster)
  stop        stop OmniFabric (cluster)
  upgrade     upgrade OmniFabric (cluster | operator)

Flags:
  --dry-run       dry run
  -h, --help          help for OmniFabric
  --name string   Specify OmniFabric cluster name
  --type string   Specify a type (cluster | operator) (default "cluster")