mysql 高可用

使用 docker compose 部署主从 mysql 的主从架构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
services:
mysql-master:
image: dockerhub.qingcloud.com/doubao/mysql:8.0.39
container_name: mysql-master
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
ports:
- "3306:3306"
volumes:
- ./master/data:/var/lib/mysql
- ./master/config/my.cnf:/etc/mysql/my.cnf
- ./master/logs:/var/log/mysql
networks:
- mysql-cluster

mysql-slave:
image: dockerhub.qingcloud.com/doubao/mysql:8.0.39
container_name: mysql-slave
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
ports:
- "3307:3306"
volumes:
- ./slave/data:/var/lib/mysql
- ./slave/config/my.cnf:/etc/mysql/my.cnf
- ./slave/logs:/var/log/mysql
depends_on:
- mysql-master
networks:
- mysql-cluster

networks:
mysql-cluster:
driver: bridge
阅读全文 »

安装 mysql9

使用docker compose安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
services:
mysql:
image: dockerhub.qingcloud.com/doubao/mysql:9.0.1
container_name: mysql9
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
ports:
- "3306:3306"
volumes:
- ../mysql/data:/var/lib/mysql
- ../mysql/my.cnf:/etc/mysql/my.cnf
- ../mysql/logs:/var/log/mysql
阅读全文 »

OCI (Open Container Initiative)

OCI(Open Container Initiative)即开放的容器运行时规范,目的在于定义一个容器运行时及镜像的相关标准和规范,其中包括

  • runtime-spec:容器的生命周期管理,具体参考runtime-spec
  • image-spec:镜像的生命周期管理,具体参考image-spec

实现 OCI 标准的容器运行时有runckata等。

CRI (Container Runtime Interface)

CRI 即容器运行时接口,主要用来定义 k8s 与容器运行时的 API 调用,kubelet 通过 CRI 来调用容器运行时,只要实现了 CRI 接口的容器运行时就可以对接到 k8s 的 kubelet 组件。

image-20240818154100206

阅读全文 »
0%