2009 DNS 1st 入れ替えログ (2009/11/13)


  1. 設定ファイルのバックアップ
  2. yellow をシャットダウン
  3. ホスト名, IP アドレスの変更
  4. 新設定の読み込み
  5. gate-toroku-system のインストール
  6. 各ソフトウェアの動作確認
  7. /etc/passwd, /etc/shadow, /etc/group, /etc/sudoers の編集
  8. 後始末

設定ファイルのバックアップ

現 yellow の /etc/shadow, /etc/passwd, /etc/group, /etc/sudoers を www にバックアップする.

# scp /etc/shadow hoge@orange.ep.sci.hokudai.ac.jp:shadow_bk

パーミッションを変えて見れないようにする.

$ chmod 700 shadow_bk

yellow をシャットダウン

$ sudo halt 

ホスト名, IP アドレスの変更

ホスト名の変更(kihada -> yellow)

/etc/hosts において

133.87.45.70	yellow.ep.sci.hokudai.ac.jp    yellow	

/etc/hostname において

yellow

/etc/motd において

Linux yellow 2.6.26-2-686 #1 SMP Wed Aug 19 06:06:52 UTC 2009 i686

/etc/mailname において

yellow.ep.sci.hokudai.ac.jp

/etc/exim4/update-exim4.conf.conf において

dc_other_hostnames='yellow.ep.sci.hokudai.ac.jp'

と編集.

IP アドレスの変更

新 yellow のグローバル IP アドレスを 133.87.45.70 に設定

/etc/network/interfaces を

iface eth0 inet static
       address 133.87.45.70
       netmask 255.255.255.0
       network 133.87.45.0
       broadcast 133.87.45.255
       gateway 133.87.45.1
       # dns-* options are implemented by the resolvconf package, if installed
       dns-nameservers 133.87.45.70 133.87.45.66 133.87.1.11
       dns-search ep.sci.hokudai.ac.jp

と編集.

新設定の読み込み

ホスト名の読み込み

# hostname --file /etc/hostname

ネットワークの再起動

# /etc/init.d/networking restart

syslog-ng の再起動

# /etc/init.d/syslog-ng restart

gate-toroku-system のインストール

公開鍵作り直し

www サーバで gate ユーザが作業を行う.

すでにある公開鍵を削除する.

~gate/.ssh/known_hosts 中の yellow の行を削除

新たに公開鍵を取得する.

$ ssh yellow.ep.sci.hokudai.ac.jp

公開鍵を作りますかと聞かれ yes を入力.

gate.conf の確認

orange の /etc/gate.conf の %DB_SHARE_HOSTS に yellow が書き込まれているか確認.

データベース転送

yellow から www にログイン.

$ ssh orange.ep.sci.hokudai.ac.jp
$ telnet localhost 8888

転送完了の確認

blue にて

$ ps aux | grep gate

なにやら gate がまだ動いている模様.

$ ls -lt /home/gate/userdb/

1 つもファイルがない.

-> 転送がまだ完了していない!

www で

$ ps aux | grep gate

rsync が動いている.

yellow ではすこしずつファイルが増えている.

-> 転送にものすごく時間がかかっている.

yellow で dmesg を見てみると

eth0 link down
eth0 link up

がひたすら繰り返されている.

-> ネットワークカードの不調?

ネットワークの口を変えてやり直してみる.

/etc/network/interfaces の eth0 を eth1 に変更.

# /etc/init.d/networking restart

eth1 が立ち上がらないので OS を再起動. -> 立ち上がった.

今度は dmesg にエラーは出ていない模様.

もう一度

$ ssh hoge@orange.ep.sci.hokudai.ac.jp
$ telnet localhost 8888

今度は一瞬で転送されたようだ.

/home/gate/userdb, /home/gate/ipdb などにファイルができ, 各ユーザの home ディレクトリができた.

各ソフトウェアの動作確認

bind9

host -l ep.sci.hokudai.ac.jp

動いている.

/etc/passwd, /etc/shadow, /etc/group, /etc/sudoers の編集

新しくできた /etc/passwd, /etc/shadow, /etc/group, /etc/sudoers の人名の行(gate より下)を, バックアップしておいたファイルで置き換える.

mondo 以外でログインしてみる.

-> ログインできた.

後始末

/ETC, /HOME を削除

# rm -r /ETC /HOME

mondo ユーザを削除

# deluser --remove-home mondo1
# deluser --remove-home mondo5

gate 登録更新

テプラの貼り換え