Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Tengine by Using a Script

Software Version

Whether to Support CentOS 7.6

Whether to Support CentOS 8.1

Whether to Support openEuler 20.03 (LTS-SP1)

Tengine 2.2.2

Yes

No

No

Tengine 2.2.3

No

No

No

  1. Obtain the Tengine script package.
    1. Download the script package using a local browser.

      Download address: https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/tengine_automation.tar.gz

    2. Copy the script package to the /home directory.

      If the server is connected to the Internet, you can run the wget command on the server to download the script package.

      1
      2
      cd /home/
      wget https://mirrors.huaweicloud.com/kunpeng/archive/kunpeng_solution/web/Scripts/tengine_automation.tar.gz --no-check-certificate
      
  2. Decompress the script package.
    1
    tar -xzvf tengine_automation.tar.gz
    

  3. Go to the tengine_automation directory and query the files in the directory.
    1
    2
    cd tengine_automation
    ll
    

    Table 1 describes the script directory structure.

    Table 1 Overall script directory structure

    Directory

    Description

    deps

    Directory used for compilation and installation

    NOTE:

    The installer script obtains the OpenSSL and Tengine source code using the wget command. If the server is not connected to the Internet, download the source code (see Upgrading OpenSSL and Installing Tengine by Compiling the Source Code) and save it to this directory.

    scripts

    Optimization script directory, which contains the common optimization script, Nginx configuration optimization script, and the script for binding NIC interrupts to cores.

    install.sh

    Script used to implement one-click compilation, deployment, and tuning.

    rollback.sh

    Rollback script, which is used to roll back all operations of the script.

    startNginx.sh

    Script for starting the Nginx instance.

  4. Configure the network ports in the environment.
    1. Modify the install.sh file.
      1
      vim install.sh
      
    2. Press i to enter the insert mode, find parameters eth0 and eth2, and enter the network port names in the current environment.
    3. Set sense based on actual situation.
    4. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Run the install.sh script. After the script is executed, restart the device for the optimization to take effect.
    1
    sh install.sh
    

    The operation of binding NIC interrupts to cores becomes invalid after the device is restarted. Therefore, this operation is directly written to the /etc/profile file. The command for binding NIC interrupts to cores is executed each time the device is restarted.

  6. Run the startNginx.sh script to start Nginx. Then, run the ps command to check the Nginx process.
    1
    sh startNginx.sh
    

    • After step 6 is performed, you can skip Running Tengine.
    • If the environment needs to be rolled back or the deployment using a script fails, run the rollback script to roll back the script operation and restart the device.
      1
      sh rollback.sh