SLE HA 11 SP3 升级到 SLE HA 11 SP4

 

将群集升级为 SUSE® Linux Enterprise High Availability Extension 的另一个版本(主要版本或服务包)

 

1       基本说明

1.1   概念

概念

说明

主要版本 , 正式发布 (GA) 版本

SUSE Linux   Enterprise(或任何软件产品)的主要版本是一个新版本,其中会引入一些新功能和工具,去除之前弃用的组件,并进行一些不向后兼容的更改。

服务包 (SP)

将几个增补程序合并到便于安装或部署的一个组织体中。服务包是有编号的并通常包含安全性修复、更新、升级或程序增强。

更新

安装包的更新次要版本。

升级

安装包或分发包的更新主要版本,引入新功能。

 

重要:升级前必须满足的先决条件

确保系统备份为最新的且可恢复。

请先在群集设置的临时实例上测试升级过程,然后再在生产环境中执行该过程。

这样,您便可以估算出维护期所需的时间段。这还有助于检测和解决可能会出现的任何意外问题。

1.2   环境

#zypper pattern-info ha_sles   #检查现在系统上的HA版本

Name

Summary

Inst. Vers

cmirrord

Clustered RAID 1   support using device-mapper and openais

2.02.98

conntrack-tools

Userspace tools for interacting with the Connection   Tracking System

1.0.0

corosync

The Corosync   Cluster Engine and Application Programming Interfaces

1.4.5

crmsh

Pacemaker command line interface

1.2.5

csync2

Cluster   synchronization tool

1.34

ctdb

Clustered TDB

1.0.114.6

drbd

Distributed Replicated   Block Device

8.4.3

hawk

HA Web Konsole

0.6.1

ldirectord

The Heartbeat   Subsystem for High-Availability Linux

3.9.5

lvm2-clvm

Clustered LVM2

2.02.98

ocfs2-tools

Oracle Cluster   File System 2 Core Tools

1.8.2

openais

The OpenAIS Standards-Based Cluster   Framework executive and APIs

1.1.4

pacemaker

The Pacemaker   scalable High-Availability cluster resource manager

1.1.9

pacemaker-mgmt

Management Tools for Pacemaker based HA   solution

2.1.2

pacemaker-mgmt-client

Management Tools   for Pacemaker based HA solution

2.1.2

pssh

Parallel SSH to control large numbers of   Machines simultaneously

2.3.1

python-dateutil

A Python   Datetime Library

1.4.1

python-pssh

Python Module for Parallel SSH

2.3.1

release-notes-hae

Release Notes   for SELS High Availability Extension

11.3.13

resource-agents

The Heartbeat Subsystem for   High-Availability Linux

3.9.5

sle-hae-release

SUSE Linux   Enterprise High Availability Extension 11 SP3

11.3

sleha-bootstrap

SLE HA Bootstrap Tool

0.3

yast2-cluster

Configuration   tool for HA clusters

2.15.0

yast2-drbd

YaST2 - DRBD Configuration

2.13.1

yast2-iplb

Configuration   tool for IP Load Balance

2.15.0

 

2       升级过程

注意:在服务包版本之间滚动升级:为了成功地将现有群集从一个服务包版本迁移到下一个服务包版本,您可以执行“滚动升级”,即一个接一个地升级节点。

 

升级完一个节点后,使下一个节点处于脱机状态,并对此节点重复下面的升级过程。

 

重要:滚动升级的时间限制

只有在所有群集节点升级到最新产品版本后,才可使用 SUSE Linux Enterprise High Availability Extension 11 SP4 所具有的新功能。对于 SP3/SP4 并存的群集,其在滚动升级期间受支持的时间非常短暂。请在一周内完成滚动升级。

2.1   环境说明

ESXI主机


主机

IP

user

passwd

OS

A

hatst01


root


SLES 11 SP3

B

hatst01


root


SLES 11 SP3







 

使用命令记录当前系统版本

cat /etc/issue   #操作系统版本

zypper pt    #HA软件版本

2.2   停止OpenAIS/Corosync

警告:如果在软件更新期间,群集资源管理器所在节点处于活动状态,可能会导致不可预料的结果,例如活动的节点被屏蔽。

 

root 用户身份登录要更新的节点,然后停止 OpenAIS

rcopenais stop

2.3   系统备份

检查系统备份是否为最新并且可恢复。

创建已修改文件的备份。它们存储在 /var/adm/backup/ * 中,但其中很少只用作备份。

创建 /etc/sysconfig/ 的完整备份。这非常有用。它们保存在与上面相同的位置。

2.4   OS+HA升级

