1. 查找Docker Hub上的mysql镜像

$ sudo docker search mysql
NAME                              DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
mysql                             MySQL is a widely used, open-source relation…   8922                [OK]
mariadb                           MariaDB is a community-developed fork of MyS…   3135                [OK]
mysql/mysql-server                Optimized MySQL Server Docker images. Create…   659                                     [OK]
percona                           Percona Server is a fork of the MySQL relati…   462                 [OK]
centos/mysql-57-centos7           MySQL 5.7 SQL database server                   65
centurylink/mysql                 Image containing mysql. Optimized to be link…   61                                      [OK]
mysql/mysql-cluster               Experimental MySQL Cluster Docker images. Cr…   59
deitch/mysql-backup               REPLACED! Please use http://hub.docker.com/r…   41                                      [OK]
bitnami/mysql                     Bitnami MySQL Docker Image                      35                                      [OK]
tutum/mysql                       Base docker image to run a MySQL database se…   34
schickling/mysql-backup-s3        Backup MySQL to S3 (supports periodic backup…   28                                      [OK]
prom/mysqld-exporter                                                              23                                      [OK]
linuxserver/mysql                 A Mysql container, brought to you by LinuxSe…   22
centos/mysql-56-centos7           MySQL 5.6 SQL database server                   17
circleci/mysql                    MySQL is a widely used, open-source relation…   16
mysql/mysql-router                MySQL Router provides transparent routing be…   14
arey/mysql-client                 Run a MySQL client from a docker container      13                                      [OK]
openshift/mysql-55-centos7        DEPRECATED: A Centos7 based MySQL v5.5 image…   6
fradelg/mysql-cron-backup         MySQL/MariaDB database backup using cron tas…   4                                       [OK]
genschsa/mysql-employees          MySQL Employee Sample Database                  3                                       [OK]
devilbox/mysql                    Retagged MySQL, MariaDB and PerconaDB offici…   2
ansibleplaybookbundle/mysql-apb   An APB which deploys RHSCL MySQL                2                                       [OK]
jelastic/mysql                    An image of the MySQL database server mainta…   1
monasca/mysql-init                A minimal decoupled init container for mysql    0
widdpim/mysql-client              Dockerized MySQL Client (5.7) including Curl…   0                                       [OK]

2. 选择centos 7下的 mysql-57

$ sudo docker pull centos/mysql-57-centos7

3. 创建mysql数据库目录

$ sudo mkdir /data/mysql57
$ sudo chown mysql:mysql /data/mysql57
$ sudo chcon system_u:object_r:mysqld_db_t:s0 /data/mysql57

4. 使用mysql镜像

$ sudo docker run -p 3306:3306 --name mysql57 \
--volume=/data/mysql57/:/var/lib/mysql/data/ \
--restart=always \
-e MYSQL_ROOT_PASSWORD=123456 -d centos/mysql-57-centos7

5. 连接docker mysql

$ sudo docker exec -ti -u root mysql57 bash

  在RHEL 8/CentOS 8上安装Docker和Docker Compose的文章已经很多了, 不过都是要求禁用firewalld, 因为默认安装的 firewalld 会导致Docker容器DNS解析失败, 其实只需要修改一下 firewalld 的配置就可以正常工作的.

  在CentOS 8上安装Docker CE的步骤如下:

  1. 准备工作,CentOS 8的工作实例和具有sudo特权的用户

  2. 添加必要的Docker存储库

  我们将使用dnf config-manager实用程序添加Docker存储库。

$ sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

  3. 直接安装Docker CE会失败, 因为其要求 containerd.io 版本比较高, 然后会CentOS 8默认安装冲突, 所以需要手动安装 containerd.io 。

$ sudo dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.10-3.2.el7.x86_64.rpm

  4. 这时候就可以直接安装Docker CE了。

$ sudo dnf install docker-ce

  5. 为了强制DNS解析在Docker容器中起作用,必须禁用firewalld。

$ sudo systemctl disable firewalld

  6. 启用docker守护进程

$ sudo systemctl enable --now docker

  7. 为了无需使用 sudo 来启动 docker 我们需要把当前用户加入 docker 组.

$ sudo usermod -aG docker $USER

  以上就是CentOS 8上安装Docker CE的方法,不过这里面有个步骤就是要禁用firewalld,但是这个在生产环境下是绝对不可以的, 经查资料发现只需要开启伪装IP的功能就可以, 无需禁用firewalld。

$ sudo firewall-cmd --zone=public --add-masquerade --permanent
$ sudo firewall-cmd --reload
$ sudo systemctl restart docker

  正常安装未禁用firewalld下在Docker容器中无法解析域名.

$ docker run -it  --rm centos

[[email protected] /]# ping 192.168.0.5
PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data.
64 bytes from 192.168.0.5: icmp_seq=1 ttl=63 time=0.283 ms
^C
--- 192.168.0.5 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.283/0.283/0.283/0.000 ms

[[email protected] /]# ping www.baidu.com
ping: www.baidu.com: Name or service not known

  启用伪装IP后即可正常访问.

$ docker run -it  --rm centos
[[email protected] /]# ping www.baidu.com
PING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=1 ttl=54 time=22.3 ms
64 bytes from 14.215.177.38 (14.215.177.38): icmp_seq=2 ttl=54 time=21.9 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 21.915/22.122/22.330/0.255 ms

1. 安装lm_sensors

$ sudo yum install lm_sensors

2. 配置探头信息

$ sudo sensors-detect

3. 在 /etc/sensors3.conf 中的配置传感器参数

$ sudo vi /etc/sensors3.conf
chip "it8782-*"

    label in0 "VCore"
    label in1 "+5V"
    label in2 "+12V"
    label in3 "+3.3V"
    label in4 "5VSB"
    label fan1 "SYS Fan 1"
    label fan2 "SYS Fan 2"

    ignore in7

    compute in0 ((3/10) +1)*@ ,   @/((3/10) +1)
    compute in1 ((6.8/10)+1)*@ ,  @/((6.8/10)+1)
    compute in2 ((30/10) +1)*@ ,  @/((30/10) +1)
    compute in4 ((6.8/10)+1)*@ ,  @/((6.8/10)+1)

    set in0_min 0.91
    set in0_max 1.21

    set in1_min 5 * 0.95 
    set in1_max 5 * 1.05

    set in2_min 12 * 0.95 
    set in2_max 12 * 1.05

    set in3_min 3.3 * 0.95 
    set in3_max 3.3 * 1.05

    set in4_min 5 * 0.95 
    set in4_max 5 * 1.05

    set fan1_min 0
    set fan2_min 0

4. 输出示例

it8782-isa-0a40
Adapter: ISA adapter
VCore: +1.04 V (min = +0.92 V, max = +1.21 V)
+5V: +5.05 V (min = +4.76 V, max = +5.24 V)
+12V: +11.90 V (min = +11.39 V, max = +12.61 V)
+3.3V: +3.33 V (min = +3.14 V, max = +3.47 V)
5VSB: +5.08 V (min = +4.76 V, max = +5.24 V)
Vbat: +3.22 V
SYS Fan 1: 0 RPM (min = 0 RPM)
SYS Fan 2: 0 RPM (min = 0 RPM)
temp1: +36.0°C (low = +8.0°C, high = -64.0°C) ALARM sensor = thermal diode
temp2: +36.0°C (low = +20.0°C, high = +0.0°C) ALARM sensor = thermal diode
intrusion0: ALARM

I. 安装时启动黑屏的问题

1. 安装程序启动时按TAB键盘编辑启动命令行,尾处添加 rdblacklist=gma500_gfx 禁用gma500_gfx驱动.

II. 更新最新内核(3.10.0-327.36.3)后启动卡死问题

1. 修改 /etc/default/grub 默认启动参, 添加 initcall_blacklist=clocksource_done_booting 参数.

aaaaaa

2. 执行 grub2-mkconfig –output /boot/grub2/grub.cfg 重新生成 grub2 启动配置.

III. 启动黑屏问题

1. 把gma500_gfx列入黑名单

vi /etc/modprobe.d/blacklist.conf
blacklist gma500_gfx

2. 重编initramfs

dracut -f

IV.附加

sv3-26026

电源接线图示

说明书: SV3-26026 User Manual