This project adopts the open-source mid to backend management system basic solution V3 Admin Vite, and implements the development of cluster management tools for openGemini in the form of WEB. The specific functions include displaying basic cluster information, monitoring cluster resources, generating configuration files, displaying logs, and executing commands.
The cluster management tool is deployed on the management node, which also deploys a standalone OpenGemini temporal database to store various monitoring indicators of the OpenGemini business cluster, such as node resource monitoring indicators (CPU, memory, disk I/O), error logs, etc. The above indicator data is collected and written into the database of the management node through the TS monitor tool. The monitoring tool queries basic cluster operation status information from it, retrieves error logs in the database through keywords, and echoes them.
npm install [email protected]
Install dependencies such as element plus (icon component library), axios (making HTTP requests), cors (handling cross domain requests), echarts (providing visual icons), and express (building web servers and APIs) required for the project.
- Clone project
git clone https://github.com/openGemini/openGemini-CM.git
- Enter the project directory
cd openGemini-CM
- Execute installation dependent command statements
pnpm i
Open the project main directory using VSCode, and VSCode will automatically pop up a window asking if to install the recommended extensions for this warehouse project. Click Install to proceed. The plugin path is. vscode/extensions. json, including ESLint, Prettier, Volar, and more.
At this point, the development environment configuration has been completed and secondary development can proceed
The running environment takes Linux as an example:
- Install Node.js version 16.14.0
curl -o node-v16.14.0-linux-x64.tar.xz https://nodejs.org/dist/v16.14.0/node-v16.14.0-linux-x64.tar.xz
- After the download is complete, extract the downloaded archive
tar -xvf node-v16.14.0-linux-x64.tar.xz
- Move the extracted Node.js directory to the /usr/local directory
sudo mv node-v16.14.0-linux-x64 /usr/local/nodejs
- Configure environment variables. Execute the following command to edit the ~/.bashrc file
nano ~/.bashrc
Then, add the following lines to the end of the file
export PATH="/usr/local/nodejs/bin:$PATH"
Press Ctrl + X to bring up the prompt, press Y to save the file changes. If you see "File Name to Write: .bashrc" in the prompt, press Enter to save the file successfully 5. Execute the following command to make the edited .bashrc file take effect
source ~/.bashrc
- Run the following command to verify if Node.js has been successfully installed
node -v
If it displays v16.14.0, the installation was successful 7. Install pnpm, run the following command
pnpm -v
If you encounter an error message like "pnpm: command not found" execute
npm install -g pnpm
- Navigate to the directory where you want to store the project and clone it
git clone https://github.com/openGemini/openGemini-CM.git
- Enter the project directory
cd openGemini-CM
- Run the project startup script
bash install_de.sh
bash run_preview.sh
Pull up the openGemini cluster and indicator collection tool ts monitor according to the deployment architecture, and take single machine deployment of openGemini cluster monitoring as an example:
- Enter the project directory and start the openGemini database
sudo bash scripts/install_cluster.sh
sudo bash scripts/install_monitor.sh
- Enter the usr/bin file to check if the tables in the database monitor are normal
./ts-cli -host 127.0.0.1 -port 8086
> show databases
> use monitor
> show measurements
The normal results are shown as follows:
- Start the project
pnpm start
-
User Management: Login and logout demonstrations. The initial login username and password are: {editor, editor} or {admin, admin}.
-
Permission Management: Built in instruction permissions and permission functions. Switch from the editor role to the admin role and enter the password: admin.
-
Cluster Basic Information and Resource Monitoring: Display the address of nodes in the current cluster, displaying the status of each node and information on its commonly used indicators. The memory utilization rate (%) is as follows: The CPU utilization rate (%) is as follows:
-
Command Execution: Enter commonly used SQL statements for openGemini, such as query, create, delete, insert, etc., and return the execution results. Taking creating a database geminiTest and creating a table logs in the database as an example: Create a database geminiTest as follows: The database geminiTest created by querying is as follows: Create table logs in the database geminiTest as follows: The table logs created by the query are as follows: Insert data information into the table logs as follows: The data information in the query table logs is as follows:
-
Log Display: Display error logs during the operation of the openGemini cluster, supporting retrieval by time or specific fields, sorted by time.
-
Configuration File Generation: Modify and generate the configuration file for the openGemini cluster. 对配置项进行修改后,点击“保存配置文件”。或恢复默认配置文件。