创建集群对等关系

您可以使用 cluster peer create 命令在本地和远程集群之间创建对等关系。创建对等关系后,您可以在远程集群上运行 cluster peer create,以便向本地集群验证其身份。

开始之前

关于本任务

步骤

  1. 在目标集群上、创建与源集群的对等关系: cluster peer create -generate-passphrase -offer-expiration MM/DD/YYYY HH:MM:SS|1...7days|1...168hours -peer-addrs peer_LIF_IPs -ipspace ipspace
    如果同时指定 -generate-passphrase-peer-addrs,则只有已在 -peer-addrs 中指定集群间 LIF 的集群才能使用生成的密码。

    如果未使用自定义 IP 空间,则可以忽略 -ipspace 选项。有关完整的命令语法,请参见手册页。

    示例

    以下示例将在未指定的远程集群上创建集群对等关系:

    cluster02::> cluster peer create -generate-passphrase -offer-expiration 2days
    
                         Passphrase: UCa+6lRVICXeL/gq1WrK7ShR
                    Expiration Time: 6/7/2017 08:16:10 EST
      Initial Allowed Vserver Peers: -
                Intercluster LIF IP: 192.140.112.101
                  Peer Cluster Name: Clus_7ShR (temporary generated)
    
    Warning: make a note of the passphrase - it cannot be displayed again.
  2. 在数据保护源集群上,使源集群向目标集群进行身份验证:cluster peer create -peer-addrs peer_LIF_IPs -ipspace ipspace
    有关完整的命令语法,请参见手册页。
    示例
    以下示例会使本地集群向集群间 LIF IP 地址为 192.140.112.101 和 192.140.112.102 的远程集群进行身份验证:
    cluster01::> cluster peer create -peer-addrs 192.140.112.101,192.140.112.102
    
    Notice: Use a generated passphrase or choose a passphrase of 8 or more characters.
            To ensure the authenticity of the peering relationship, use a phrase or sequence of characters that would be hard to guess.
    
    Enter the passphrase: 
    Confirm the passphrase: 
    
    Clusters cluster02 and cluster01 are peered.
    出现提示时,请输入此对等关系的密码短语。
  3. 验证是否已创建此集群对等关系:cluster peer show -instance
    示例
    cluster01::> cluster peer show -instance
    
                                   Peer Cluster Name: cluster02
                       Remote Intercluster Addresses: 192.140.112.101, 192.140.112.102
                  Availability of the Remote Cluster: Available
                                 Remote Cluster Name: cluster2
                                 Active IP Addresses: 192.140.112.101, 192.140.112.102
                               Cluster Serial Number: 1-80-123456
                      Address Family of Relationship: ipv4
                Authentication Status Administrative: no-authentication
                   Authentication Status Operational: absent
                                    Last Update Time: 02/05 21:05:41
                        IPspace for the Relationship: Default
  4. 检查此对等关系中节点的连接和状态:cluster peer health show
    示例
    cluster01::> cluster peer health show
    Node       cluster-Name                Node-Name
                 Ping-Status               RDB-Health Cluster-Health  Avail…
    ---------- --------------------------- ---------  --------------- --------
    cluster01-01
               cluster02                   cluster02-01
                 Data: interface_reachable
                 ICMP: interface_reachable true       true            true
                                           cluster02-02
                 Data: interface_reachable
                 ICMP: interface_reachable true       true            true
    cluster01-02
               cluster02                   cluster02-01
                 Data: interface_reachable
                 ICMP: interface_reachable true       true            true
                                           cluster02-02
                 Data: interface_reachable
                 ICMP: interface_reachable true       true            true