我要评分
获取效率
正确性
完整性
易理解

Configuring the Deployment Environment

Configure the deployment environment on multiple nodes to ensure a standardized operating environment for subsequent deployment.

  1. Log in to all nodes in sequence and change their host names to server1, agent1, agent2 and agent3.
    hostnamectl set-hostname host_name --static
  2. Log in to each node and add the mapping between the IP addresses and host names.
    1. Open the /etc/hosts file.
      1
      vi /etc/hosts
      
    2. Press i to enter the insert mode and add the following information to the hosts file. Change the IP address based on the site requirements.
      1
      2
      3
      4
      IPaddress1 server1
      IPaddress2 agent1
      IPaddress3 agent2
      IPaddress4 agent3
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Log in to each node and disable the firewall.
    1
    2
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    
  4. Log in to each node and enable password-free SSH login.
    1. Generate a key and press Enter if any message is prompted.
      1
      ssh-keygen -t rsa
      
    2. Enable password-free SSH login on each node (including password-free login for the local node):
      1
      ssh-copy-id -i ~/.ssh/id_rsa.pub root@node_IP_address
      
  5. Log in to each node and install JDK.
    1. Download JDK and decompress it to the /usr/local directory.
      1
      2
      3
      4
      wget https://mirror.iscas.ac.cn/kunpeng/archive/compiler/bisheng_jdk/bisheng-jdk-8u262-linux-aarch64.tar.gz
      tar -zxf bisheng-jdk-8u262-linux-aarch64.tar.gz -C /usr/local
      cd /usr/local
      ln -s /usr/local/bisheng-jdk1.8.0_262 java
      
    2. Change the owner and owner group of the decompressed JDK directory to root.
      1
      2
      chown -R root /usr/local/bisheng-jdk1.8.0_262
      chgrp -R root /usr/local/bisheng-jdk1.8.0_262
      
    3. Set environment variables.
      1. Open the /etc/profile file.
        1
        vi /etc/profile
        
      2. Press i to enter the insert mode and add the following content to the file:
        1
        2
        export JAVA_HOME=/usr/local/java
        export PATH=$JAVA_HOME/bin:$PATH
        
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Make the environment variables take effect.
      1
      source /etc/profile
      
    5. Check whether the OpenJDK is successfully installed.
      1
      java -version
      

      The installation is successful if information similar to the following is displayed:

  6. Log in to each node and install Scala.
    1. Obtain the Scala software package scala-2.12.10.tgz, save the package to the /usr/local directory on the server1 node, and decompress the package.
      1
      tar -zvxf scala-2.12.10.tgz
      
    2. Create a soft link.
      1
      ln -s scala-2.12.10 scala
      
    3. Open /etc/profile.
      1
      vi /etc/profile
      
    4. Press i to enter the insert mode and add the environment variables to the end of the file as follows:
      1
      2
      export SCALA_HOME=/usr/local/scala
      export PATH=$SCALA_HOME/bin:$PATH
      
    5. Press Esc, type :wq!, and press Enter to save the file and exit.
    6. Make the environment variables take effect.
      1
      source /etc/profile
      
  7. Deploy ZooKeeper. For details, see Deploying ZooKeeper to Running and Verifying ZooKeeper in ZooKeeper Deployment Guide.
  8. Deploy Hadoop. For details, see Compiling and Decompressing Hadoop to Verifying Hadoop in Hadoop Deployment Guide.