Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Docker

Install Docker and deploy multiple containers to set up the Flink environment. If the server cannot connect to the Internet, configure a local yum repository according to your environment to ensure a smooth installation.

  1. Install Docker and import the basic image. For details, see Docker Installation Guide (CentOS & openEuler) .
    cd /opt
    wget --no-check-certificate https://mirrors.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/docker_img/aarch64/openEuler-docker.aarch64.tar.xz
    docker load < openEuler-docker.aarch64.tar.xz
  2. Create a network in bridge mode.
    docker network create -d bridge flink-network

    Check whether the network is created successfully.

    docker network ls

  3. Create and start three Docker containers.
    The containers have the 8c32g specification, and are named flink_jm_8c32g, flink_tm1_8c32g, and flink_tm2_8c32g. After all containers are started, the command execution process automatically exits.
    docker run -it -d --name flink_jm_8c32g --cpus=8 --memory=32g --network flink-network openeuler-22.03-lts-sp4 /bin/bash 
    docker run -it -d --name flink_tm1_8c32g --cpus=8 --memory=32g --network flink-network openeuler-22.03-lts-sp4 /bin/bash 
    docker run -it -d --name flink_tm2_8c32g --cpus=8 --memory=32g --network flink-network openeuler-22.03-lts-sp4 /bin/bash 
  4. Query the container IDs.
    docker ps

    The first column in the following figure shows the container IDs.

  5. Log in to all containers, enable the SSH service in the containers, and configure password-free login.
    1. Log in to the containers in sequence and perform 5.b to 5.g.
      docker exec -it flink_jm_8c32g /bin/bash
      docker exec -it flink_tm1_8c32g /bin/bash
      docker exec -it flink_tm2_8c32g /bin/bash
    2. Install the SSH service dependency, password change dependency, command editing dependency, command search dependency, and network management dependency. If other dependencies are missing in the image, install them by yourself.
      yum -y install openssh-clients openssh-server passwd vim findutils net-tools libXext libXrender gcc cmake make gcc-c++ unzip wget libXtst
    3. Generate an RSA key.
      ssh-keygen -A
    4. Enable the SSH service in the container.
      /usr/sbin/sshd -D &
    5. Set a password for the container.
      # Set the password of the current user. Remember the password.
      passwd
    6. Generate an RSA key again. When a message is displayed, press Enter.
      ssh-keygen -t rsa
    7. Exit the container.
      exit
    8. On the flink_jm_8c32g container, enable SSH password-free login to other containers.
      docker exec -it flink_jm_8c32g /bin/bash
      ssh-copy-id -i ~/.ssh/id_rsa.pub root@flink_tm1_8c32g
      ssh-copy-id -i ~/.ssh/id_rsa.pub root@flink_tm2_8c32g