Skip to content

openGemini/openGemini-CM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openGemini-CM Logo

OpenGemini Cluster Management Tool

English | 中文

Introduction

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.

Deployment Architecture

openGemini架构图

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.

Development environment

Environmental Information

  1. VSCode version v1.77+
  2. Node.js version v16.14+
  3. pnpm version v8.7.4
npm install [email protected]

Installation dependencies

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.

Component Dependency

  1. Clone project
git clone https://github.com/openGemini/openGemini-CM.git
  1. Enter the project directory
cd openGemini-CM
  1. Execute installation dependent command statements
pnpm i

Install plugins (optional)

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

Operating Environment

The running environment takes Linux as an example:

  1. 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
  1. After the download is complete, extract the downloaded archive
tar -xvf node-v16.14.0-linux-x64.tar.xz
  1. Move the extracted Node.js directory to the /usr/local directory
sudo mv node-v16.14.0-linux-x64 /usr/local/nodejs
  1. 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
  1. 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
  1. Navigate to the directory where you want to store the project and clone it
git clone https://github.com/openGemini/openGemini-CM.git
  1. Enter the project directory
cd openGemini-CM
  1. Run the project startup script
bash install_de.sh
bash run_preview.sh

Service startup

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:

  1. Enter the project directory and start the openGemini database
sudo bash scripts/install_cluster.sh
sudo bash scripts/install_monitor.sh
  1. 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:

monitor中表的正常显示情况

  1. Start the project
pnpm start

Project Function Preview and Operation

  • 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: CPU利用率

  • 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. 配置文件生成 对配置项进行修改后,点击“保存配置文件”。或恢复默认配置文件。

LICENSE

Apache 2.0 许可证