使用Ksplice
<p><span style="font-size:16px"><strong>前提条件</strong></span></p>
<p>您已创建并安装平安热补丁。</p>
<p> </p>
<p><span style="font-size:16px"><strong>升级到最新内核版本</strong></span></p>
<p><span style="font-size:16px"><strong>操作步骤</strong></span></p>
<p>1. 执行如下命令,升级内核版本:</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. 升级完成之后会有提示当前实际生效的内核版本。</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. 执行如下命令,查看经过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> </p>
<p><span style="font-size:16px"><strong>用户空间核心组件的在线升级</strong></span></p>
<p><span style="font-size:16px"><strong>操作步骤</strong></span></p>
<p>1. 执行如下命令,升级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. 操作完成之后,执行如下命令查看已经适配的进程和服务:</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. 使用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> </p>
<p><span style="font-size:16px"><strong>用户空间核心组件的在线回退</strong></span></p>
<p><span style="font-size:16px"><strong>操作步骤</strong></span></p>
<p>1. 执行如下命令,删除所有用户空间核心组件的适配:</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. 执行如下命令,降级所有的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> </p>
<p><span style="font-size:16px"><strong>更多操作命令</strong></span></p>
<p>1. 查看所有热升级安装的内核热补丁以及更新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. 查看更新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. 查看热升级安装的内核热补丁情况:</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. 查看当前生效的内核版本号:</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. 查看某一个进程(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=<PID></td>
</tr>
</tbody>
</table>
<p>6. 当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. 删除所有的用户空间热升级补丁:</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. 如果需要干预/无干预执行,通常加“-y”或者“-n”选项,例如:</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>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!