Use MYSQL Replace H2 Database to Store Metadata(Optional)
MySQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat allows you to use MySQL to store structured relational data such as monitoring information, alarm information and configuration information.
If you already have a MySQL environment and the MySQL version meets the requirements, you can skip directly to the database creation step.
Supported MySQL Versions
Please ensure you are using a supported MySQL version. HertzBeat only supports MySQL 5.7+ or 8 versions. You can check the MySQL version with the following command:
$ mysql --version
mysql Ver 8.0.25 for Linux on x86_64 (MySQL Community Server - GPL)
Install MYSQL via Docker
-
Download and install the Docker environment For Docker installation, please refer to the Docker official documentation. After the installation, please verify in the terminal that the Docker version can be printed normally.
$ docker -v
Docker version 20.10.12, build e91ed57 -
Install MYSQl with Docker
$ docker run -d --name mysql \
-p 3306:3306 \
-v /opt/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=123456 \
--restart=always \
mysql:5.7-v /opt/data:/var/lib/mysqlis local persistent mount of mysql data directory./opt/datashould be replaced with the actual local directory. use$ docker psto check if the database started successfully