Environment Preparation Docker environment MySQL 5.7 (official image does not support mysql8) nacos Install MySQL in Docker Create a custom network (for container communication) docker network create common-network View Network docker network ls Create a mount folder //mysql configuration file mkdir -p /data/mysql/conf //mysql data file path mkdir –p /data/mysql/data //Log file path mkdir -p /data/mysql/logs Pull the image and start it docker run -p 3306:3306 --name mysql -d \ --restart=always \ --network common-network \ -v /data/mysql/conf:/etc/mysql/conf.d \ -v /data/mysql/logs:/logs \ -v /data/mysql/data:/data \ -e MYSQL_ROOT_PASSWORD=admin \ mysql:5.7 Install nacos in docker Pull the image //Query the nacos image docker search nacos //Pull the image docker pull nacos/nacos-server //View the docker images Start the nacos container docker run --network common-network --env MODE=standalone --name nacos -d -p 8848:8848 nacos/nacos-server View the started container docker ps Nacos configures the connection database to view the IP addresses of each container in the custom network //View the network docker network ls //View the network container docker network inspect common-network Enter the nacos container to modify the configuration // Enter the container docker exec -it nacos bash // Modify container configuration cd conf vi application.properties Create a database table (script address) https://github.com/alibaba/nacos/blob/develop/distribution/conf/nacos-mysql.sql Restarting the container docker restart nacos nacos management platform (new configuration, which can then be viewed in the database) http://ip:8848/nacos/index.html nacos/nacos (user name and password) This is the end of this article about installing nacos in docker and configuring the database. For more information about installing nacos in docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML tutorial, HTML default style
>>: Solution for importing more data from MySQL into Hive
Let me briefly describe some common basic graphic...
Preface: rm under Linux system is irreversible. T...
Preface: I recently encountered the problem of in...
This article describes the import and export oper...
Introduction to Docker Docker is an open source a...
1. Time formatting and other methods It is recomm...
Nowadays, cross-platform development technology i...
Copy code The code is as follows: <style type=...
This article shares the specific code for impleme...
Table of contents Vue3 encapsulation message prom...
Because using group by in MySQL always results in...
public function json_product_list($where, $order)...
summary Project description format <img src=&q...
Preface This is an investigation caused by the ex...
This article example shares the specific code of ...