<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## [ 感謝《原來是趙先生呀》的分享,源地址請點擊連接](https://blog.csdn.net/qq_39599464/article/details/115329915) 一、建立群集: ``` 配置群集節點的認證as the hacluster user: pcs cluster auth node1 node2 創建一個兩個節點的群集(node1 node2) pcs cluster setup --name mycluster node1 node2 啟動群集 pcs cluster start --all 設置資源默認粘性(防止資源回切) pcs resource defaults resource-stickiness=100 pcs resource defaults 設置資源超時時間 pcs resource op defaults timeout=90s pcs resource op defaults 兩個節點時,忽略節點quorum功能 pcs property set no-quorum-policy=ignore 沒有 Fencing設備時,禁用STONITH 組件功能,在 stonith-enabled="false" 的情況下,分布式鎖管理器 (DLM) 等資源以及依賴DLM 的所有服務(例如 cLVM2、GFS2 和 OCFS2)都將無法啟動。 pcs property set stonith-enabled=false 驗證群集配置信息 crm_verify -L -V ``` 二、建立群集資源 ``` 查看支持資源列表 pcs resource list ocf:heartbeat pcs resource list 查看資源使用參數 pcs resource describe ocf:heartbeat:IPaddr2 pcs resource describe agent_name 配置虛擬IP pcs resource create ClusterIP ocf:heartbeat:IPaddr2 \ ip="192.168.10.15" cidr_netmask=32 nic=eth0 op monitor interval=30s 配置Apache(httpd) pcs resource create WebServer ocf:heartbeat:apache \ httpd="/usr/sbin/httpd" configfile="/etc/http /conf/httpd.conf" \ statusurl="" op monitor interval=1min 配置Nginx pcs resource create WebServer ocf:heartbeat:nginx \ httpd="/usr/sbin/nginx" configfile="/etc/nginx/nginx.conf" \ statusurl="" op monitor interval=30s 配置FileSystem pcs resource create WebFS ocf:heartbeat:Filesystem \ device="/dev/sdb1" directory="/var/www/html" fstype="ext4" pcs resource create WebFS ocf:heartbeat:Filesystem \ device="-U 32937d65eb" directory="/var/www/html" fstype="ext4" 配置FileSystem-NFS pcs resource create WebFS ocf:heartbeat:Filesystem \ device="192.168.10.18:/mysqldata" directory="/var/lib/mysql" fstype="nfs" \ options="-o username=your_name,password=your_password" \ op start timeout=60s op stop timeout=60s op monitor interval=20s timeout=60s 配置Iscsi pcs resource create WebData ocf:heartbeat:iscsi \ portal="192.168.10.18" target="iqn.2008-08.com.starwindsoftware:" \ op monitor depth="0" timeout="30" interval="120" pcs resource create WebFS ocf:heartbeat:Filesystem \ device="-U 32937d65eb" directory="/var/www/html" fstype="ext4" options="_netdev" 配置DRBD pcs resource create WebData ocf:linbit:drbd \ drbd_resource=wwwdata op monitor interval=60s pcs resource master WebDataClone WebData \ master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true pcs resource create WebFS ocf:heartbeat:Filesystem \ device="/dev/drbd1" directory="/var/www/html" fstype="ext4" 配置MySQL pcs resource create MySQL ocf:heartbeat:mysql \ binary="/usr/bin/mysqld_safe" config="/etc/my.cnf" datadir="/var/lib/mysql" \ pid="/var/run/mysqld/mysql.pid" socket="/tmp/mysql.sock" \ op start timeout=180s op stop timeout=180s op monitor interval=20s timeout=60s 配置Pingd,檢測節點與目標的連接有效性 pcs resource create PingCheck ocf:heartbeat:pingd \ dampen=5s multiplier=100 host_list="192.168.10.1 router" \ op monitor interval=30s timeout=10s 創建資源clone,克隆的資源會在全部節點啟動 pcs resource clone PingCheck clone-max=2,數據包分成2路 pcs resource clone ClusterIP clone-max=2 clone-node-max=2 globally-unique=true 指定響應請求的分配策略為:sourceip pcs resource update ClusterIP clusterip_hash=sourceip ``` 三、調整群集資源 ``` 配置資源約束 配置資源組,組中資源會在同一節點運行 pcs resource group add WebSrvs ClusterIP 移除組中的指定資源 pcs resource group remove WebSrvs ClusterIP 配置具有多個狀態的資源,如 DRBD master/slave狀態 pcs resource master WebDataClone WebData 配置資源捆綁關系 pcs constraint colocation add WebServer ClusterIP INFINITY 移除資源捆綁關系約束中資源 pcs constraint colocation remove WebServer 配置資源啟動順序 pcs constraint order ClusterIP then WebServer 移除資源啟動順序約束中資源 pcs constraint order remove ClusterIP 查看資源約束關系, pcs constraint --full pcs constraint 配置資源位置 指定資源默認某個節點,node=50 指定增加的 score pcs constraint location WebServer prefers node11 指定資源避開某個節點,node=50 指定減少的 score pcs constraint location WebServer avoids node11 移除資源節點位置約束中資源ID,可用pcs config獲取 pcs constraint location remove location-WebServer 手工移動資源節點,指定節點資源的 score of INFINITY pcs constraint location WebServer prefers node11=INFINITY 驗證節點資源 score 值 crm_simulate -sL 修改資源配置 更新資源配置 pcs resource update WebFS 刪除指定資源 pcs resource delete WebFS 管理群集資源 禁用資源 pcs resource disable ClusterIP 啟用資源 pcs resource enable ClusterIP 顯示指定資源的錯誤計數 pcs resource failcount show ClusterIP 清除指定資源的錯誤計數 pcs resource failcount reset ClusterIP 清除指定資源的狀態與錯誤計數 pcs resource cleanup ClusterIP ``` 四、群集操作命令 ``` 驗證群集安裝 查看pacemaker組件,ps axf | grep pacemaker pacemakerd -F 查看corosync序號 corosync-cfgtool -s corosync 2.3.x corosync-cmapctl | grep members corosync 1.4.x corosync-objctl | grep members 查看群集資源 查看支持資源類型 pcs resource standards 查看資源提供商 pcs resource providers 查看所有資源代理 pcs resource agents 查看支持資源列表 pcs resource list 查看支持Fence列表 pcs stonith list 顯示群集默認變量參數 pcs property list --all 檢驗資源 score 值 crm_simulate -sL 使用群集腳本 將群集資源配置信息保存在指定文件 pcs cluster cib ra_cfg 創建群集資源并保存在指定文件中(而非保存在運行配置) pcs -f ra_cfg resource create 顯示指定文件的配置信息,檢查無誤后 pcs -f ra_cfg resource show 將指定配置文件加載到運行配置中 pcs cluster cib-push ra_cfg STONITH 設備操作 查詢fence設備 stonith_admin -I 查詢fence設備的元數據,stonith_admin -M -a fence_vmware_soap stonith_admin -M -a agent_name 測試 STONITH 設備 stonith_admin --reboot nodename 管理群集 查看群集狀態 pcs status pcs status cluster pcs status corosync 停止群集 pcs cluster stop [node11] 啟動群集 pcs cluster start --all 將節點置為后備standby狀態,pcs cluster unstandby node11 pcs cluster standby node11 刪除群集,[–all]同時恢復corosync.conf文件 pcs cluster destroy [--all] 清除指定資源的狀態與錯誤計數 pcs resource cleanup ClusterIP 清除Fence資源的狀態與錯誤計數 pcs stonith cleanup vmware-fencing 查看群集配置 crm_verify -L -V ##檢查配置有無錯誤 pcs property ##查看群集屬性 pcs stonith ##查看stonith pcs constraint ##查看資源約束 pcs config ##查看群集資源配置 pcs cluster cib ##以XML格式顯示群集配置 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看