SUSE Linux Enterprise Server 11 SP3 升级到 SUSE Linux Enterprise Server 11 SP4,有二种升级方式:1、系统在线升级(没那么安全); 2、传统离线升级(更安全)

 

下面是在线升级步骤:

一、查看现在的软件源并删除不必要的软件源

zypper lr

zypper repos --uri

zypper ref

zypper removerepo 1

zypper removerepo 1

 

二、添加SUSE 11 SP4HA的软件源

把相关ISO文件上传到/tools 目录

zypper ar -c -t yast2 "iso:/?iso=/tools/SLES-11-SP4-DVD-x86_64-GM-DVD1.iso" "SLES-11-SP4"

zypper ar -c -t yast2 "iso:/?iso=/tools/SLE-HA-11-SP4-x86_64-GM-CD1.iso" "SLE-HA-11-SP4"

zypper ref

 

三、查看系统更新

zypper list-updates

zypper lu -t pattern

#查看系统上可用的HA升级

zypper lu | grep -E "Name|cmirrord | conntrack-tools | corosync | crmsh | csync2 | ctdb | drbd | hawk | ldirectord | lvm2-clvm | ocfs2-tools | openais | pacemaker | pacemaker-mgmt | pacemaker-mgmt-client | pssh | python-dateutil | python-pssh | release-notes-hae | resource-agents | sle-hae-release | sleha-bootstrap | yast2-cluster | yast2-drbd | yast2-iplb"

 


Name

Current Version

Available Version

Arch

1.            

cmirrord

2.02.98-0.9.57

2.02.98-0.11.1

x86_64

2.            

corosync

1.4.5-0.18.15

1.4.7-0.21.3

x86_64

3.            

crmsh

1.2.5-0.22.31

2.1.2+git49.g2e3fa0e-1.32

x86_64

4.            

csync2

1.34-0.8.1

1.34-0.11.47

x86_64

5.            

drbd

8.4.3-0.17.4

8.4.4-0.25.78

x86_64

6.            

hawk

0.6.1-0.17.1

0.7.0+git.1430140184.8e872c5-3.18

x86_64

7.            

ldirectord

3.9.5-0.28.7

3.9.5-40.32

x86_64

8.            

lvm2-clvm

2.02.98-0.25.4

2.02.98-0.33.1

x86_64

9.            

ocfs2-tools

1.8.2-0.15.5

1.8.2-0.19.1

x86_64

10.        

openais

1.1.4-5.13.6

1.1.4-5.24.5

x86_64

11.        

pacemaker

1.1.9-0.19.102

1.1.12-11.12

x86_64

12.        

pacemaker-mgmt

2.1.2-0.7.40

2.1.2-20.16

x86_64

13.        

pacemaker-mgmt-client

2.1.2-0.7.40

2.1.2-20.16

x86_64

14.        

pssh

2.3.1-0.7.26

2.3.1-12.33

x86_64

15.        

python-pssh

2.3.1-0.7.26

2.3.1-12.33

x86_64

16.        

release-notes-hae

11.3.13-0.7.2

11.4.6-0.10.14

x86_64

17.        

resource-agents

3.9.5-0.28.7

3.9.5-40.32

x86_64

18.        

sle-hae-release

11.3-1.69

11.4-1.54

x86_64

19.        

sleha-bootstrap

0.3-0.24.12

0.3-0.33.18

noarch

20.        

yast2-cluster

2.15.0-8.46.1

2.15.0-8.49.78

noarch

21.        

yast2-drbd

2.13.1-217.39.19

2.13.1-217.43.31

noarch

 

四、系统升级

在继续之前,请确保这些存储库兼容,确保系统所有业务系统及应用都正常关闭

zypper dist-upgrade --dry-run --auto-agree-with-licenses  #升级前先使用此命令测试,会列出多少个包551 包升级,21 降级,13 新增,1 删除,手动依赖。

image.png

zypper dist-upgrade        #升级

zypper dist-upgrade --repo   #指定源,如果没有则中止

zypper dup --from factory --from packman #指定源,如果没有则遍历所有的repo

 

#以下是模式的升级命令:

#zypper pt

#zypper pattern-info ha_sles

#zypper up -t pattern ha_sles

 

2.5   升级 CIB 语法版本

标记(用于对资源分组)和某些 ACL 功能仅适用于 pacemaker-2.0 或更高的 CIB 语法版本。(要检查版本,请运行 cibadmin -Q |grep validate-with)。如果您已从 SUSE Linux Enterprise High Availability Extension 11 SP3 升级,则 CIB 版本默认不会升级。要手动升级到最新的 CIB版本,请使用以下命令之一:

