⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 777.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
在nfs上装载到/jack,并允许读写。<br><br>
# File /etc/exports on NFS Server<br>
# When backing up an entire system, including root files (UID 0)<br>
# you would use the no_root_squash option as outlined below *<br>
# For files belonging to jack, the only option required is 'rw'<br><br>
/jack jack.foo.com(rw,no_root_squash)<br><br>
  UID/GID设置可能会令人混淆,特别在nfs服务器和主机是不同unix变种,或者使用不
同的密码机制的情况下。所有者和组权限依赖于UID/GID,在client和server段必须一致。
如果用户jack在客户机jack上的UID是2020,他必须在nfs服务器上的UID也是2020。<br>
  如果nfs服务器上已经有用户使用UID2020,假设叫sam,则从客户机的UID2020在服务
器上显示为sam。当UID 2020还未使用时,文件将简单标记为UID 2020所有, 而没有用户
标识。(我们经常碰到这种情况,当解压ftp下来的文件时,原文件用户joe的UID 1010在
我们的系统上属于另一个用户,结果解压出来的文件就归另一用户所有了。)<br><br>
  当恢复数据的时候,基于同样的原因,必须确认目标主机的UID/GID匹配。exports的
帮助手册说:<br>
  通常,不希望客户机上的root用户在nfs服务器上也有root权限。为此,uid 0通常映
射为另一个id:所谓的匿名或者nobody。这叫做root squashing,是默认配置,可使用
no_root_squash关闭。小心使用此选项。<br>
  注意要备份密码和组文件。每当在客户机上加减用户,记得要更新备份。<br><br>
  两个简单的nfs服务器脚本<br>
  本例中,我们启动rpc.portmap, rpc.mountd和rcp.nfsd, 并将每个进程的进程id写
入nfs.pid<br><br>
#!/bin/bash<br>
# Script to start NFS<br>
/usr/sbin/rpc.portmap<br>
sleep 1<br><br>
/usr/sbin/rpc.mountd<br>
sleep 1<br><br>
/usr/sbin/rpc.nfsd<br>
/sbin/pidof /usr/sbin/rpc.portmap &gt; /var/run/nfs.pid<br>
/sbin/pidof /usr/sbin/rpc.nfsd &gt;&gt; /var/run/nfs.pid<br>
/sbin/pidof /usr/sbin/rpc.mountd &gt;&gt; /var/run/nfs.pid<br>
echo "NFS READY"<br>
# EOF<br><br>
我们使用下面的脚本杀掉nfs.pid中的所有进程,从而停止nfs。<br><br>
#!/bin/bash<br>
# Script to stop NFS<br>
kill `cat /var/run/nfs.pid`<br>
/bin/rm /var/run/nfs.pid<br>
echo "NFS HALTED"<br><br>
同步备份<br>
  通过在所有主机和nfs服务器上设置cron任务来在特定时间启动、停止和使用nfs,我
们可以实现同步备份。在备份后,所有主机停止nfs服务。为了精确同步, 所有主机应当
使用中心ntp时间服务调整时间。<br>
  nfs服务器通过与上面相似的脚本在cron中启动, 并依据完全备份所需要的时间来确
定激活的时间段。对较大的备份来说,30分钟是一个不错的选择。之后,所有客户端装载
到服务器上,写入它们的文件,然后卸载。本例中使用tar。其他方法包括使用dump等命令。<br><br>
#!/bin/sh<br>
# File NFSBackup Script for jack.foo.com<br>
echo 'Initialize NFS Backup'<br>
mount nfs.foo.com:/jack /mnt/jack<br>
df<br><br>
echo "Is nfs.foo.com mounted?"<br>
read ans;<br><br>
echo "Full Backup of Jack to follow"<br>
sleep 4<br><br>
cd /mnt/jack<br>
tar -cvvf jack.tar /vmlinuz /System.map /root /mydocs /etc<br>
/bin /sbin /var/local /var/spool /usr/sbin /usr/bin home<br>
/usr/home/glenn /usr/home/ifconfig<br>
sleep 5<br><br>
umount /mnt/jack<br>
echo "finished"<br><br>
  恢复文件<br>
  几乎所有实际应用中,都使用手工恢复。直到今天,完全恢复还是令人混淆,特别是
当目标主机有多种用途。典型情况下,我们将主机装载到nfs服务器, 从远端文件系统读
取备份来完成恢复工作。<br><br>
  使用mount命令将jack.foo.com装载到nfs.foo.com上:<br>
mount nfs.foo.com:/jack /mnt/jack;<br>
然后改变路径到 /mnt/jack<br>
只需简单的从nfs.foo.com上untar jack.tar即可进行恢复。<br>
tar -xvf jack.tar<br>
然后将需要的文件从/mnt/jack拷贝到适当的位置。<br>
以上仅仅是众多可用方法中的一种。<br><br>
概述<br>
下面是需要遵循的基本规则:<br><br>
* 在完全重新安装系统的情况下,确认新安装的操作系统版本和原系统相同。这对所有配置文件的匹配尤其重要。
<br>
* 确认所有用户的UID/GID和以前相同。使用原始的的密码和组文件检查所有用户。注意每个UID/GID与远端系统一致。简单的使用root恢复一切是不够的。
<br>
* 记得在重装时恢复原始的内核。比如在linux下,运行lilo或者grub装载原来的内核。
<br>
* 记住存档备份并放置到安全的地方,最好是离线。冗余能够在物理损坏时挽救你的数据。
<br>
<br>
我的工作始终围绕着unix,其间我接触过不下50种备份方法,包括复杂的硬件设备,媒质,各种图形界面和基于web的界面。有些现在仍然使用,而大多数则已淘汰。就我而言,nfs加上tar(dump)仍然是最好的选择。它需要一些正确配置nfs的知识,但是总而言之,这是保护有价值数据的最可信赖的方式之一。
<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -