You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bmp-console-web console front-end page. Use vue3 scaffolding to build. Includes login page, project management page, personal center page, instance management page and other page functions.
bmp-console-api console api. Go language backend business, call openapi interface to implement console related interfaces. Assemble all kinds of required data for bmp-console-web, and need to adapt to multiple languages.
bmp-operation-web operation platform front-end page. Use vue3 scaffolding to build, include login page, computer room management page, model management page, image management page, device management page, role management page, user management page and other page functions.
bmp-operation-api operation platform api. Go language back-end business, call openapi interface to implement operation platform related interfaces. To assemble all kinds of required data for bmp-operation-web, multi-language adaptation is required.
bmp-openapi bmp-openapi is the core module of bmp. It implements the restful api format interface that meets the swagger2.0 specification. It provides all basic functions of bmp to the outside world. It performs database operations internally and calls bmp-scheduler to complete the related operations of instance lifecycle management.
bmp-scheduler installation scheduling module. It accepts the instance lifecycle management request of bmp-openapi, converts the upper-level request into the corresponding commands, and drives the execution of commands, and cooperates with the lower-level bmp-driver and bmp-agent to complete the installation, reinstallation, startup, shutdown and other functions.
bmp-driver single computer room application. In the case of multiple computer rooms, multiple sets of bmp-driver services need to be deployed, receive mq, and start, shut down, restart, set pxe startup and other operations on the server in this computer room.
bmp-dhcp-agent Single computer room application, before installation, you need to update the dhcp configuration in advance and store the Mac-IP association in the dhcp configuration. Only then can liveOS obtain the ip address from dhcp.
bmp-db database
bmp-redis redis cache
bmp-mq message middleware
bmp-tftp tftp server, which stores the relevant files required for pxe boot, including pxe boot program, pxe boot configuration, LiveOS kernel and initramfs.
bmp-image http server, storing GuestOS image
bmp-rsyslog rsyslog log component
bmp-oob-alert out-of-band alarm component
bmp-oob-agent out-of-band monitoring information collection component
bmp-prometheus monitoring data collection component
bmp-pushgateway collects monitoring data from bmp-monitor-proxy and pushes it to Prometheus
bmp-alertmanager alarm component
bmp-pronoea receives alarm information from bmp-alertmanager and converts the format, and passes it to bmp-openapi
Installation process
Installation process description
The client (bmp-console-web) initiates the installation request, and bmp-console-api receives the request
bmp-console-api checks the request parameters and forwards the request to bmp-openapi if it passes.
bmp-openapi performs permission checks and other operations, generates installation parameters, and sends them to bmp-scheduler.
bmp-scheduler schedules installation tasks, generates a series of installation instructions, and sends them to bmp-dhcp-agent, bmp-driver, and bmp-agent through the bmp-mq service.
bmp-dhcp-agent receives the instructions and sets the built-in dhcp server so that the bm node can obtain the correct ip configuration and tftp address (bmp-tftp address) during the pxe startup phase.
After receiving the instructions, bmp-driver sets the bm node to pxe startup and restarts.
The bm node executes pxe startup, the PXEClient built into the network card starts, and sends a dhcp request broadcast. After receiving the dhcp request, the built-in dhcp server of bmp-dhcp-agent responds with the corresponding ip configuration and tftp address.
PXEClient configures its own IP, then downloads the pxe boot program from bmp-tftp and executes it. The pxe boot program continues to obtain other boot parameters from bmp-tftp, downloads the kernel and initramfs, starts the memory operating system, and the bmp-agent service built into the memory operating system starts to start
bmp-agent receives instructions and performs subsequent bm installation operations, such as setting up raid, partitioning, etc.
bmp-agent downloads the client operating system image file from bmp-image, writes it to the bm node disk, and then initializes the client operating system
bmp-agent executes a restart to complete the operating system installation
Monitoring process
The monitoring probe collects host monitoring information and aggregates it to the bmp-monitor-proxy component
bmp-monitor-proxy passes the monitoring information to bmp-pushgateway
bmp-prometheus regularly pulls monitoring data from bmp-pushgateway
After bmp-prometheus triggers the alarm rule, the alarm information is passed to bmp-alertmanager
bmp-alertmanager transfers the alarm information to bmp-pronoea for format conversion
bmp-pronoea transfers it to bmp-api for alarm display and alarm
bm node: bare metal server, a physical server for normal operation, without an operating system before installation, running LiveOS during the installation phase, and running GuestOS after installation
GuestOS: a normal operating operating system
LiveOS: a memory operating system with bmp-agent pre-installed
out-of-band network card: a special network card on a physical server used to communicate with bmc, also known as an ipmi network card
management network card: a standard network card on a physical server, in the management network
management network: 3-layer network, the management network card of the manager node communicates with the management network card of the bm node through the management network
Local development and debugging
BMP codes are divided into the following categories:
Application components
Category
Language/component
bmp-console-web
front-end
vue
bmp-operation-web
front-end
vue
bmp-console-api
back-end
go
bmp-operation-api
back-end
go
bmp-openapi
back-end
go
bmp-scheduler
back-end
go
bmp-openapi-console
back-end
go
bmp-driver
back-end
go
bmp-oob-alert
back-end
go
bmp-oob-agent
back-end
go
bmp-pronoea
backend
go
bmp-monitor-proxy
backend
go
bmp-dhcp-agent
backend
python
bmp-image
basic components
nginx
bmp-tftp
basic components
tftp
bmp-db
basic components
mysql
bmp-redis
basic components
redis
bmp-mq
basic components
rabbitmq
bmp-rsyslog
open source components
rsyslog
bmp-pushgateway
open source components
pushgateway
bmp-alertmanager
open source components
alertmanager
bmp-prometheus
open source components
prometheus
front-end components vue
application components
categories
language/components
bmp-console-web
front-end
vue
bmp-operation-web
front-end
vue
# node version requirements
Version 16.19.0
# Install nodejs
wget https://nodejs.org/dist/v16.19.0/node-v16.19.0-linux-x64.tar.xz
tar -xvf node-v16.19.0-linux-x64.tar.xz
mv node-v16.19.0-linux-x64 /usr/local/nodejs
cd /usr/bin
ln -s /usr/local/nodejs/bin/node node
ln -s /usr/local/nodejs/bin/npm npm
ln -s /usr/local/nodejs/bin/npx npx
# Configure npm image
npm config set registry http://registry.m.jd.com
# Install dependencies
npm install --legacy-peer-deps
# Packaging
npm run build-pre
# Local development and testing
npm run dev
Backend go component
Application component
Category
Language/component
bmp-console-web
Frontend
vue
bmp-operation-web
Frontend
vue
bmp-console-api
Backend
go
bmp-operation-api
Backend
go
bmp-openapi
Backend
go
bmp-scheduler
Backend
go
bmp-openapi-console
Backend
go
bmp-driver
Backend
go
bmp-oob-alert
Backend
go
bmp-oob-agent
Backend
go
bmp-pronoea
Backend
go
bmp-monitor-proxy
Backend
go
# Version requirement: golang:1.17
# Example bmp-openapi
cd bmp-openapi
# Compile
go build -o bmp-openapi
# Run
./bmp-openapi
Please note: The backend service needs to rely on middleware and other components. If local joint debugging is required, the dependent components need to be deployed in advance. For specific dependencies, see the conf directory file in each go component. For example, the conf file bmp-openapi.ini of bmp-openapi is as follows
# Requires python3.6+ environment
# Locally install dhcp service, for example centos system
sudo yum install dhcp
# Install python dependencies
pip install -i https://mirrors.jd.com/pypi/web/simple -r requirements.txt
# Run
cd bmp-dhcp-agent
python3 bmp-dhcp-agent./bmpda/cmd/server.py
Basic component
bmp-image
Main storage GuestOS image file, bmp-agent (installation node agent), device_import template (excel file), and use nginx to provide http service to the outside world
# Step 1: Install nginx, taking cetos as an example
yum install nginx
systemctl start nginx
# Step 2: Download files from JD Cloud Object Storage,
# The current downloadable images are recorded in config/image.cfg
# Download address:
bmp_oss_url=https://bmp.s3.cn-north-1.jdcloud-oss.com
# GuestOS image
bmp_oss_guestos_prefix=GuestOS
bmp_images_x86=(
v1.7.0-centos-7.9-2022070716.tar.xz
v1.7.0-ubuntu-18.04-2022062709.tar.xz
)
bmp_images_arm64=(
v1.7.0-centos-7.9-arm-2023080716.tar.xz
v1.7.0-ubuntu-18.04-arm-2023081111.tar.xz
)
bmp_images_loonarch64=(
v1.7.0-loongnix-8.4-2023110218.tar.xz
)
# bmp-agent
bmp_oss_agent_prefix=others
bmp_agent_images=(
bmp-agent.bin
bmp-agent.bin.arm
bmp-agent-windows.tgz
)
# Example of downloading bmp-agent
wget https://bmp.s3.cn-north-1.jdcloud-oss.com/others/bmp-agent.bin
# Step 3: Copy the downloaded file to the file directory of nginx, and take the default configuration of nginx as an example
cat default.conf
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
All files downloaded in step 2 need to be copied to the /usr/share/nginx/html directory
# Step 4: Start nginx
systemctl start nginx
# For more nginx configurations, please refer to the official website:
https://nginx.org/en/docs/
bmp-tftp
Application Components
Category
Language/Component
bmp-tftp
Basic Components
tftp
Let's briefly review the role of the following tftp service in the installation process:
Step 1: The installation node executes pxe startup, the PXEClient built into the network card starts, and sends a dhcp request broadcast. After receiving the dhcp request, the dhcp server built into the bmp-dhcp-agent responds to the corresponding ip configuration and tftp address
Step 2: PXEClient configures its own IP, then downloads the pxe boot program from bmp-tftp and executes it. The pxe boot program continues to obtain other boot parameters from bmp-tftp, downloads the kernel and initramfs, starts the memory operating system, and the bmp-agent service built into the memory operating system starts to start (this process is automatically downloaded by the system and does not require manual configuration)
So: bmp-tftp provides services for downloading kernels and liveOS images related to system startup
# Step 1: Install tftp
yum install tftp-server
Configure the TFTP server. In CentOS 7 and later versions, the configuration file for the TFTP service is located in /etc/xinetd.d/tftp. Use a text editor (such as vi or nano) to open the file and change disable = yes to disable = no to enable the TFTP service.
Save and close the file, then restart the xinetd service:
systemctl restart xinetd
# Step 2: Download the kernel and liveOs files from JD Cloud Object Storage
# The current downloadable images are recorded in config/image.cfg
# Download address:
bmp_oss_url=https://bmp.s3.cn-north-1.jdcloud-oss.com
# bootloader
bmp_bootloader_prefix=bootloader
bmp_bootloader_images=(
BOOTLOONGARCH64.EFI
grubaa64.efi
grubx64.efi
pxelinux.0
)
# LiveOS image bmp_oss_liveos_prefix=LiveOS bmp_kernel_name_x86=v2.0.7-centos_7_9-2024082914-vmlinuz bmp_initramfs_name_x86=v2.0.7-centos_7_9-2024082914-initramfs.gz bmp_kernel_name_arm64=v2.0.7-centos_7_9_ arm64-2024082914-vmlinuz bmp_initramfs_name_arm64=v2.0.7-centos_7_9_arm64-2024082914-initramfs.gz bmp_kernel_name_loonarch64=vmlinuz-loongarch bmp_initramfs_name_loonarch64=initramfs-loongarch.gz # Example; wget https://bmp.s3.cn-north-1.jdcloud-oss.com/bootloader/BOOTLOONGARCH64.EFI wget https://bmp.s3.cn-north-1.jdcloud-oss.com/LiveOS/v2.0.7-centos_7_9-2024082914-vmlinuz
# Step 3: Copy the downloaded file to the tftp file directory
The location of the tftp file directory needs to be checked in the /etc/xinetd.d/tftp file, for example:
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
The tftp file directory is /var/lib/tftpboot
Copy the file to the /var/lib/tftpboot directory, the structure is as follows:
.
├── images
│ ├── arm64
│ │ ├── v2.0.7-centos_7_9_arm64-2024082914-initramfs.gz
│ │ └── v2.0.7-centos_7_9_arm64-2024082914-vmlinuz
│ └── loongarch64
│ ├── initramfs-loongarch.gz
│ └── vmlinuz-loongarch
├── pxelinux.0
├── pxelinux.cfg
│ └── default
├── uefi
│ ├── arm64
│ │ ├── grubaa64.efi
│ │ └── grub.cfg
│ ├── loongarch64
│ │ ├── BOOTLOONGARCH64.EFI
│ │ └── grub.cfg
│ └── x86_64
│ ├── grub.cfg
│ └── grubx64.efi
├── v2.0.7-centos_7_9-2024082914-initramfs.gz
└── v2.0.7-centos_7_9-2024082914-vmlinuz
- pxelinux
- x86_64/grub.cfg
- arm64/grub.cfg
- loongarch64/grub.cfg
The configuration templates of these four files are located in the template directory and need to be copied manually
# Step 4: Start tftp service
systemctl restart xinetd
bmp-mysql
Application Components
Category
Language/Components
bmp-db
Basic Components
mysql
Here are the basic steps to install and deploy MySQL on a Linux system:
# Step 1: Install MySQL
sudo yum install mysql-server mysql -y
# Step 2: Start the MySQL service
sudo systemctl start mysqld
# Step 3: Run the security script
Run the MySQL security script to set the root password and other security options:
sudo mysql_secure_installation
Follow the prompts, including setting the root password, removing anonymous users, disabling root remote login, etc.
# Step 4: Log in to MySQL
mysql -u root -p
Enter the password you set in the previous step.
# Step 5: Create a new user and database
CREATE USER 'bmp_rw'@'%' IDENTIFIED BY 'LpK9Jq12Zf';
CREATE DATABASE bmp;
GRANT ALL PRIVILEGES ON bmp.* TO 'bmp_rw'@'%';
FLUSH PRIVILEGES;
# Step 6: Import initialization data
The data is located in sql/bmp.sql, import command
mysql -uroot -p bmp' < ./sql/bmp.sql
Enter the set root password
bmp-redis
Application Components
Category
Language/Component
bmp-redis
Basic Components
redis
To install Redis on CentOS 7, follow these steps:
# Step 1: Update System Packages
# First, update the system packages to get the latest package list:
sudo yum update -y
# Step 2: Install EPEL repository
# Redis is not part of the default software source of CentOS, so we need to add the EPEL (Extra Packages for Enterprise Linux) repository to get the Redis installation package:
sudo yum install epel-release -y
# Step 3: Install Redis
sudo yum install redis -y
# Step 4: Configure Redis password
The Redis configuration file is located in /etc/redis.conf
Uncomment the requirepass line and add the password you want to set after it. For example:
requirepass LpK9Jq12Zf
# Step 5: Start the Redis service
sudo systemctl start redis
# Step 6: Test the password
redis-cli -a mystrongpassword ping
bmp-mq
Application Components
Category
Language/Component
bmp-mq
Basic Components
rabbitmq
To install RabbitMQ on CentOS 7, follow these steps:
# Step 1: Add EPEL repository
First, you need to add the EPEL (Extra Packages for Enterprise Linux) repository to get the RabbitMQ installation package:
sudo yum install epel-release -y
# Step 2: Install Erlang
# RabbitMQ is written in Erlang, so we need to install Erlang first:
sudo yum install erlang -y
# Step 3: Install RabbitMQ
sudo yum install rabbitmq-server -y
# Step 4: Start the RabbitMQ service
sudo systemctl start rabbitmq-server
# Step 5: Create an administrator account
# By default, RabbitMQ does not have the management plugin enabled. We need to create an administrator account and enable the management plugin:
rabbitmqctl add_vhost /bmp
rabbitmqctl add_user bmp "LpK9Jq12Zf"
rabbitmqctl set_user_tags bmp administrator
rabbitmqctl set_permissions -p "/bmp" bmp '.*' '.*' '.*'
rabbitmqctl list_users
rabbitmqctl change_password $BMP_MQ_USER "$BMP_MQ_PASSWORD"
### 7. Access RabbitMQ Management Interface
You can now access the RabbitMQ management interface by accessing `http://your-server-ip:15672` through your browser. Log in using the administrator account you just created.
bmp-rsyslog
Application Components
Category
Language/Component
bmp-rsyslog
Open Source Components
rsyslog
To install rsyslog on CentOS 7, follow these steps:
# Step 1: Update system packages
First, update system packages to get the latest package list:
sudo yum update -y
# Step 2: Install rsyslog
sudo yum install rsyslog -y
# Step 3: Configure rsyslog
cat << EOF > /etc/rsyslog.d/bmp-rsyslog.conf
module(load="imudp") # needs to be done just once
input(type="imudp" port="514")
$template RemoteLogs,"/var/log/bmp/bmp-rsyslog/%fromhost-ip%/%PROGRAMNAME%-%$YEAR%-%$MONTH%-%$DAY%.log"
$template DynamicDir,"/var/log/bmp/bmp-rsyslog/%fromhost-ip%"
:syslogtag, startswith, "ip" ?DynamicDir
if $fromhost-ip != "127.0.0.1" then ?RemoteLogs
& ~
EOF
# Step 4: Start the rsyslog service
sudo systemctl start rsyslog
Open Source Components
Application Components
Category
Language/Components
bmp-prometheus
Open Source Components
prometheus
bmp-pushgateway
Open Source Components
pushgateway
bmp-alertmanager
Open source component
alertmanager
The above three monitoring and alarm components are open source Prometheus solutions and can be installed and used together.
The working principle of the three is
The application or service pushes the indicator data to Pushgateway.
The Prometheus server regularly pulls these indicator data from Pushgateway and stores them in its own time series database.
The information that triggers the alarm condition in Prometheus is sent by the alertmanager component
bmp-pushgateway
To install Pushgateway on CentOS 7, follow the steps below:
# Step 1: Download the Pushgateway binary file
First, download the Pushgateway binary file. You can get it from the official website of Prometheus or the GitHub repository. For example, use the following command to download Pushgateway v1.4.0:
wget https://github.com/prometheus/pushgateway/releases/download/v1.4.0/pushgateway-1.4.0.linux-amd64.tar.gz
# Step 2: Unzip the Pushgateway file
tar -xvf pushgateway-1.4.0.linux-amd64.tar.gz
# Step 3: Create the Pushgateway user and group
sudo groupadd --system pushgateway
sudo useradd --system -s /bin/false -g pushgateway pushgateway
# Step 4: Move the Pushgateway file to the appropriate location
sudo mv pushgateway-1.4.0.linux-amd64 /usr/local/pushgateway
# Step 5: Set file permissions
sudo chown -R pushgateway:pushgateway /usr/local/pushgateway
sudo chmod -R 755 /usr/local/pushgateway
# Step 6: Create Pushgateway configuration file
sudo mkdir /etc/pushgateway
sudo touch /etc/pushgateway/pushgateway.yml
Edit the `pushgateway.yml` file and add the configuration you want. For example:
web:
listen-address: ":9091"
# Step 7: Create Pushgateway service file
sudo cat << EOF > /etc/systemd/system/pushgateway.service
[Unit]
Description=Pushgateway
Wants=network-online.target
[Service]
User=pushgateway
Group=pushgateway
ExecStart=/usr/local/pushgateway/pushgateway \
--config.file /etc/pushgateway/pushgateway.yml \
--web.listen-address :9091
--web.enable-admin-api
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# Step 8: Start Pushgateway service
sudo systemctl daemon-reload
sudo systemctl start pushgateway