{"id":27643290,"url":"https://github.com/matrixorigin/mo_ctl_standalone","last_synced_at":"2025-06-20T09:34:31.494Z","repository":{"id":178365001,"uuid":"660957568","full_name":"matrixorigin/mo_ctl_standalone","owner":"matrixorigin","description":"mo_ctl tool for standalone matrixone","archived":false,"fork":false,"pushed_at":"2025-05-20T10:08:55.000Z","size":385,"stargazers_count":2,"open_issues_count":26,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-20T11:24:39.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matrixorigin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-01T10:38:13.000Z","updated_at":"2025-05-20T10:08:59.000Z","dependencies_parsed_at":"2023-10-12T13:46:54.576Z","dependency_job_id":"286b5b0d-6235-48ed-812f-0050ae3fb3a1","html_url":"https://github.com/matrixorigin/mo_ctl_standalone","commit_stats":null,"previous_names":["matrixorigin/mo_ctl_standalone"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/matrixorigin/mo_ctl_standalone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fmo_ctl_standalone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fmo_ctl_standalone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fmo_ctl_standalone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fmo_ctl_standalone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matrixorigin","download_url":"https://codeload.github.com/matrixorigin/mo_ctl_standalone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrixorigin%2Fmo_ctl_standalone/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260919444,"owners_count":23082760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-24T00:12:17.394Z","updated_at":"2025-06-20T09:34:26.482Z","avatar_url":"https://github.com/matrixorigin.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What it is\n\n`mo_ctl` tool is a tool designed to help you easily manage your standalone MatrixOne server, such as deploying, starting, stopping, connect and much more fun admin operations for you to discover!\n\n# How to get it\n\nDepending on whether your machine has access to the Internet or not, you can choose to install `mo_ctl` online or offline. Please remember to run the commands as root or a user with sudo privileges (and add `sudo` to each command). Also `install.sh` will use `unzip` command to extract `mo_ctl`, thus please make sure `unzip` is installed.\n\n```bash\n# Option-A. install locally with the Internet\nwget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/deploy/local/install.sh \u0026\u0026 bash +x ./install.sh\n# download from gitee.com\n# wget https://gitee.com/matrixorigin/mo_ctl_standalone/blob/main/deploy/local/install.sh \u0026\u0026 bash +x ./install.sh\n\n# Option-B. install locally without the Internet\n# 1. download them to your local pc first, then upload them to your server machine\nwget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/deploy/local/install.sh\nwget https://github.com/matrixorigin/mo_ctl_standalone/archive/refs/heads/main.zip -O mo_ctl.zip\n# 2. install from offline pacakge\nbash +x ./install.sh mo_ctl.zip\n\n# Option-C. install and use it in K8S.\n# 1. build docker image:\nsudo docker build -t mo_ctl_standalone --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} . -f optools/image/Dockerfile\n```\n\nYou can uninstall mo_ctl using below command.\n\n```bash\nwget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/deploy/local/uninstall.sh \u0026\u0026 bash +x ./uninstall.sh\n\n# on Ubuntu, MacOS or any other Linux with a non-root user with sudo privilges\nwget https://raw.githubusercontent.com/matrixorigin/mo_ctl_standalone/main/deploy/local/uninstall.sh \u0026\u0026 sudo bash +x uninstall.sh\n```\n\n# How to use it\n\nAfter `mo_ctl` is installed, you can use `mo_ctl help` to print help info on how to use.\nOr, if you depoy it in K8S, apply a YAML file to start a job, take the full-backup job for example:\n\n```\n# use the backup cronjob\nsudo crictl pull --creds ${username}:${password} mo-ctl:latest\nkubectl create ns mo-job\nkubectl get secret s3key -n mo-db -o yaml | sed 's/namespace: mo-db/namespace: mo-job/' | kubectl apply -f -\nkubectl apply -f deploy/k8s/backup-pvc.yaml\n# before run the next command, you should change the envs to set the confs of this tool, which starts with \"_CTL_\".\nkubectl apply -f deploy/k8s/backup-full-cronjob.yaml\n```\n\n# Quick start\n\n1. Take a quick look at the tool guide.\n\n```bash\nmo_ctl help\n```\n\n2. Note that some pre-requisites are required by `mo_ctl`, and use `mo_ctl precheck` to check if your machine meets them. Refer to chapter Reference for more info on how to install them.\n3. Set some configurations\n\n```bash\nmo_ctl get_conf MO_PATH # check default value of mo path to be installed\nmo_ctl set_conf MO_PATH=\"/data/mo/20230701/matrixone\" # set your own mo path\nmo_ctl set_conf MO_GIT_URL=\"https://gitee.com/matrixorigin/matrixone.git\" # in case have network issues, you can set this conf by overwritting default value MO_GIT_URL=\"https://github.com/matrixorigin/matrixone.git\"\n```\n\n3. Deploy a standalone mo instance of latest stable release version(current: 0.8.0)\n\n```bash\nmo_ctl deploy\n```\n\n4. Check mo-service status\n\n```bash\nmo_ctl status\n```\n\n5. Connect to mo-service after a few seconds when mo-service's initialization is finished\n\n```bash\nmo_ctl connect\n```\n\n6. Now enjoy your journey with MatrixOne via mo_ctl! For more help, please check chapter Reference\n\n# Reference\n\n## Command reference\n\n### help - print help info\n\n```bash\ngithub@shpc2-10-222-1-9:/data$ mo_ctl help\nUsage               : mo_ctl [option_1] [option_2]\n\nOptions             :\n  [option_1]        : available: auto_backup | auto_clean_logs | auto_log_rotate | backup | clean_backup | clean_logs | connect | csv_convert | ddl_convert | deploy | get_branch | get_cid | get_conf | help | monitor | pprof | precheck | restart | set_conf | sql | start | status | stop | uninstall | upgrade | version | watchdog\n    auto_backup     : setup a crontab task to backup your databases automatically\n    auto_clean_logs : set up a crontab task to clean system log table data automatically\n    auto_log_rotate : set up a crontab task to split and compress mo-service log file automatically\n    backup          : create a backup of your databases manually\n    build_image     : build an MO image from source code\n    clean_backup    : clean old backups older than conf 31 days manually\n    clean_logs      : clean system log table data manually\n    connect         : connect to mo via mysql client using connection info configured\n    csv_convert     : convert a csv file to a sql file in format \"insert into values\" or \"load data inline format='csv'\"\n    ddl_convert     : convert a ddl file to mo format from other types of database\n    deploy          : deploy mo onto the path configured\n    get_branch      : upgrade or downgrade mo from current version to a target commit id or stable version\n    get_cid         : print mo git commit id from the path configured\n    get_conf        : get configurations\n    help            : print help information\n    monitor         : monitor system related operations\n    pprof           : collect pprof information\n    precheck        : check pre-requisites for mo_ctl\n    restart         : a combination operation of stop and start\n    set_conf        : set configurations\n    sql             : execute sql from string, or a file or a path containg multiple files\n    start           : start mo-service from the path configured\n    status          : check if there's any mo process running on this machine\n    stop            : stop all mo-service processes found on this machine\n    uninstall       : uninstall mo from path MO_PATH=/data/mo/test/matrixone\n    upgrade         : upgrade or downgrade mo from current version to a target commit id or stable version\n    version         : show mo_ctl and matrixone version\n    watchdog        : setup a watchdog crontab task for mo-service to keep it alive\n\n  [option_2]        : Option for [option_1]. Use 'mo_ctl [option_1] help' to get more info\n\nExamples            : mo_ctl status\n                      mo_ctl status help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixorigin%2Fmo_ctl_standalone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixorigin%2Fmo_ctl_standalone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixorigin%2Fmo_ctl_standalone/lists"}