[root@node1 ~]# cd /opt/
[root@node1 opt]# ls
apache-flume-1.9.0-bin.tar.gz apache-zookeeper-3.6.3-bin.tar.gz hadoop-3.0.0 mirrors.cgi?action=download nginx-1.19.1.tar.gz
apache-hive-2.1.1-bin.tar.gz flink-1.7.0 iceberg-flink-runtime-0.10.0.jar mirrors.cgi?action=download.1 rh
apache-pulsar-2.7.2 flink-1.7.0-bin-hadoop28-scala_2.12.tgz jdk1.8.0_131 mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz scala-2.12.8.tgz
apache-pulsar-2.7.2-bin.tar.gz flink-sql-connector-hive-2.3.6_2.11-1.11.0.jar kafka_2.13-2.8.0.tgz nacos sqoop-1.4.7.tar.gz
[root@node1 opt]# systemctl status mysql
unit mysql.service could not be found.
[root@node1 opt]# systemctl status docker
?docker.service - docker application container engine
loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
active: inactive (dead)
docs: http://docs.docker.com
[root@node1 opt]# systemctl start docker
[root@node1 opt]# systemctl status docker
?docker.service - docker application container engine
loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
active: active (running) since thu 2021-06-03 14:53:07 cst; 3s ago
docs: http://docs.docker.com
main pid: 4396 (dockerd-current)
tasks: 17
cgroup: /system.slice/docker.service
忖4396 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-pat...
忖4402 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/...
jun 03 14:53:04 node1 dockerd-current[4396]: time="2021-06-03t14:53:04.446068657 08:00" level=info msg="libcontainerd: new containerd process, pid: 4402"
jun 03 14:53:05 node1 dockerd-current[4396]: time="2021-06-03t14:53:05.734834925 08:00" level=info msg="graph migration to content-addressability took 0.00 seconds"
jun 03 14:53:05 node1 dockerd-current[4396]: time="2021-06-03t14:53:05.736392737 08:00" level=info msg="loading containers: start."
jun 03 14:53:05 node1 dockerd-current[4396]: time="2021-06-03t14:53:05.865123160 08:00" level=info msg="firewalld running: true"
jun 03 14:53:06 node1 dockerd-current[4396]: time="2021-06-03t14:53:06.873226021 08:00" level=info msg="default bridge (docker0) is assigned with an ip address 172.17.0.0/16. daemon opt...d ip address"
jun 03 14:53:07 node1 dockerd-current[4396]: time="2021-06-03t14:53:07.070178713 08:00" level=info msg="loading containers: done."
jun 03 14:53:07 node1 dockerd-current[4396]: time="2021-06-03t14:53:07.212263384 08:00" level=info msg="daemon has completed initialization"
jun 03 14:53:07 node1 dockerd-current[4396]: time="2021-06-03t14:53:07.212305820 08:00" level=info msg="docker daemon" commit="cccb291/1.13.1" graphdriver=overlay2 version=1.13.1
jun 03 14:53:07 node1 systemd[1]: started docker application container engine.
jun 03 14:53:07 node1 dockerd-current[4396]: time="2021-06-03t14:53:07.224890099 08:00" level=info msg="api listen on /var/run/docker.sock"
hint: some lines were ellipsized, use -l to show in full.
[root@node1 opt]# docker images
repository tag image id created size
docker.io/kafkaesqueio/pulsar 2.6.2.1.0.1-beta2 b6054dcca615 6 days ago 1.95 gb
docker.io/wurstmeister/kafka latest 4a83ed5f062f 12 days ago 438 mb
docker.io/redis latest bc8d70f9ef6c 3 weeks ago 105 mb
docker.io/mysql latest c0cdc95609f1 3 weeks ago 556 mb
docker.io/mysql
docker.io/tomcat latest 927899a31456 13 months ago 647 mb
docker.io/nginx latest 602e111c06b6 13 months ago 127 mb
docker.io/jaspeen/oracle-11g latest 0c8711fe4f0f 5 years ago 281 mb
[root@node1 opt]# docker run --help
usage: docker run [options] image [command] [arg...]
run a command in a new container
options:
--add-host list add a custom host-to-ip mapping (host:ip) (default [])
-a, --attach list attach to stdin, stdout or stderr (default [])
--blkio-weight uint16 block io (relative weight), between 10 and 1000, or 0 to disable (default 0)
--blkio-weight-device weighted-device block io weight (relative device weight) (default [])
--cap-add list add linux capabilities (default [])
--cap-drop list drop linux capabilities (default [])
--cgroup-parent string optional parent cgroup for the container
--cidfile string write the container id to the file
--cpu-count int cpu count (windows only)
--cpu-percent int cpu percent (windows only)
--cpu-period int limit cpu cfs (completely fair scheduler) period
--cpu-quota int limit cpu cfs (completely fair scheduler) quota
--cpu-rt-period int limit cpu real-time period in microseconds
--cpu-rt-runtime int limit cpu real-time runtime in microseconds
-c, --cpu-shares int cpu shares (relative weight)
--cpus decimal number of cpus (default 0.000)
--cpuset-cpus string cpus in which to allow execution (0-3, 0,1)
--cpuset-mems string mems in which to allow execution (0-3, 0,1)
--credentialspec string credential spec for managed service account (windows only)
-d, --detach run container in background and print container id
--detach-keys string override the key sequence for detaching a container
--device list add a host device to the container (default [])
--device-read-bps throttled-device limit read rate (bytes per second) from a device (default [])
--device-read-iops throttled-device limit read rate (io per second) from a device (default [])
--device-write-bps throttled-device limit write rate (bytes per second) to a device (default [])
--device-write-iops throttled-device limit write rate (io per second) to a device (default [])
--disable-content-trust skip image verification (default true)
--dns list set custom dns servers (default [])
--dns-option list set dns options (default [])
--dns-search list set custom dns search domains (default [])
--entrypoint string overwrite the default entrypoint of the image
-e, --env list set environment variables (default [])
--env-file list read in a file of environment variables (default [])
--expose list expose a port or a range of ports (default [])
--group-add list add additional groups to join (default [])
--health-cmd string command to run to check health
--health-interval duration time between running the check (ns|us|ms|s|m|h) (default 0s)
--health-retries int consecutive failures needed to report unhealthy
--health-timeout duration maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s)
--help print usage
-h, --hostname string container host name
--init run an init inside the container that forwards signals and reaps processes
--init-path string path to the docker-init binary
-i, --interactive keep stdin open even if not attached
--io-maxbandwidth string maximum io bandwidth limit for the system drive (windows only)
--io-maxiops uint maximum iops limit for the system drive (windows only)
--ip string container ipv4 address (e.g. 172.30.100.104)
--ip6 string container ipv6 address (e.g. 2001:db8::33)
--ipc string ipc namespace to use
--isolation string container isolation technology
--kernel-memory string kernel memory limit
-l, --label list set meta data on a container (default [])
--label-file list read in a line delimited file of labels (default [])
--link list add link to another container (default [])
--link-local-ip list container ipv4/ipv6 link-local addresses (default [])
--log-driver string logging driver for the container
--log-opt list log driver options (default [])
--mac-address string container mac address (e.g. 92:d0:c6:0a:29:33)
-m, --memory string memory limit
--memory-reservation string memory soft limit
--memory-swap string swap limit equal to memory plus swap: '-1' to enable unlimited swap
--memory-swappiness int tune container memory swappiness (0 to 100) (default -1)
--name string assign a name to the container
--network string connect a container to a network (default "default")
--network-alias list add network-scoped alias for the container (default [])
--no-healthcheck disable any container-specified healthcheck
--oom-kill-disable disable oom killer
--oom-score-adj int tune host's oom preferences (-1000 to 1000)
--pid string pid namespace to use
--pids-limit int tune container pids limit (set -1 for unlimited)
--privileged give extended privileges to this container
-p, --publish list publish a container's port(s) to the host (default [])
-p, --publish-all publish all exposed ports to random ports
--read-only mount the container's root filesystem as read only
--restart string restart policy to apply when a container exits (default "no")
--rm automatically remove the container when it exits
--runtime string runtime to use for this container
--security-opt list security options (default [])
--shm-size string size of /dev/shm, default value is 64mb
--sig-proxy proxy received signals to the process (default true)
--stop-signal string signal to stop a container, sigterm by default (default "sigterm")
--stop-timeout int timeout (in seconds) to stop a container
--storage-opt list storage driver options for the container (default [])
--sysctl map sysctl options (default map[])
--tmpfs list mount a tmpfs directory (default [])
-t, --tty allocate a pseudo-tty
--ulimit ulimit ulimit options (default [])
-u, --user string username or uid (format:
--userns string user namespace to use
--uts string uts namespace to use
-v, --volume list bind mount a volume (default [])
--volume-driver string optional volume driver for the container
--volumes-from list mount volumes from the specified container(s) (default [])
-w, --workdir string working directory inside the container
[root@node1 opt]# docker run --name mysqldb -p 3306:3306 -e mysql_root_password=123456 -d mysql
3abc248885e1760db8276a0f84982b6d82323196bfc1cd77e8e5d0547f468b75
[root@node1 opt]# docker images
repository tag image id created size
docker.io/kafkaesqueio/pulsar 2.6.2.1.0.1-beta2 b6054dcca615 6 days ago 1.95 gb
docker.io/wurstmeister/kafka latest 4a83ed5f062f 12 days ago 438 mb
docker.io/redis latest bc8d70f9ef6c 3 weeks ago 105 mb
docker.io/mysql latest c0cdc95609f1 3 weeks ago 556 mb
docker.io/mysql
docker.io/tomcat latest 927899a31456 13 months ago 647 mb
docker.io/nginx latest 602e111c06b6 13 months ago 127 mb
docker.io/jaspeen/oracle-11g latest 0c8711fe4f0f 5 years ago 281 mb
[root@node1 opt]# docker ps
container id image command created status ports names
3abc248885e1 mysql "docker-entrypoint..." 48 seconds ago up 46 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp mysqldb
[root@node1 opt]# mysql -uroot -p123456
bash: mysql: command not found...
[root@node1 opt]# systemctl status firewalld
?firewalld.service - firewalld - dynamic firewall daemon
loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
active: active (running) since thu 2021-06-03 14:03:52 cst; 56min ago
docs: man:firewalld(1)
main pid: 1175 (firewalld)
tasks: 2
memory: 820.0k
cgroup: /system.slice/firewalld.service
忖1175 /usr/bin/python -es /usr/sbin/firewalld --nofork --nopid
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t nat -c postrouting -s 172.17.0.0/16 ! -o docker0 -j masquerade' failed: iptables: no chain/ta... by that name.
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t nat -c docker -i docker0 -j return' failed: iptables: bad rule (does a matching rule exist in that chain?).
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -d forward -i docker0 -o docker0 -j drop' failed: iptables: bad rule (does a matching rule exist in that chain?).
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t filter -c forward -i docker0 -o docker0 -j accept' failed: iptables: bad rule (does a matchin... that chain?).
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t filter -c forward -i docker0 ! -o docker0 -j accept' failed: iptables: bad rule (does a match... that chain?).
jun 03 14:53:06 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t filter -c forward -o docker0 -m conntrack --ctstate related,established -j accept' failed: ip... that chain?).
jun 03 14:53:07 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t filter -c forward -o docker0 -j docker' failed: iptables: no chain/target/match by that name.
jun 03 14:58:11 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t nat -c docker -p tcp -d 0/0 --dport 3306 -j dnat --to-destination 172.17.0.2:3306 ! -i docker... by that name.
jun 03 14:58:11 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t filter -c docker ! -i docker0 -o docker0 -p tcp -d 172.17.0.2 --dport 3306 -j accept' failed:... that chain?).
jun 03 14:58:11 node1 firewalld[1175]: warning: command_failed: '/usr/sbin/iptables -w2 -t nat -c postrouting -p tcp -s 172.17.0.2 -d 172.17.0.2 --dport 3306 -j masquerade' failed: ipt... by that name.
hint: some lines were ellipsized, use -l to show in full.
[root@node1 opt]# systemctl stop firewalld
[root@node1 opt]# docker exec -it 3abc248885e1 /bin/bash
root@3abc248885e1:/# mysql -uroot -p
enter password:
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 13
server version: 8.0.25 mysql community server - gpl
m6米乐中国在线登录入口 copyright (c) 2000, 2021, oracle and/or its affiliates.
oracle is a registered trademark of oracle corporation and/or its
affiliates. other names may be trademarks of their respective
owners.
type 'help;' or '\h' for help. type '\c' to clear the current input statement.
-- mysql 出现client does not support authentication protocol requested by serverm6米乐中国在线登录入口的解决方案
mysql> select host,user,plugin,authentication_string from mysql.user;
----------- ------------------ ----------------------- ------------------------------------------------------------------------
| host | user | plugin | authentication_string |
----------- ------------------ ----------------------- ------------------------------------------------------------------------
z % [raa3vdcn9hwrn6bkyd0fjqygrdjbdqzluyvhgktjel018 | $a$005$7b^-3#b
| localhost | mysql.infoschema | caching_sha2_password | $a$005$thisisacombinationofinvalidsaltandpasswordthatmustneverbrbeused |
| localhost | mysql.session | caching_sha2_password | $a$005$thisisacombinationofinvalidsaltandpasswordthatmustneverbrbeused |
| localhost | mysql.sys | caching_sha2_password | $a$005$thisisacombinationofinvalidsaltandpasswordthatmustneverbrbeused |
| localhost | root | caching_sha2_password | $a$005$%'oyb9s1gp)sd
9lj6gtgbi2nlv8a59vw23q2jdl5hqgbzuielhg/ky9dx5 |
----------- ------------------ ----------------------- ------------------------------------------------------------------------
5 rows in set (0.13 sec)
mysql> alter user 'root'@'%' identified with mysql_native_password by '123456';
query ok, 0 rows affected (0.11 sec)
mysql>