Detailed tutorial on installing nacos in docker and configuring the database

Detailed tutorial on installing nacos in docker and configuring the database

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 

Effect

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 

insert image description here

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 

insert image description here
insert image description here

Enter the nacos container to modify the configuration

// Enter the container docker exec -it nacos bash
// Modify container configuration cd conf
vi application.properties 

insert image description here

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) 

insert image description here
insert image description here

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:
  • Detailed explanation of the implementation process of Nacos docker stand-alone mode deployment
  • Docker+nacos+seata1.3.0 installation and usage configuration tutorial
  • Teach you how to deploy nacos in docker

<<:  HTML tutorial, HTML default style

>>:  Solution for importing more data from MySQL into Hive

Recommend

How to deploy Angular project using Docker

There are two ways to deploy Angular projects wit...

Detailed explanation of several examples of insert and batch statements in MySQL

Table of contents Preface 1.insert ignore into 2....

MySQL online DDL tool gh-ost principle analysis

Table of contents 1. Introduction 1.1 Principle 1...

A detailed discussion on detail analysis in web design

In design work, I often hear designers participati...

Summary of the differences between Mysql primary key and unique key

What is a primary key? A primary key is a column ...

Data Structure - Tree (III): Multi-way Search Tree B-tree, B+ tree

Multi-way search tree Height of a complete binary...

How to maintain MySQL indexes and data tables

Table of contents Find and fix table conflicts Up...

Detailed examples of Zabbix remote command execution

Table of contents one. environment two. Precautio...

Example of using CSS3 to create Pikachu animated wallpaper

text OK, next it’s time to show the renderings. O...

MySQL 5.7.18 version free installation configuration tutorial

MySQL is divided into installation version and fr...

Summary of 10 common HBase operation and maintenance tools

Abstract: HBase comes with many operation and mai...

JavaScript implements product details of e-commerce platform

This article shares a common example of viewing p...

Detailed explanation of selinux basic configuration tutorial in Linux

selinux ( Security-Enhanced Linux) is a Linux ker...

Detailed introduction to nobody user and nologin in Unix/Linux system

What is the nobody user in Unix/Linux systems? 1....