Initialize Swarm on Node 1
# docker swarm
init --advertise-addr=10.86.64.236
Swarm initialized: current node (n7w1dp3ub0illangx4qh96kld) is now a manager.
Swarm initialized: current node (n7w1dp3ub0illangx4qh96kld) is now a manager.
# docker
network create -d overlay dba_test-overlay
vlhzekq8v3kka6t7vns7dhnvc
vlhzekq8v3kka6t7vns7dhnvc
Node1- Add attachable network:
# docker
network create --driver=overlay --attachable <newtork_name>
7avvbx3tmfg36ae7bipfq0waf
Run Docker Container with Overlay
network:
# docker run
-it --name=mysql_8.0.18_1 \
--network <network_name> \
--volume=/mysql/<mysql_version>/<app_name>/data_1:/var/lib/mysql \
--publish <UserDefinedPortNo>:3306 \
-d mysql/mysql-server:8.0.18
Retrieve root user password for container mysql_5.7.25_2:
--network <network_name> \
--volume=/mysql/<mysql_version>/<app_name>/data_1:/var/lib/mysql \
--publish <UserDefinedPortNo>:3306 \
-d mysql/mysql-server:8.0.18
Retrieve root user password for container mysql_5.7.25_2:
# docker logs mysql_8.0.18_1
2>&1 | grep GENERATED
[Entrypoint] GENERATED ROOT PASSWORD: 0h7eD]UbfUs&ABjuzfuM@Hogw@w
[Entrypoint] GENERATED ROOT PASSWORD: 0h7eD]UbfUs&ABjuzfuM@Hogw@w
# docker exec
-it mysql_8.0.18_1 mysql -uroot –p
mysql> alter
user 'root'@'localhost' identified by 'root123#';
Query OK, 0 rows affected (0.00 sec)
mysql> create database shrenik;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on shrenik.* to 'test'@'%' ;
Query OK, 0 rows affected (0.01 sec)
mysql> create table t1
-> (
-> col_1 integer,
-> col_2 char(5)
-> );
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> create database shrenik;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on shrenik.* to 'test'@'%' ;
Query OK, 0 rows affected (0.01 sec)
mysql> create table t1
-> (
-> col_1 integer,
-> col_2 char(5)
-> );
Query OK, 0 rows affected (0.01 sec)
Connect server
using Yog / Workbench:
Hostname : <host_name>
Port : <UserDefinedPortNo>
User – <UserName>
Password - <Password>
Hostname : <host_name>
Port : <UserDefinedPortNo>
User – <UserName>
Password - <Password>
Spin another Docker container for MySQL
8.0.18 on same virtual host:
# docker run
-it --name=mysql_8.0.18_2 \
--network <Network_Name> \
--volume=/mysql/<MySQLVersion>/<AppName>/data/:/var/lib/mysql \
--publish <UserDefinedPortNo>:3306 \
-d mysql/mysql-server:8.0.18
--network <Network_Name> \
--volume=/mysql/<MySQLVersion>/<AppName>/data/:/var/lib/mysql \
--publish <UserDefinedPortNo>:3306 \
-d mysql/mysql-server:8.0.18
Retrieve root user password for
container mysql_5.7.25_2:
# docker logs mysql_8.0.18_2
2>&1 | grep GENERATED
[Entrypoint] GENERATED ROOT PASSWORD: osWAsYdObAJOklYg3carc0letYvO
[Entrypoint] GENERATED ROOT PASSWORD: osWAsYdObAJOklYg3carc0letYvO
mysql> alter user 'root'@'localhost' identified by 'root123#';
mysql> create database shrenik_1;
mysql>
create user 'test'@'%' identified by '<password>';
mysql> use
test_8018;
mysql>
create table t1_8018
-> (
->
-> col_1 integer,
-> col_2 varchar(25)
-> );
-> (
->
-> col_1 integer,
-> col_2 varchar(25)
-> );
Connect server
using Yog / Workbench:
Hostname : <hostname>
Port : 4999
User – test_8018
Password - <code>
Hostname : <hostname>
Port : 4999
User – test_8018
Password - <code>
Explore:
Docker Network
7 layers (level) of OSI
Docker v/s Kubernetes
Weave v/s Calico
Weave
VXLAN
What is VXLAN
VXLAN White papers
Docker Network
7 layers (level) of OSI
Docker v/s Kubernetes
Weave v/s Calico
Weave
VXLAN
What is VXLAN
VXLAN White papers
Comments
Post a Comment