16.4.1 machadmin
machadmin starts and stops the Machbase server, creates and deletes databases, and checks server status.
Options
machadmin -h| Option | Description |
|---|---|
-u, --startup | Start the Machbase server |
--recovery[=simple,complex,reset] | Set the startup recovery mode (default: simple) |
-s, --shutdown | Shut down the Machbase server gracefully |
-k, --kill | Force the Machbase server to stop |
-c, --createdb | Create the Machbase database |
-d, --destroydb | Delete the Machbase database |
-e, --check | Check whether the server is running |
-i, --silent | Run without a banner |
-r, --restore | Restore the database from a backup |
-x, --extract | Convert a backup file to a backup directory |
-w, --viewimage | Display backup image file information |
-t, --licinstall | Install a license file |
-f, --licinfo | Display installed license information |
--home-path=path | Set the Machbase home path |
Starting the Server
machadmin -uSpecifying a Recovery Mode
machadmin -u --recovery=simple # Default recovery after a clean shutdown
machadmin -u --recovery=complex # Applied automatically after power loss
machadmin -u --recovery=reset # Full scan if simple/complex recovery fails| Recovery Mode | Description |
|---|---|
simple | Default recovery after a clean shutdown. Takes less time |
complex | Applied automatically after an abnormal shutdown such as power loss. Takes longer than simple |
reset | Scans all table data for recovery. Some data may be lost |
Stopping the Server
Graceful shutdown (waits for in-progress work to complete):
machadmin -sForced shutdown (terminates the process immediately):
machadmin -kCreating and Deleting the Database
# Create the database
machadmin -c
# Delete the database (displays a confirmation prompt)
machadmin -dChecking Server Status
machadmin -eDisplays the PID if the server is running.
Machbase server is already running with PID (14098).Displays an error if the server is not running.
[ERR] Server is not running.Restoring the Database
Restore the database from a backup directory.
machadmin -r /path/to/backupExample:
machadmin -r /home/mach/backup/machbase_backup_20240101License Management
Install a license file:
machadmin -t /path/to/license.datCheck the installed license:
machadmin -fSilent Mode
Runs without a banner or status messages. Useful in scripts.
machadmin -i -u # Start the server without a banner
machadmin -i -s # Stop the server without a banner
machadmin -i -e # Check status without a bannerExamples
# Initialize the database and start the server
machadmin -c
machadmin -u
# Check server status, then stop it
machadmin -e
machadmin -s
# Renew the license
machadmin -s
machadmin -t new_license.dat
machadmin -uLast updated on