使用Ksplice

<p><span style="font-size:16px"><strong>前提条件</strong></span></p> <p>您已创建并安装平安热补丁。</p> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>升级到最新内核版本</strong></span></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp; 执行如下命令,升级内核版本:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice kernel upgrade</td> </tr> </tbody> </table> <p><img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20192507154108-17e3d05a9248.png" style="height:287px; width:830px" /></p> <p>2.&nbsp; 升级完成之后会有提示当前实际生效的内核版本。</p> <p><img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20192507154130-1c76dc229069.png" style="height:107px; width:830px" /></p> <p>3.&nbsp; 执行如下命令,查看经过Ksplice升级之后实际生效的内核版本:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"> <p># ksplice kernel uname -r</p> <p>3.10.0-957.el7.x86_64</p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>用户空间核心组件的在线升级</strong></span></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp; 执行如下命令,升级glibc、openssl包,升级完成之后会提示将对以下进程和服务进行适配:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice -y user upgrade</td> </tr> </tbody> </table> <p><img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20192507154154-14c6b02f91e8.png" style="height:524px; width:816px" /></p> <p>2.&nbsp; 操作完成之后,执行如下命令查看已经适配的进程和服务:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice user show</td> </tr> </tbody> </table> <p><img src="https://pcp-portal-sca.obs-cn-shenzhen.pinganyun.com/pcp-portal-sca/20192507154217-1d75bab5921f.png" style="height:533px; width:693px" /></p> <p><strong>说明:</strong></p> <p>用户空间核心组件相关升级包的更新频率低于内核安全补丁更新频率,一旦系统通过yum update的方式安装了更新版本的glibc或openssl,Ksplice会自动同步,确保ksplice aware library和文件系统上的glibc以及openssl保持一致。另外在系统重启后,由于进程在重启过程中适配了新版本的glibc和openssl,所以使用ksplice命令就不会再看到用户空间热升级的适配情况。</p> <p>3.&nbsp; 使用Ksplice增强客户端最常用的功能是升级用户空间核心组件,可执行如下命令:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice user upgrade</td> </tr> </tbody> </table> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>用户空间核心组件的在线回退</strong></span></p> <p><span style="font-size:16px"><strong>操作步骤</strong></span></p> <p>1.&nbsp; 执行如下命令,删除所有用户空间核心组件的适配:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice user remove --all</td> </tr> </tbody> </table> <p>2.&nbsp; 执行如下命令,降级所有的ksplice aware library包:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># yum downgrade glibc{,-devel,-headers,-common} openssl{,-devel}</td> </tr> </tbody> </table> <p>&nbsp;</p> <p><span style="font-size:16px"><strong>更多操作命令</strong></span></p> <p>1.&nbsp; 查看所有热升级安装的内核热补丁以及更新glibc和openssl后用户空间的适配情况:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice all show</td> </tr> </tbody> </table> <p>2.&nbsp; 查看更新glibc和openssl后用户空间的适配情况:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice user show</td> </tr> </tbody> </table> <p>3.&nbsp; 查看热升级安装的内核热补丁情况:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice kernel show</td> </tr> </tbody> </table> <p>4.&nbsp; 查看当前生效的内核版本号:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice kernel uname -r</td> </tr> </tbody> </table> <p>5.&nbsp; 查看某一个进程(PID)适配用户空间升级的情况:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice user show --pid=&lt;PID&gt;</td> </tr> </tbody> </table> <p>6.&nbsp; 当uptrack-updates中的部分补丁模块删除之后重新查看并安装:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplice kernel upgrade</td> </tr> </tbody> </table> <p>7.&nbsp; 删除所有的用户空间热升级补丁:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"># ksplie user remove --all</td> </tr> </tbody> </table> <p>8.&nbsp; 如果需要干预/无干预执行,通常加&ldquo;-y&rdquo;或者&ldquo;-n&rdquo;选项,例如:</p> <table border="1" cellpadding="1" cellspacing="1" style="width:719px"> <tbody> <tr> <td style="background-color:#ededed; width:713px"> <p># ksplice -y|-n kernel upgrade</p> <p># ksplice -y|-n user upgrade</p> </td> </tr> </tbody> </table>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

工单支持

解决云产品相关技术问题