docker操作 -欧洲杯足彩官网

0顶
0踩

docker操作

2022-07-13 13:17 by 见习记者 gaojingsong 评论(0) 有2964人浏览

[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                               a7a67c95e831        13 months ago       541 mb

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                               a7a67c95e831        13 months ago       541 mb

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

 

欧洲杯足彩官网 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 server欧洲杯足彩官网的解决方案

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> 

 

0
0
评论 共 0 条 请登录后发表评论

发表评论

您还没有登录,请您登录后再发表评论

相关推荐

  • docker 容器化技术

  • docker简介和安装 本博客主要解决在windows环境下,快速上手使用docker的问题,主要会介绍在windows系统下docker desktop的安装,docker 基础命令,比如说下载镜像、启动镜像...其他系统应该除了安装外其他操作都可以通用。

  • docker操作mysql镜像容器

  • 2、查看所有状态容器——docker ps -a ...二、docker 镜像操作 1、搜索镜像(公共仓库)——docker search 默认是在公共仓库找,如果有私有仓库,会在私有仓库找 2、下载镜像——docker pu

  • docker的基本操作

  • python操作docker

  • 将容器与数据分离, 解耦合, 方便操作容器内的数据, 保证数据安全 2. 数据卷操作命令 #help 帮助 docker volume --help docker volume create ${数据卷名} ##创建数据卷 docker volume inspect${数据卷名} ##查看...

  • 一、docker镜像操作

  • docker使用过程中,如果要操作本地文件,就需要在操作的目录中创建一个docker-compose.yml文件。 // docker-compose.yml version: '3' services: web: image: tesseractshadow/tesseract4re #build: . container...

  • docker容器操作 1、查看运行容器:docker ps 2、查看所有容器:docker ps -a 下面字符串d27bd3008ad9为容器id,上图红框中 3、进入容器:docker exec -it d27bd3008ad9 /bin/bash 4、停止容器:docker stop ...

  • 查看是否存在docker用户组cat /etc/group |grep docker 如果没有就添加一个groupadd docker 添加用户到docker分组addgroup xingxing docker 查看用户的分组groups xingxing 用户如果还是没有权限,可以尝试...

  • docker 下载镜像源 docker pull 'name':tag 如:docker pull mysql:8.0.19 不写tag默认least最新版 启动mysql8.0.19 docker run -p 3306:3306 --name mysqltest01 -e mysql_root_password=123456 -d mysql:tag ...

  • 一. 下载离线安装包 软件包网址: ...tar –zxvf docker-20.10.0.tgz cp docker/* /usr/bin/ /*不是注释! 四.

  • docker常用命令解释及总结,简洁明了,清晰易懂

  • docker最新超详细教程——基本操作,docker镜像、容器、数据卷。还有一个超好用的小工具finalshell

  • 文章目录 docker操作容器 1. 启动容器 2. 终止容器 3. 启动已终止容器 4. 守护态运行(后台运行) 5. 容器日志 6. 进入容器 7. 删除容器 8. 清理所有处于终止状态的容器

  • 容器内部运行宿主机的docker命令 实现这种需求,其实非常简单,你只需要将docker宿主机的docker文件和docker.sock文件挂载到容器中即可,具体为: -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker...

  • docker 常用命令大全

  • 查看linux系统内核版本:docker要求centos系统的内核版本高于3.10,否则用yum update升级linux系统内核; [root@localhost ~]# clear [root@localhost ~]# uname -r 4.18.0-193.14.2.el8_2.x86_64 安装docker:...

  • 1. 要求 修改tomcat镜像,要求把tomcat启动端口改成8889并启动容器 2. 思路 从tomcat的原始镜像启动一个tomcat容器 ...3. 操作步骤 3.1 用docker下载tomcat镜像,创建容器,启动/进入tomcat容器 .

global site tag (gtag.js) - google analytics
网站地图