Red Hat Training

A Red Hat training course is available for Red Hat Satellite

12.3. 配置 Red Hat Satellite Capsule Server

先決條件

繼續這項工作前,必須先滿足以下條件:

  • 安裝 Red Hat Satellite Server
  • 在作為 Satellite Capsule Server 的電腦上,將 SELinux 的存取權限設為「強制」(enforcing)。
以下程序將配置 Satellite Capsule Server,以搭配 Red Hat Satellite Server 使用。這包括以下幾種 Satellite Capsule Server 的類型:
  • Satellite Capsule Server 搭配 Smart Proxy
  • Satellite Capsule Server 作為內容節點(Content Node)
  • Satellite Capsule Server 作為內容節點,並搭配 Smart Proxy
要配置 Satellite Capsule Server:
  1. 在 Satellite Server 上:
    1. 產生 Satellite Capsule Server 的憑證:
      capsule-certs-generate --capsule-fqdn capsule_FQDN --certs-tar ~/capsule.example.com-certs.tar
      
      其中:
      • capsule_FQDN 是 Satellite Capsule Server 的 FQDN。(必要選項)
      • certs-tar 是要給 Satellite Capsule 安裝程式使用、包含了憑證的 tar 壓縮檔名稱。
      執行 capsule-certs-generate 會產生以下訊息:
          To finish the installation, follow these steps:
        1. Ensure that the capsule-installer is available on the system.
           The capsule-installer comes from the katello-installer package and
           should be acquired through the means that are appropriate to your deployment.
        2. Copy ~/capsule.example.com-certs.tar to the capsule system capsule.example.com
        3. Run the following commands on the capsule (possibly with the customized
           parameters, see capsule-installer --help and
           documentation for more info on setting up additional services):
        rpm -Uvh http://master.com/pub/katello-ca-consumer-latest.noarch.rpm
        subscription-manager register --org "Default Organization"
        capsule-installer --parent-fqdn          "sat6.example.com"\
                          --register-in-foreman  "true"\
                          --foreman-oauth-key    "xmmQCGYdkoCRcbviGfuPdX7ZiCsdExf
                          --foreman-oauth-secret "w5ZDpyPJ24eSBNo53AFybcnqoDYXgLUA"\
                          --pulp-oauth-secret    "doajBEXqNcANy93ZbciFyysWaiwt6BWU"\
                          --certs-tar            "~/capsule.example.com-certs.tar"\
                          --puppet               "true"\
                          --puppetca             "true"\
                          --pulp                 "true"
      
    2. 從 Satellite Server 上複製所產生的 tarball 壓縮檔(即 capsule.example.com-certs.tar)至 Satellite Capsule 主機系統上。
  2. 在 Satellite Capsule Server 上:
    1. 向 Satellite Server 註冊您的 Satellite Capsule Server:
      # rpm -Uvh http://sat6host.example.redhat.com/pub/katello-ca-consumer-latest.noarch.rpm
      # subscription-manager register --org "Default Organization" --env [environment]/[content_view_name]
      

      注意

      您必須指定一個組織至 Satellite Capsule Server,因為 Satellite Capsule Server 需要一組環境好從 Satellite Server 同步內容。只有組織才有環境。
      指定位置是選用選項,但建議您使用,以指出 Satellite Capsule Server 所管理的主機之大略位置。
    2. 根據所需的 Satellite Capsule Server 類型,請擇一使用以下選項:
      1. 選項一:Satellite Capsule Server 與 Smart Proxy:這會安裝 Satellite Capsule Server 與 Smart Proxy 功能(DHCP、DNS、Puppet)。請在 Satellite Capsule Server 上,以 root 身份執行以下指令:
          
        # capsule-installer --parent-fqdn          "satellite.example.com"\
                            --register-in-foreman  "true"\
                            --foreman-oauth-key    "xmmQCGYdkoCRcbviGfuPdX7ZiCsdExf
                            --foreman-oauth-secret "w5ZDpyPJ24eSBNo53AFybcnqoDYXgLUA"\
                            --pulp-oauth-secret    "doajBEXqNcANy93ZbciFyysWaiwt6BWU"\
                            --certs-tar            "/root/capsule.example.com-certs.tar"\
                            --puppet               "true"\
                            --puppetca             "true"\
                            --pulp                 "true"
                            --tftp                 "true"
                            --dhcp                 "true"\
                            --dhcp-interface       "virbr1
                           --dns                  "true"\
                           --dns-forwarders       "8.8.8.8"\
                           --dns-forwarders       "8.8.4.4"\
                           --dns-interface        "virbr1"\
                           --dns-zone             "example.com"
        
        
      2. 選項二:Satellite Capsule Server 作為內容節點、搭配 Smart Proxy:這會安裝 Satellite Capsule Server 的所有功能。請在 Satellite Capsule Server 上,以 root 身份執行以下指令:
        # capsule-installer --parent-fqdn          "sat6.example.com"\
                            --register-in-foreman  "true"\
                            --foreman-oauth-key    "xmmQCGYdkoCRcbviGfuPdX7ZiCsdExf
                            --foreman-oauth-secret "w5ZDpyPJ24eSBNo53AFybcnqoDYXgLUA"\
                            --pulp-oauth-secret    "doajBEXqNcANy93ZbciFyysWaiwt6BWU"\
                            --certs-tar            "/root/capsule.example.com-certs.tar"\
                            --puppet               "true"\
                            --puppetca             "true"\
                            --pulp                 "true"
                            --tftp                 "true"
                            --dhcp                 "true"\
                            --dhcp-interface       "virbr1
                           --dns                  "true"\
                           --dns-forwarders       "8.8.8.8"\
                           --dns-forwarders       "8.8.4.4"\
                           --dns-interface        "virbr1"\
                           --dns-zone             "example.com"
        
        
  3. 請執行下列指令配置防火牆,限制 elasticsearch 僅能供 foremankatello 和 root 使用者使用,並讓這些規則在系統重新啟動後依然有效:
    • Red Hat Enterprise Linux 6:
      iptables -A OUTPUT -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner foreman -j ACCEPT \
      && iptables -A OUTPUT -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner katello -j ACCEPT \
      && iptables -A OUTPUT -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner root -j ACCEPT \
      && iptables -A OUTPUT -o lo -p tcp -m tcp --dport 9200 -j DROP
      iptables-save > /etc/sysconfig/iptables
      
    • Red Hat Enterprise Linux 7:
      firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner foreman -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv6 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner foreman -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner katello -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv6 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner katello -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner root -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv6 filter OUTPUT 0 -o lo -p tcp -m tcp --dport 9200 -m owner --uid-owner root -j ACCEPT \
      && firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 1 -o lo -p tcp -m tcp --dport 9200 -j DROP \
      && firewall-cmd --permanent --direct --add-rule ipv6 filter OUTPUT 1 -o lo -p tcp -m tcp --dport 9200 -j DROP
      

注意

配置成功後,請以 root 使用者身份在 Satellite Capsule Server 上執行這項指令:
# echo $?
若執行成功,上述指令會傳回「0」。如果執行不成功,請檢查 /var/log/kafo 找出造成錯誤的原因。/var/log/kafocapsule-certs-generatecapsule-installer 指令產出的日誌檔。
同時,Satellite Capsule Server 應該會出現在 Satellite Server 的使用者介面中,位於「架構Capsule」之下。
結果:

Satellite Capsule Server 現在已配置完成,並向 Satellite Server 註冊。

〈22921%2C+User+Guide-6.008-10-2014+13%3A34%3A52Red+Hat+Satellite+6Docs+User+Guide回報錯誤