« ドイツ遠征準備続く | メイン | ドイツ遠征(帰省)前夜 »
2007年09月20日
メインサーバ障害 |
弊社メインサーバが不調。 /usrパーティションに書き込めなくなった。どうやらディスク障害のようである。 急きょ出陣を中止し(スマソ)、状況の把握と復旧を試みるが、 先日購入した新サーバ(DELL SC440)に移行させることにした。
/usr パーティションになんらかの障害が発生したようだ。
/var/log/messagesに記録されたログは以下の通り。
Sep 20 04:04:08 tsubame syslogd: /usr/local/pgsql/logs/postgresql.log: Read-only file system
Sep 20 04:04:08 tsubame kernel: hda: dma_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }
Sep 20 04:04:08 tsubame kernel: hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=134727, sector=28880
Sep 20 04:04:08 tsubame kernel: end_request: I/O error, dev 03:02 (hda), sector 28880
Sep 20 04:04:08 tsubame kernel: journal_bmap_R31961ab1: journal block not found at offset 3084 on ide0(3,2)
Sep 20 04:04:08 tsubame kernel: Aborting journal on device ide0(3,2).
Sep 20 04:04:08 tsubame kernel: ext3_abort called.
Sep 20 04:04:08 tsubame kernel: EXT3-fs abort (device ide0(3,2)): ext3_journal_start: Detected aborted journal
Sep 20 04:04:08 tsubame kernel: Remounting filesystem read-only
Sep 20 04:04:08 tsubame kernel: EXT3-fs error (device ide0(3,2)) in start_transaction: Journal has aborted
どうやらHDDが壊れかけているようで。。。orz
ReadOnlyになってしまったため /usr/local/apache/配下にあるapache起動できず。
新サーバ 急遽構築
ひとまずNFSで 新サーバから現サーバを見に行くように設定
現サーバの
/etc/exports
/etc/hosts.allow
を編集。
新サーバからマウント
/usr ディレクトリに書き込めないので、apacheのルートディレクトリを/home/hoge に変更してapache/PHP再インストール
とりあえずapacheは上がったが コンテンツ移植がまだだ。
---
新サーバ側
apache,PHPをインストール
php make でエラー
/home/hoge/php-5.2.3/ext/ming/ming.c: In function 'getFontOrFontChar':
/home/hoge/php-5.2.3/ext/ming/ming.c:3854: error: 'fontchar_class_entry_ptr' undeclared (first use in this function)
/home/hoge/php-5.2.3/ext/ming/ming.c:3854: error: (Each undeclared identifier is reported only once
/home/hoge/php-5.2.3/ext/ming/ming.c:3854: error: for each function it appears in.)
/home/hoge/php-5.2.3/ext/ming/ming.c: In function 'zm_startup_ming':
/home/hoge/php-5.2.3/ext/ming/ming.c:4241: error: 'SWFTEXTFIELD_USEFONT' undeclared (first use in this function)
(ry
/home/hoge/php-5.2.3/ext/ming/ming.c:4274: error: 'SWF_SOUND_STEREO' undeclared (first use in this function)
make: *** [ext/ming/ming.lo] エラー 1
mingのバージョンが古かった 0.2→0.3をインストール
再度makeでエラー
/usr/bin/ld: cannot find -lltdl
libmcrypt-2.5.7/libltdlをインストール
# cd /path/to/libmcrypt-2.5.7/libltdl
# ./configure --enable-ltdl-install
# make
# make install
/usrパーティションが 書き込みできないので /home/hoge/apache/htdocsに
コンテンツを移す。
試運転するも、includeファイルは/usr/local/apache/inc を参照してしまう
PHPのconfigureオプションで --with-config-file-pathをつけて make cleanしてから
再インストールすれば任意の場所にphp.iniをおけるようになる。
備忘録がてらconfig.niceをあげておく。
'./configure' \
--prefix=/home/hoge/php \
--with-config-file-path=/home/hoge/php/etc \
--with-pgsql \
--with-gd \
--with-jpeg \
--with-png \
--with-gif \
--with-apxs=/home/hoge/apache/bin/apxs \
--enable-mbstring \
--with-zlib-dir=/usr/lib \
--without-mysql \
--with-mhash \
--enable-mbregex \
--with-ming=shared \
--enable-shmop \
--with-magickwand=/usr \
--with-mcrypt \
--enable-exif \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local/lib \
"$@"
次の重大なインシデントは、postgresqlが参照できないことだ。
psqlも/usr/local/pgsql/配下にあり、 /usr/パーティションが書き込みできないため
db_openすらできない。postmasterは上がっているのだが コマンドラインのpsql も、ダメダメである。
新サーバに postgresqlをインストールし、現サーバの ./data ディレクトリを丸ごとtar で固めて 新サーバへ移行。 pg_ctl start させるも、DBないよー、みたいなことを言われてしまう。 うーむ、環境変数の定義が足りないようだ。
以下の呪文を唱えたあと、再試したところ、無事DBが移行できた。
export PATH=$PATH:/usr/local/pgsql/bin
export POSTGRES_HOME=/usr/local/pgsql
export PGLIB=/usr/local/pgsql/lib
export PGDATA=/usr/local/pgsql/data
落ち穂拾いをしつつ仮復旧にこぎ着ける。 14:00仮復旧。ふぅ
新サーバへ全機能を移行させるには期間が足りない。とりあえずweb、DBだけ移行させよう。
NFSで新旧サーバを結合し コンテンツなどを移行。
なんとか22時にはWeb部門のみ新サーバに切り替えた。PHPのアップグレードも同時に行ったこともあり、一部のPHP3関数が認識されなかったりしたが、おおむね 良好だ。
と思ったら当日誌のMovableTypeのプラグインが動作しなくなっていたのでCPANからライブラリをGETしてインストール。結局3時までかかってしまった。ねむねむ。
メールやDNSサーバについては今回障害発生したパーティションとは別だったこともあり、しばらく新旧2台サーバの構成で運用となりそうである。
途中IMでホワイト達人(仮名)、監督(仮名)とソウル大会の打ち合わせ。あたふた(笑)。
2023:
投稿者 onsenfan [ Linuxサーバ, NEWSニュース , PC・インターネット , トホホ ] : 2007年09月20日 23:34
この記事が役に立った/おもしろいと思ったら、ワンクリックで応援お願いしますトラックバック
このエントリーのトラックバックURL:
https://blog.odorokutamegoro.com/mt-tb.cgi/2047_0352593122341