Configure Bare-Metal Deployment
After deploying KWDB with script in a bare-metal environment, the system generates two essential configuration files:
kaiwudb_env: Manages database startup flags.kaiwudb.service: Controls CPU resource allocation for KWDB.
Note
Both startup flags and CPU configurations are node-specific. To ensure consistent performance across your cluster, apply the same configurations to all nodes.
Configure Startup Flags
While KWDB provides reasonable default settings, you can customize its behavior by modifying the startup flags. Your custom settings will override the default values. For a list of all supported parameters, see Cluster Parameters.
To modify startup flags:
Stop the KWDB service:
systemctl stop kaiwudbNavigate to the
/etc/kaiwudb/scriptdirectory and open the configuration file:cd /etc/kaiwudb/script vi kaiwudb_envAdd or modify parameters as needed.
Example: Add the
--cacheparameter and set it to10000.KAIWUDB_START_ARG="--cache=10000"Reload the systemd daemon configuration:
systemctl daemon-reloadRestart the KWDB service:
systemctl restart kaiwudb
Manage CPU Resources
You can adjust the CPU resources allocated to KWDB on each node without needing to restart the database.
To adjust CPU allocation:
Navigate to the
/etc/systemd/systemdirectory and open the configuration file.cd /etc/systemd/system vi kaiwudb.serviceLocate the
CPUQuotasetting under the[Service]section. TheCPUQuotavalue is calculated using the following formula:CPUQuota = (desired usage percentage) × (number of CPU cores) × 100%. For example, to use 30% of a 6-core system:0.3 x 6 x 100% = 180%.Example: Set the
CPUQuotato180%.... [Service] ... CPUQuota=180% ...Reload the systemd daemon configuration.
systemctl daemon-reloadVerify your changes.
systemctl show kaiwudb | grep CPUQuota