root # cibadmin --upgrade --force

或者

root # crm configure upgrade force

2.6   重启OpenAIS/Corosync

升级后,建议重启以启动新内核和更新版本的所有内容。

在升级后的节点上重启动 OpenAIS/Corosync,使此节点重新加入群集:

rcopenais start

2.7   版本验证

操作系统版本

image.png

双机软件版本

image.png

3       附录

3.1   zypper命令

Zypper / 用法

< Zypper

 

       zypper [-- ] < > [-- ] [ ]

 

       --help, -h              .

       --version, -V          

       --quiet, -q            

       --verbose, -v          

       --no-abbrev, -A        

       --table-style, -s       ( )

       --rug-compatible, -r    rug

       --non-interactive, -n   使

       --xmlout, -x            XML

       --reposd-dir, -D <dir> 使

       --cache-dir, -C <dir>   使

       --raw-cache-dir <dir>   使

       Repository Options:

       --no-gpg-checks         GPG

       --plus-repo, -p <URI>   使

       --disable-repositories

       --no-refresh           

 

       --root, -R <dir>       

       --disable-system-sources -D           

 

       help, ?                

       shell, sh               .

      

       repos, lr              

       addrepo, ar             。具体请看:http://hi.baidu.com/tunaisen/blog/item/4b2af73937ac7ff53b87cec8.html

       removerepo, rr         

       renamerepo, nr         

       modifyrepo, mr         

       refresh, ref           

       clean                  

       install, in            

       remove, rm             

       verify, ve             

       update, up             

       dist-upgrade, dup      

       source-install, si     

       search, se             

       info, if               

       patch-info             

       pattern-info           

       product-info           

       patch-check, pchk      

       list-updates, lu       

       patches, pch           

       packages, pa           

       patterns, pt           

       products, pd           

       what-provides, wp      

      

       addlock, al             

       removelock, rl         

       locks, ll              

3.2   CRM命令

pacemaker 是高可用集群中的 CRMCluster Resource Manager)资源管理层,他是一个服务,可以作为一个单独的服务启动,不过在如果使用 corosync1.4 中,我们可以设置 corosync 来启动 pacemakerpacemaker 的配置接口可以在任意节点上安装 crmsh 或者 pcs 还有一些 GUI 界面的软件来完成。crmsh Redhat6.4 默认使用的 pcsOpenSUSE 中使用crm

3.2.1  一级子命令

[root@node-1 corosync]# crm 

crm(live)# help 

This is crm shell, a Pacemaker command line interface. 

Available commands: 

    cib              manage shadow CIBs //cib沙盒 

    resource         resources management //所有的资源都在这个子命令后定义 

    configure        CRM cluster configuration //编辑集群配置信息 

    node             nodes management //集群节点管理子命令 

    options          user preferences //用户优先级 

    history          CRM cluster history //命令历史记录 

    site             Geo-cluster support 

    ra               resource agents information center //资源代理子命令(所有与资源代理相关的程都在此命令之下) 

    status           show cluster status //显示当前集群的状态信息 

    help,?           show help (help topics for list of topics)//查看当前区域可能的命令 

    end,cd,up        go back one level //返回第一级crm(live) 

    quit,bye,exit    exit the program //退出crmlive)交互模式

3.2.2  resource 资源状态控制子命令

crm(live)resource# help 

vailable commands: 

        status           show status of resources //显示资源状态信息 

        start            start a resource //启动一个资源 

        stop             stop a resource //停止一个资源 

        restart          restart a resource //重启一个资源 

        promote          promote a master-slave resource //提升一个主从资源 

        demote           demote a master-slave resource //降级一个主从资源 

        manage           put a resource into managed mode  //将一个资源加入到管理模式下 

        unmanage         put a resource into unmanaged mode  //从管理模式下去除一个资源 

        migrate          migrate a resource to another node //将资源迁移到另一个节点上 

        unmigrate        unmigrate a resource to another node 

        param            manage a parameter of a resource //管理资源的参数 

        secret           manage sensitive parameters //管理敏感参数 

        meta             manage a meta attribute //管理源属性 

        utilization      manage a utilization attribute 

        failcount        manage failcounts //管理失效计数器 

        cleanup          cleanup resource status //清理资源状态 

        refresh          refresh CIB from the LRM status //LRMLRM本地资源管理)更新CIB(集群信息库),在 

        reprobe          probe for resources not started by the CRM //探测在CRM中没有启动的资源 

        trace            start RA tracing //启用资源代理(RA)追踪 

        untrace          stop RA tracing //禁用资源代理(RA)追踪 

        help             show help (help topics for list of topics) //显示帮助 

        end              go back one level //返回一级(crm(live)# 

        quit             exit the program //退出交互式程序 

