NIS Server DR SOP

NIS Server DR SOP

  

NIS 服務器系統災難恢復

方法:一

l          主配置目錄 (/etc)

l          DNS 域信息 (/var/bind)

l          NIS/NIS+ 文件和配置 (/var/yp)

l          Lightweight Directory Access Protocol (LDAP) 服務器數據(/var/ldap

二.  爲不同的目錄創建經過 tar 處理和壓縮的備份

#!/bin/bash

DATE=`date +%Y%m%d.%H%M`

HOST=`sh1`

TEMP=/mnt/backup

echo "Preparing backup..."

cd /etc

tar cf - ./* |bzip2 -9 - >$TEMP/$HOST-etc.$DATE.tar.bz2

cd /var/bind

tar cf - ./* |bzip2 -9 - >$TEMP/$HOST-bind.$DATE.tar.bz2

cd /var/yp

tar cf - ./* |bzip2 -9 - >$TEMP/$HOST-nis.$DATE.tar.bz2

cd /var/ldap

tar cf - ./* |bzip2 -9 - >$TEMP/$HOST-ldap.$DATE.tar.bz2

echo "complete backup..."

    

三.安裝nis服務器操作系統並配置網絡

  安裝操作系統時我們必須清楚backup server sh1的以下一些信息:

 

OS版本信息: SUNOS 5.8 Generic_117350-36

Partition信息: /dev/dsk/c0t0d0s0   à   /         3.91G       0  --  805

           /dev/dsk/c0t0d0s1   à   swap     3.91G    806  --  1611

           /dev/dsk/c0t0d0s3   à   /home    60.53G   1612  --  14086

四.掛載backup server 恢復目錄;

 

# cd /mnt/backup
# tar –jmxvf sh1-etc.date.tar.bz2 –C /etc/

# tar –jmxvf sh1-bind.date.tar.bz2 –C /var/bind/

# tar –jmxvf sh1-nis.date.tar.bz2 –C /var/yp/

# tar –jmxvf sh1-ldap.date.tar.bz2 –C /var/ldap/

    

五.啓動nis server autofs

# ypinit –m

In order for NIS to operate successfully, we have to construct a list of

the NIS servers. Please continue to add the names for YP servers in order

of preference, one per line. When you are done with the list, type a

<control D> or a return on a line by itself.

next host to add: sh1

next host to add: ^D

The current list of yp servers looks like this:

sh1

Is this correct? [y/n: y] y

Installing the YP database will require that you answer a few questions.

Questions will all be asked at the beginning of the procedure.

Do you want this procedure to quit on non-fatal errors? [y/n: n] n

OK, please remember to go back and redo manually whatever fails. If you

don't, some part of the system (perhaps the yp itself) won't work.

# /usr/lib/netsvc/yp/ypstart

# cd /var/yp; /usr/ccs/bin/make

# /etc/init.d/autofs start

 

 

六.              驗證nis server是否正常啓動,automount掛載目錄是否正確

 

七.完成事故報告

對事故作記錄,總結事故發生原因,避免產生同樣的問題。

 

方法:二

一. 準備1塊與原使用盤相同的硬盤

Partition信息: /dev/dsk/c0t1d0s0   à   /        7.8G       0  --  1611

           /dev/dsk/c0t1d0s1   à   swap     3.91G    1611  --  2416

           /dev/dsk/c0t1d0s3   à   /home    56.53G   2416  --  14086

 

二.定期運行腳本backupfilesys

腳本backupfilesys 內容

#!/bin/bash

 

WORKDIR=/u/sysadmin/backup/sh1

LOGFILE=${WORKDIR}/log/`date +%Y%m%d`.log

UFSDUMP=/usr/sbin/ufsdump

UFSRESTORE=/usr/sbin/ufsrestore

        

exec > $LOGFILE 2>&1

mount -F ufs /dev/dsk/c0t1d0s0 /backup/root

mount -F ufs /dev/dsk/c0t1d0s3 /backup/home

$UFSDUMP 0f - /dev/dsk/c0t0d0s0 | (cd /backup/root;$UFSRESTORE rf -)

$UFSDUMP 0f - /dev/dsk/c0t0d0s3 | (cd /backup/home;$UFSRESTORE rf -)

umount /backup/root

umount /backup/home

fsck -y /dev/rdsk/c0t1d0s0

fsck -y /dev/rdsk/c0t1d0s3

installboot /usr/platform/sun4u/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0

exit

 

三.更換硬盤,查看nis server是否正常工作

 

四.完成事故報告

對事故作記錄,總結事故發生原因,避免產生同樣的問題。

 

 

Reference   

 

---- end ----

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章