Script Deployment
When deploying KWDB using scripts, the system verifies configuration files, runtime environment, hardware, and software dependencies. If hardware requirements are not met, installation continues with a warning. If software dependencies are missing, installation aborts with an error message.
During deployment, the system automatically generates logs. If errors occur, check terminal output or log files in the log directory within the KWDB installation directory for details.
After bare-metal script deployment, the system packages KWDB as a system service (named kaiwudb) and generates the following files:
kaiwudb.service: Configures CPU resource usage.kaiwudb_env: Configures KWDB startup flags.
After container script deployment, the system generates a Docker Compose configuration file docker-compose.yml for configuring KWDB startup flags and CPU resource usage.
For specific configuration steps, see Cluster Configuration.
Prerequisites
- Obtained KWDB installation package.
- The hardware, operating system, software dependencies, and ports of the node to be deployed meet the installation deployment requirements.
- Installation user is
rootor a regular user withsudoprivilegesrootusers and regular users with passwordlesssudoconfigured will not be prompted for a password during script execution.- Regular users without passwordless
sudowill be prompted to enter a password to escalate privileges.
- For container deployment, non-root users added to
dockergroup:sudo usermod -aG docker $USER.
Steps
Log in to the target node and edit the
deploy.cfgfile in thekwdb_installdirectory.Note
By default, the
deploy.cfgconfiguration file contains cluster and primary-secondary cluster configuration parameters. Please delete or comment out the[cluster]and[additional]configuration item.Configuration example:
[global] # Whether to turn on secure mode secure_mode=tls # Management KaiwuDB user management_user=kaiwudb # KaiwuDB cluster http port rest_port=8080 # KaiwuDB service port kaiwudb_port=26257 # KaiwuDB brpc port brpc_port=27257 # KaiwuDB data directory data_root=/var/lib/kaiwudb # CPU usage[0-1] # cpu=1 [local] # local node configuration node_addr=127.0.0.1 # [cluster] # remote node addr,split by ',' # node_addr=127.0.0.2 # ssh info # ssh_port=22 # ssh_user=admin # [additional] # IPs=127.0.0.3,127.0.0.4Parameter description:
Configuration Level Parameter Description global secure_modeDefines the security mode. Options include:
-insecure: Enables insecure mode.
-tls: (Default) Enables secure mode. This generates TLS certificates for client and application connections, stored in/etc/kaiwudb/certs.management_userThe user account for managing KWDB, set to kaiwudbby default. After installation, KWDB creates this user and a user group with the same name.rest_portPort for web services (default: 8080).kaiwudb_portPort for client and application connections (default: 26257).brpc_portThe brpc communication port between KWDB time-series engines, used for inter-node communication.
This parameter is ignored in single-node deployment.data_rootData directory (default: /var/lib/kaiwudb).cpu(Optional) Specifies CPU usage for KWDB on the node. The default is unlimited. The value range is [0,1], with a precision of up to two decimal places.
Note: If the deployment environment is Ubuntu 18.04, you need to modify theCPUQuotavalue in thekaiwudb.servicefile after deployment is complete. Specifically, change any decimal values to integers (e.g., change180.0%to180%) to ensure the setting takes effect. For instructions, see CPU Usage Configuration.local node_addrThe IP address for client and application connections. The default listening address is 0.0.0.0, meaning the node will listen onkaiwudb_portacross all IP addresses on the host.Install KWDB in single-node mode.
./deploy.sh install --singleAfter verifying that the configuration is correct, enter
Yory. To return and modify thedeploy.cfgconfiguration file, enterNorn.================= KaiwuDB Basic Info ================= Deploy Mode: bare-metal Start Mode: single RESTful Port: 8080 KaiwuDB Port: 26257 BRPC Port: 27257 Data Root: /var/lib/kaiwudb Secure Mode: tls CPU Usage Limit: unlimited Local Node Address: 127.0.0.1 ========================================================= Please confirm the installation information above(Y/n):Upon successful execution, the console displays the following message:
[INSTALL COMPLETED]:KaiwuDB has been installed successfully! ...Start KWDB.
./deploy.sh startUpon successful execution, the console displays the following message:
[START COMPLETED]:KaiwuDB start successfully.Check the database status using any of the following methods:
The deployment script in the current directory
./deploy.sh statusThe
systemctlcommand from any directorysystemctl status kaiwudbThe helper script from any directory (recommended)
kw-status
(Optional) Enable KWDB to start automatically after a system reboot.
systemctl enable kaiwudb(Optional) Run the
add_user.shscript to create a database user. If skipped, the system will use the database deployment user by default, and no password is required to access the database../add_user.sh Please enter the username: Please enter the password:Upon successful execution, the console displays the following message:
[ADD USER COMPLETED]: User creation completed.Connect to and manage KWDB via kwbase CLI, KaiwuDB JDBC, or KaiwuDB Developer Center.