• 华为aarch64架构的泰山服务器EulerOS 2.0 (SP8)系统离线安装saltstack3003.1实践


    华为泰山服务器的CPU芯片架构为aarch64,所装系统为EulerOS 2.0 (SP8)aarch64系统,安装saltstack比较困难。本文讲解通过pip安装方式离线安装saltstack3003.1以进行集中化管理和维护。

    一、系统环境

    1、操作系统版本

    1. [root@localhost ~]# cat /etc/os-release
    2. NAME="EulerOS"
    3. VERSION="2.0 (SP8)"
    4. ID="euleros"
    5. ID_LIKE="rhel fedora centos"
    6. VERSION_ID="2.0"
    7. PRETTY_NAME="EulerOS 2.0 (SP8)"
    8. ANSI_COLOR="0;31"

    2、python版本及所能识别支持的包信息 

    1. [root@localhost ~]# python
    2. Python 3.7.0 (default, Mar 16 2020, 00:02:15)
    3. [GCC 7.3.0] on linux
    4. Type "help", "copyright", "credits" or "license" for more information.
    5. >>> import pip
    6. >>> import pip._internal.pep425tags
    7. >>> print(pip._internal.pep425tags.get_supported())
    8. [('cp37', 'cp37m', 'linux_aarch64'), ('cp37', 'abi3', 'linux_aarch64'), ('cp37', 'none', 'linux_aarch64'), ('cp36', 'abi3', 'linux_aarch64'), ('cp35', 'abi3', 'linux_aarch64'), ('cp34', 'abi3', 'linux_aarch64'), ('cp33', 'abi3', 'linux_aarch64'), ('cp32', 'abi3', 'linux_aarch64'), ('py3', 'none', 'linux_aarch64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
    9. >>> exit()
    10. [root@localhost ~]#

    3、服务器CPU架构

    1. [root@localhost ~]# uname -m
    2. aarch64

     4、操作系统内核信息

    1. [root@localhost ~]# rpm -qa |grep kernel
    2. kernel-4.19.36-vhulk1907.1.0.h702.eulerosv2r8.aarch64
    3. kernel-headers-4.19.36-vhulk1907.1.0.h475.eulerosv2r8.aarch64

    二、准备相关的软件包

    1、软件包内容

    1. [root@localhost tmp]# cd salt-pip/
    2. [root@localhost salt-pip]# ll
    3. total 13752
    4. -rw-r-----. 1 root root 155255 Sep 18 19:20 certifi-2022.12.7-py3-none-any.whl
    5. -rw-r-----. 1 root root 45489 Sep 18 19:20 charset_normalizer-3.0.1-py3-none-any.whl
    6. -rw-r-----. 1 root root 9570 Sep 18 19:20 contextvars-2.4.tar.gz
    7. -rw-r-----. 1 root root 20315 Sep 18 19:20 distro-1.8.0-py3-none-any.whl
    8. -rw-r-----. 1 root root 61538 Sep 18 19:20 idna-3.4-py3-none-any.whl
    9. -rw-r-----. 1 root root 116441 Sep 18 19:20 immutables-0.19-cp37-cp37m-linux_aarch64.whl
    10. -rw-r-----. 1 root root 133357 Sep 18 19:20 Jinja2-3.0.0-py3-none-any.whl
    11. -rw-r-----. 1 root root 9669 Sep 18 19:20 MarkupSafe-2.1.1-py3-none-any.whl
    12. -rw-r-----. 1 root root 15541 Sep 18 19:20 msgpack-1.0.4-py3-none-any.whl
    13. -rw-r-----. 1 root root 2071041 Sep 18 19:20 pycryptodomex-3.16.0-cp35-abi3-linux_aarch64.whl
    14. -rw-r-----. 1 root root 656952 Sep 18 19:20 PyYAML-6.0-cp37-cp37m-linux_aarch64.whl
    15. -rw-r-----. 1 root root 863287 Sep 18 19:20 pyzmq-25.0.0-cp37-cp37m-linux_aarch64.whl
    16. -rw-r-----. 1 root root 62822 Sep 18 19:20 requests-2.28.2-py3-none-any.whl
    17. -rw-r-----. 1 root root 256 Sep 18 19:20 requirements-euler2.8-salt.txt
    18. -rw-r-----. 1 root root 9654098 Sep 18 19:20 salt-3003.1-py3-none-any.whl
    19. -rw-r-----. 1 root root 26662 Sep 18 19:20 typing_extensions-4.4.0-py3-none-any.whl
    20. -rw-r-----. 1 root root 140642 Sep 18 19:20 urllib3-1.26.14-py2.py3-none-any.whl

    2、依赖包描述文件requirements-euler2.8-salt.txt内容 

    1. [root@localhost salt-pip]# cat requirements-euler2.8-salt.txt
    2. certifi==2022.12.7
    3. charset-normalizer==3.0.1
    4. contextvars==2.4
    5. idna==3.4
    6. immutables==0.19
    7. Jinja2==3.0.0
    8. MarkupSafe==2.1.1
    9. msgpack==1.0.4
    10. pycryptodomex==3.16.0
    11. PyYAML==6.0
    12. pyzmq==25.0.0
    13. requests==2.28.2
    14. salt==3003.1
    15. typing-extensions==4.4.0
    16. urllib3==1.26.14

     三、安装测试

    1、编写安装脚本install.sh

    1. #!/bin/bash
    2. ##__author__='daigjianbing'
    3. pip3 install --no-index --find-links . -r requirements-euler2.8-salt.txt
    4. which salt-minion
    5. salt --version
    6. targetfile='/usr/lib/systemd/system/salt-minion.service'
    7. if [ ! -f $targetfile ];then
    8. cat > $targetfile <<"EOF"
    9. ##__author__='daigjianbing'
    10. [Unit]
    11. Description=The Salt Minion
    12. Documentation=man:salt-minion(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltstack.com/en/latest/contents.html
    13. After=network.target salt-master.service
    14. [Service]
    15. KillMode=process
    16. Type=notify
    17. NotifyAccess=all
    18. LimitNOFILE=8192
    19. ExecStart=/usr/local/bin/salt-minion
    20. [Install]
    21. WantedBy=multi-user.target
    22. EOF
    23. fi
    24. chmod 644 $targetfile
    25. systemctl daemon-reload
    26. if [ ! -d "/etc/salt" ]; then
    27. mkdir -p /etc/salt
    28. chmod 755 /etc/salt
    29. fi
    30. targetfile='/etc/salt/minion'
    31. if [ ! -f $targetfile ];then
    32. cat > $targetfile <<"EOF"
    33. ##__author__='daigjianbing'
    34. master: server
    35. id: test
    36. hash_type: sha256
    37. EOF
    38. fi
    39. systemctl enable --now salt-minion
    40. systemctl status salt-minion

    2、执行安装

    1. [root@localhost salt-pip]# sh install.sh
    2. WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
    3. Looking in links: .
    4. Collecting certifi==2022.12.7 (from -r requirements-euler2.8-salt.txt (line 1))
    5. Collecting charset-normalizer==3.0.1 (from -r requirements-euler2.8-salt.txt (line 2))
    6. Collecting contextvars==2.4 (from -r requirements-euler2.8-salt.txt (line 3))
    7. Collecting idna==3.4 (from -r requirements-euler2.8-salt.txt (line 4))
    8. Collecting immutables==0.19 (from -r requirements-euler2.8-salt.txt (line 5))
    9. Collecting Jinja2==3.0.0 (from -r requirements-euler2.8-salt.txt (line 6))
    10. Collecting MarkupSafe==2.1.1 (from -r requirements-euler2.8-salt.txt (line 7))
    11. Collecting msgpack==1.0.4 (from -r requirements-euler2.8-salt.txt (line 8))
    12. Collecting pycryptodomex==3.16.0 (from -r requirements-euler2.8-salt.txt (line 9))
    13. Collecting PyYAML==6.0 (from -r requirements-euler2.8-salt.txt (line 10))
    14. Collecting pyzmq==25.0.0 (from -r requirements-euler2.8-salt.txt (line 11))
    15. Collecting requests==2.28.2 (from -r requirements-euler2.8-salt.txt (line 12))
    16. Collecting salt==3003.1 (from -r requirements-euler2.8-salt.txt (line 13))
    17. Collecting typing-extensions==4.4.0 (from -r requirements-euler2.8-salt.txt (line 14))
    18. Collecting urllib3==1.26.14 (from -r requirements-euler2.8-salt.txt (line 15))
    19. Requirement already satisfied: distro>=1.0.1 in /usr/local/lib/python3.7/site-packages (from salt==3003.1->-r requirements-euler2.8-salt.txt (line 13)) (1.8.0)
    20. Installing collected packages: certifi, charset-normalizer, typing-extensions, immutables, contextvars, idna, MarkupSafe, Jinja2, msgpack, pycryptodomex, PyYAML, pyzmq, urllib3, requests, salt
    21. Successfully installed Jinja2-3.0.0 MarkupSafe-2.1.1 PyYAML-6.0 certifi-2022.12.7 charset-normalizer-3.0.1 contextvars-2.4 idna-3.4 immutables-0.19 msgpack-1.0.4 pycryptodomex-3.16.0 pyzmq-25.0.0 requests-2.28.2 salt-3003.1 typing-extensions-4.4.0 urllib3-1.26.14
    22. /usr/local/bin/salt-minion
    23. salt 3003.1
    24. Created symlink /etc/systemd/system/multi-user.target.wants/salt-minion.service → /usr/lib/systemd/system/salt-minion.service.
    25. ● salt-minion.service - The Salt Minion
    26. Loaded: loaded (/usr/lib/systemd/system/salt-minion.service; enabled; vendor preset: disabled)
    27. Active: active (running) since Mon 2023-09-18 20:17:21 CST; 11ms ago
    28. Docs: man:salt-minion(1)
    29. file:///usr/share/doc/salt/html/contents.html
    30. https://docs.saltstack.com/en/latest/contents.html
    31. Main PID: 291056 (salt-minion)
    32. Tasks: 1 (limit: 51200)
    33. Memory: 17.0M
    34. CGroup: /system.slice/salt-minion.service
    35. └─291056 /usr/bin/python3 /usr/local/bin/salt-minion
    36. Sep 18 20:17:20 localhost systemd[1]: Starting The Salt Minion...
    37. Sep 18 20:17:21 localhost systemd[1]: Started The Salt Minion.

    看到 active (running),可见salt-minion服务已正常运行起来了。

    四、验证结果

    1、验证版本及可执行程序情况 

    1. root@localhost salt-pip]# salt --version
    2. salt 3003.1
    3. [root@localhost salt-pip]# /usr/local/bin/salt-minion --version
    4. salt-minion 3003.1
    5. [root@localhost salt-pip]# ll /usr/local/bin/salt*
    6. -rwxr-xr-x. 1 root root 225 Sep 18 20:17 /usr/local/bin/salt
    7. -rwxr-xr-x. 1 root root 223 Sep 18 20:17 /usr/local/bin/salt-api
    8. -rwxr-xr-x. 1 root root 225 Sep 18 20:17 /usr/local/bin/salt-call
    9. -rwxr-xr-x. 1 root root 227 Sep 18 20:17 /usr/local/bin/salt-cloud
    10. -rwxr-xr-x. 1 root root 221 Sep 18 20:17 /usr/local/bin/salt-cp
    11. -rwxr-xr-x. 1 root root 223 Sep 18 20:17 /usr/local/bin/salt-key
    12. -rwxr-xr-x. 1 root root 229 Sep 18 20:17 /usr/local/bin/salt-master
    13. -rwxr-xr-x. 1 root root 229 Sep 18 20:17 /usr/local/bin/salt-minion
    14. -rw-r-----. 1 root root 1027 Sep 18 20:17 /usr/local/bin/salt-proxy
    15. -rwxr-xr-x. 1 root root 223 Sep 18 20:17 /usr/local/bin/salt-run
    16. -rwxr-xr-x. 1 root root 223 Sep 18 20:17 /usr/local/bin/salt-ssh
    17. -rwxr-xr-x. 1 root root 229 Sep 18 20:17 /usr/local/bin/salt-syndic
    18. -rwxr-xr-x. 1 root root 227 Sep 18 20:17 /usr/local/bin/salt-unity

     2、核对服务运行情况

    如上,可见安装已完全成功。

    五、相关安装包下载

    本人打包好的安装包文件下载

  • 相关阅读:
    正大国际:期货结算价是如何理解呢?结算价有什么作用?
    微信小程序实现连续签到七天
    吴恩达深度学习笔记(六)——超参数调试、Batch正则化和程序框架
    STM32人脸识别系统设计(程序代码+论文)
    3. 数组+【矩阵压缩存储】:对称、三角、三对角、稀疏矩阵
    29.9.3 使用mysql命令导出数据
    如何在postman中实现自动化测试?
    web:[极客大挑战 2019]HardSQL
    Docker安装与应用全套讲解
    JAVA学习-----TreeMap
  • 原文地址:https://blog.csdn.net/forestqq/article/details/132964619