4.4. Configuring the Samba Cluster Resources


This section provides the procedure for configuring the Samba cluster resources for this use case.
The following procedure creates a snapshot of the cluster's cib file named samba.cib and adds the resources to that test file rather then configuring them directly on the running cluster. After the resources and constraints are configured, the procedure pushes the contents of samba.cib to the running cluster configuration file.
On one node of the cluster, run the following procedure.
  1. Create a snapshot of the cib file, which is the cluster configuration file.
    [root@z1 ~]# pcs cluster cib samba.cib
  2. Create the CTDB resource to be used by Samba. Create this resource as a cloned resource so that it will run on both cluster nodes.
    [root@z1 ~]# pcs -f samba.cib resource create ctdb ocf:heartbeat:CTDB \
    ctdb_recovery_lock="/mnt/gfs2share/ctdb/ctdb.lock" \
    ctdb_dbdir=/var/ctdb ctdb_socket=/tmp/ctdb.socket \
    ctdb_logfile=/var/log/ctdb.log \
    op monitor interval=10 timeout=30 op start timeout=90 \
    op stop timeout=100 --clone
  3. Create the cloned Samba server.
    [root@z1 ~]# pcs -f samba.cib resource create samba systemd:smb --clone
  4. Create the colocation and order constraints for the cluster resources. The startup order is Filesystem resource, CTDB resource, then Samba resource.
    [root@z1 ~]# pcs -f samba.cib constraint order fs-clone then ctdb-clone
    Adding fs-clone ctdb-clone (kind: Mandatory) (Options: first-action=start then-action=start)
    [root@z1 ~]# pcs -f samba.cib constraint order ctdb-clone then samba-clone
    Adding ctdb-clone samba-clone (kind: Mandatory) (Options: first-action=start then-action=start)
    [root@z1 ~]# pcs -f samba.cib constraint colocation add ctdb-clone with fs-clone
    [root@z1 ~]# pcs -f samba.cib constraint colocation add samba-clone with ctdb-clone
  5. Push the content of the cib snapshot to the cluster.
    [root@z1 ~]# pcs cluster cib-push samba.cib
    CIB updated
    
  6. Check the status of the cluster to verify that the resource is running.
    Note that in Red Hat Enterprise Linux 7.4 it can take a couple of minutes for CTDB to start Samba, export the shares, and stabilize. If you check the cluster status before this process has completed, you may see a message that the CTDB status call failed. Once this process has completed, you can clear this message from the display by running the pcs resource cleanup ctdb-clone command.
    [root@z1 ~]# pcs status
    Cluster name: my_cluster
    Stack: corosync
    Current DC: z1.example.com (version 1.1.16-12.el7_4.2-94ff4df) - partition with quorum
    Last updated: Thu Oct 19 18:17:07 2017
    Last change: Thu Oct 19 18:16:50 2017 by hacluster via crmd on z1.example.com
    
    2 nodes configured
    11 resources configured
    
    Online: [ z1.example.com z2.example.com ]
    
    Full list of resources:
    
     myapc  (stonith:fence_apc_snmp):       Started z1.example.com
     Clone Set: dlm-clone [dlm]
         Started: [ z1.example.com z2.example.com ]
     Clone Set: clvmd-clone [clvmd]
         Started: [ z1.example.com z2.example.com ]
     Clone Set: fs-clone [fs]
         Started: [ z1.example.com z2.example.com ]
     Clone Set: ctdb-clone [ctdb]
         Started: [ z1.example.com z2.example.com ]
     Clone Set: samba-clone [samba]
         Started: [ z1.example.com z2.example.com ]
    

    Note

    If you find that the resources you configured are not running, you can run the pcs resource debug-start resource command to test the resource configuration. This starts the service outside of the cluster’s control and knowledge. If the configured resources are running again, run pcs resource cleanup resource to make the cluster aware of the updates. For information on the pcs resource debug-start command, see the Enabling, Disabling, and Banning Cluster Resources section in the High Availability Add-On Reference manual.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.