3.2.3  configure 资源定义子命令

crm(live)configure# help 

Available commands: 

        node             define a cluster node //定义一个集群节点 

        primitive        define a resource //定义资源 

        monitor          add monitor operation to a primitive //对一个资源添加监控选项(如超时时间,启动失败后的操作) 

        group            define a group //定义一个组类型(将多个资源整合在一起) 

        clone            define a clone //定义一个克隆类型(可以设置总的克隆数,每一个节点上可以运行几个克隆) 

        ms               define a master-slave resource //定义一个主从类型(集群内的节点只能有一个运行主资源,其它从的做备用) 

        rsc_template     define a resource template //定义一个资源模板 

        location         a location preference //定义位置约束优先级(默认运行于那一个节点(如果位置约束的值相同,默认倾向性那一个高,就在那一个节点上运行)) 

        colocation       colocate resources //排列约束资源(多个资源在一起的可能性) 

        order            order resources //资源的启动的先后顺序 

        rsc_ticket       resources ticket dependency 

        property         set a cluster property //设置集群属性 

        rsc_defaults     set resource defaults //设置资源默认属性(粘性) 

        fencing_topology node fencing order //隔离节点顺序 

        role             define role access rights //定义角色的访问权限 

        user             define user access rights //定义用用户访问权限 

        op_defaults      set resource operations defaults //设置资源默认选项 

        schema           set or display current CIB RNG schema 

        show             display CIB objects //显示集群信息库对 

        edit             edit CIB objects //编辑集群信息库对象(vim模式下编辑) 

        filter           filter CIB objects //过滤CIB对象 

        delete           delete CIB objects //删除CIB对象 

        default-timeouts set timeouts for operations to minimums from the meta-data 

        rename           rename a CIB object //重命名CIB对象 

        modgroup         modify group //改变资源组 

        refresh          refresh from CIB //重新读取CIB信息 

        erase            erase the CIB //清除CIB信息 

        ptest            show cluster actions if changes were committed 

        rsctest          test resources as currently configured 

        cib              CIB shadow management 

        cibstatus        CIB status management and editing    //cib状态管理和编辑 

        template         edit and import a configuration from a template   //编辑或导入配置模板 

        commit           commit the changes to the CIB //将更改后的信息提交写入CIB 

        verify           verify the CIB with crm_verify //CIB语法验证 

        upgrade          upgrade the CIB to version 1.0 //升级CIB1.0 

        save             save the CIB to a file //将当前CIB导出到一个文件中(导出的文件存于切换crm 之前的目录) 

        load             import the CIB from a file //从文件内容载入CIB 

        graph            generate a directed graph 

        xml              raw xml 

        help             show help (help topics for list of topics) //显示帮助信息 

        end              go back one level //回到第一级(crm(live)#) 

        quit             exit the program  //退出crm交互模式 

3.2.4  node 节点管理子命令

crm(live)# node 

crm(live)node# help 

Node management and status commands. 

Available commands: 

    status           show nodes status as XML //xml格式显示节点状态信息 

    show             show node //命令行格式显示节点状态信息 

    standby          put node into standby //模拟指定节点离线(standby在后面必须的FQDN 

    online           set node online // 节点重新上线 

    maintenance      put node into maintenance mode  //将一个节点状态改为maintenance 

    ready            put node into ready mode   //将一个节点状态改为ready 

    fence            fence node //隔离节点 

    clearstate       Clear node state //清理节点状态信息 

    delete           delete node //删除 一个节点 

    attribute        manage attributes 

    utilization      manage utilization attributes 

    status-attr      manage status attributes 

    help             show help (help topics for list of topics) 

    end              go back one level  //回到上一次 

    quit             exit the program    //退出

3.2.5  ra 资源代理子命令

crm(live)# ra 

crm(live)ra# help 

Available commands: 

        classes          list classes and providers //为资源代理分类 

        list             list RA for a class (and provider)//显示一个类别中的提供的资源 

        meta             show meta data for a RA //显示一个资源代理序的可用参数(如meta ocf:heartbeat:IPaddr2 

        providers        show providers for a RA and a class 

        help             show help (help topics for list of topics) 

        end              go back one level 

        quit             exit the program

3.3   参考文章

SDB:System_upgrade https://en.opensuse.org/SDB:System_upgrade

SDB:Offline_upgrade  https://en.opensuse.org/SDB:Offline_upgrade

《将 SLE 11 SP3 升级到 SLE 11 SP4https://blog.51cto.com/4507878/2174152