HomeServer3
の編集
index.php?HomeServer3
[
トップ
] [
編集
|
差分
|
履歴
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
-- 雛形とするページ --
(no template pages)
&color(red){Cent OS5 移行に伴う変更部分のみ記載 (共通部分は 2006 の設定に必要項目を追記している)}; #contents(); *** インストール計画 [#u80c396c] - Cent OS4 の環境は /boot /swap を含め全ての環境を RAID5 ディスクアレイ上の LVM に構築していた - /home 以下、/var/www 以下、/opt 以下などアプリケーション依存データの継承性を考慮すると、これらを OSバージョン依存データとは分けて管理することが望ましい - Cent OS5 では OS kernel 依存部専用の 単純ディスク(≠RAID、≠lvm) を /dev/hdc に増設した - 従来の raid5 ディスクは /raid にマウントし、Cent OS5 環境からアクセスできるようにした (当然 /etc は参照しない) - /home、 /var/www など一部のファイルは /raid 以下の構造に symbolic link を張ってあるが、スクリプトの記述などは出来るだけ明示的に /raid/home/munakata などと フルパスを指定するようにしている - ディスクジオメトリとマウントポイント |物理デバイス名|論理デバイス名|Cent 4|Cent 5|h |/dev/sdb1|||/boot| |/dev/sdb2|||/| |/dev/hdb2|||/opt_ftp| |/dev/sda2|||/dtv_rec| |dev/mapper/VolGroup00-LogVol00||/|/raid| |dev/mapper/VolGroup00-LogVol00|/dev/sdc1|/boot|/mnt/cent_boot| *** ブートメソッド [#zb1c85a0] - Cent OS5 インストール時の設定で /boot を /dev/hdc1 に設定した - Cent OS5 環境で kernel update が実行されると kernel binary image、init RAM disk image は /boot に追加展開される - 同時に /etc/grib.conf が自動編集されて 新しい kernel image を初期起動環境に再設定する - &color(red){しかし、システム起動時のブートローダーは Cent OS4 の /boot 設定を参照して起動イメージを決定している}; - &color(red){従って yum によって更新された /etc/gub.conf は参照されない = 起動イメージが更新されない}; - この問題を解決するために kernel 更新時には以下の設定をマニュアルで行う必要がある -- yum で kernel が更新された事を確認する -- &color(red){Cent4 用の grub.conf にこの更新内容マニュアルで追加するが、このファイルは /raid/etc/grub.conf ではアクセスできない}; -- それは /raid/etc/grub.conf が /boot/grub/gub.conf へのリンクになっていて、Cent4 の /boot にアクセスできないから -- &color(red){この問題を解決するために、シンボリックリンク先のファイル (=/mnt/cent_boot/grub.conf ) を直接編集する}; -- grub.conf の中では (Cent OS5 環境の)/boot 以下のイメージを直接指定することができる [root@spirit ~]# cat /mnt/cent_boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/sda #default=0 force to use old kernel, auto-updated kernel not includes AACRAID default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz #hiddenmenu title CentOS 5 (2.6.18-8.1.3.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.1.3.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.1.3.el5.img title CentOS 5 (2.6.18-8.1.1.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.1.1.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.1.1.el5.img title CentOS 5 (2.6.18-8.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.el5.img title CentOS (2.6.9-42.0.10.EL) root (hd0,0) kernel /vmlinuz-2.6.9-42.0.10.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-42.0.10.EL.img title CentOS (2.6.9-42.0.8.EL) root (hd0,0) kernel /vmlinuz-2.6.9-42.0.8.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-42.0.8.EL.img *** グラフィックスボード [#a60600d0] - Spirit には ATI Radion X1300 ・・・・ ファンレス、低価格ボードを組み込み - &ref(ati_spirit.JPG); - [[CentOS への ATI glx ドライバーのインストール手順:http://www.centos.org/modules/newbb/viewtopic.php?topic_id=5327]] - しかし、Mesa の OpenGL が動作しているな... なぜ ? [root@spirit ~]# fglrxinfo Xlib: extension "XFree86-DRI" missing on display ":0.0". display: :0.0 screen: 0 OpenGL vendor string: Mesa project: www.mesa3d.org OpenGL renderer string: Mesa GLX Indirect OpenGL version string: 1.2 (1.5 Mesa 6.5.1) *** 3D Desktop ( Compiz , AIGLX ) [#c9ea5a85] - 結果的には Radion X1300 (低価格、ファンレスボード)ではハードウエアが OpenGL に対応していないため動かせなかった - AIGLX(Accelerated Indirect GL X)は,Fedora Projectが開発しており,デスクトップでOpenGLの機能を利用して様々な表示効果を実現する。 - AIGLX を動かすには グラフィックスボードが OpenGL の &color(red){DRI (=Direct Rendering Infrastructure)}; をサポートしていなければならないが、下記の X起動ログで DRI compatible でないといわれた [root@spirit ~]# tail /var/log/Xorg.setup.log Build ID: xorg-x11-server 1.1.1-48.13.0.1.el5 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (++) Log file: "/dev/null", Time: Fri May 11 00:14:04 2007 (++) Using config file: "/tmp/tmpjqbOytxorg.config" (EE) AIGLX: Screen 0 is not DRI capable - 参考 URL -- [[IT pro 【Linuxウォッチ】第29回 Momonga Linuxで3Dデスクトップ「AIGLX」を試す:http://pc.nikkeibp.co.jp/article/COLUMN/20060919/248376/]] -- [[AIGLX project wiki:http://fedoraproject.org/wiki/RenderingProject/aiglx]] * メール [#y0673fed] ** fetchmail [#lcdf3de1] - rc ファイル (/raid/home の各ユーザーディレクトリに個別に設定) - 自動起動スクリプト[/etc/rc.d/init.d/fetchmail] (/home のロケーションを書き換え) ---- &ref(fetchmail); -- /etc/rc.d/init.d の下に下記のファイルを作成し実行権を付与 -- chkconfig fetchmail on で自動起動を設定 -- 各ユーザーの rc ファイルを読み込んで実行できるか検証 [root@spirit ~]# cat /etc/rc.d/init.d/fetchmail #!/bin/bash # # Fetchmail # # chkconfig: - 99 20 # description: Fetchmail auto start script # Source function library. . /etc/rc.d/init.d/functions start() { # Start daemons. for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmailrc ]; then if [ ! -f /raid/home/$user/.fetchmail.pid ]; then echo "fetchmail for $user starting..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail" else PID=`cat /raid/home/$user/.fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then echo "fetchmail for $user is already started..." else echo "fetchmail for $user is restartng..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail" fi fi fi done if [ -f /root/.fetchmailrc ]; then if [ ! -f /var/run/fetchmail.pid ]; then echo "fetchmail for root starting..." /usr/bin/fetchmail else PID=`cat /var/run/fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then echo "fetchmail for root is already started..." else echo "fetchmail for root is restartng..." /usr/bin/fetchmail fi fi fi } stop() { # Stop daemons. if [ -f /var/run/fetchmail.pid ]; then echo "fetchmail for root stoping..." /usr/bin/fetchmail --quit fi for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmail.pid ]; then echo "fetchmail for $user stoping..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail --quit" fi done } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) run="0" if [ -f /var/run/fetchmail.pid ]; then PID=`cat /var/run/fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then run="1" echo "fetchmail for root is running..." fi fi for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmail.pid ]; then PID=`cat /raid/home/$user/.fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then run="1" echo "fetchmail for $user is running..." fi fi done if [ $run == "0" ]; then echo "fetchmail is not running" exit 1 fi ;; *) echo "Usage: fetchmail {start|stop|restart|status}" exit 1 esac exit $? [root@spirit ~]# - マニュアルページ -- http://www.big.or.jp/~mio/it-old/fm/ref/fm_ref_fetchmailrc_5.html -- http://jo1upk.blogdns.net/linux/index.php?%E3%82%BD%E3%83%95%E3%83%88%2Ffetchmail * バックアップサーバー上のスクリプト (rsync で差分更新) [#p6dc63bb] - rsync で差分を更新する (cp コマンドよりずっと高速) - ssh の rsa 鍵交換によりパスワードの入力がいらなくなっている(cron での自動実行が可能) -- &ref(archives_sync.sh); -- &ref(image_sync.sh); -- &ref(mail_sync.sh); -- &ref(peewee_sync.sh); -- &ref(wiki_sync.sh); -- &ref(webdav_sync.sh); [root@backup script]# cat archives_sync.sh #!/bin/sh # sync spirit.hmuna.com master archived data to "backup.hmuna.com" remote copy while [ -n "$(echo $1 | grep '^-')" ]; do optins="$options $1" shift done # spirit のバックアップアーカイブの更新分をコピー (メール以外) # webdv と svn は以前のバックアップを消して最新のアーカイブだけを保存 #rm -fR /backup/archives/webdav/* rm -fR /backup/archives/svn/* eval `ssh-agent` cd /root ssh-add id_rsa rsync -avx -e ssh spirit.hmuna.com:/opt/backup/web/*.tgz /backup/archives/apache rsync -avx -e ssh spirit.hmuna.com:/opt/backup/etc/*.tgz /backup/archives/etc rsync -avx -e ssh spirit.hmuna.com:/opt/backup/dav/*.tgz /backup/archives/webdav rsync -avx -e ssh spirit.hmuna.com:/opt/backup/svn/*.tgz /backup/archives/svn # spirit の各ユーザ、プロセス毎の主要スクリプトをバックアップ(更新) rsync -avx -e ssh spirit.hmuna.com:/opt/backup/script/ /backup/archives/script eval `ssh-agent -k`
タイムスタンプを変更しない
&color(red){Cent OS5 移行に伴う変更部分のみ記載 (共通部分は 2006 の設定に必要項目を追記している)}; #contents(); *** インストール計画 [#u80c396c] - Cent OS4 の環境は /boot /swap を含め全ての環境を RAID5 ディスクアレイ上の LVM に構築していた - /home 以下、/var/www 以下、/opt 以下などアプリケーション依存データの継承性を考慮すると、これらを OSバージョン依存データとは分けて管理することが望ましい - Cent OS5 では OS kernel 依存部専用の 単純ディスク(≠RAID、≠lvm) を /dev/hdc に増設した - 従来の raid5 ディスクは /raid にマウントし、Cent OS5 環境からアクセスできるようにした (当然 /etc は参照しない) - /home、 /var/www など一部のファイルは /raid 以下の構造に symbolic link を張ってあるが、スクリプトの記述などは出来るだけ明示的に /raid/home/munakata などと フルパスを指定するようにしている - ディスクジオメトリとマウントポイント |物理デバイス名|論理デバイス名|Cent 4|Cent 5|h |/dev/sdb1|||/boot| |/dev/sdb2|||/| |/dev/hdb2|||/opt_ftp| |/dev/sda2|||/dtv_rec| |dev/mapper/VolGroup00-LogVol00||/|/raid| |dev/mapper/VolGroup00-LogVol00|/dev/sdc1|/boot|/mnt/cent_boot| *** ブートメソッド [#zb1c85a0] - Cent OS5 インストール時の設定で /boot を /dev/hdc1 に設定した - Cent OS5 環境で kernel update が実行されると kernel binary image、init RAM disk image は /boot に追加展開される - 同時に /etc/grib.conf が自動編集されて 新しい kernel image を初期起動環境に再設定する - &color(red){しかし、システム起動時のブートローダーは Cent OS4 の /boot 設定を参照して起動イメージを決定している}; - &color(red){従って yum によって更新された /etc/gub.conf は参照されない = 起動イメージが更新されない}; - この問題を解決するために kernel 更新時には以下の設定をマニュアルで行う必要がある -- yum で kernel が更新された事を確認する -- &color(red){Cent4 用の grub.conf にこの更新内容マニュアルで追加するが、このファイルは /raid/etc/grub.conf ではアクセスできない}; -- それは /raid/etc/grub.conf が /boot/grub/gub.conf へのリンクになっていて、Cent4 の /boot にアクセスできないから -- &color(red){この問題を解決するために、シンボリックリンク先のファイル (=/mnt/cent_boot/grub.conf ) を直接編集する}; -- grub.conf の中では (Cent OS5 環境の)/boot 以下のイメージを直接指定することができる [root@spirit ~]# cat /mnt/cent_boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/sda #default=0 force to use old kernel, auto-updated kernel not includes AACRAID default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz #hiddenmenu title CentOS 5 (2.6.18-8.1.3.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.1.3.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.1.3.el5.img title CentOS 5 (2.6.18-8.1.1.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.1.1.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.1.1.el5.img title CentOS 5 (2.6.18-8.el5) root (hd3,0) kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-8.el5.img title CentOS (2.6.9-42.0.10.EL) root (hd0,0) kernel /vmlinuz-2.6.9-42.0.10.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-42.0.10.EL.img title CentOS (2.6.9-42.0.8.EL) root (hd0,0) kernel /vmlinuz-2.6.9-42.0.8.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-42.0.8.EL.img *** グラフィックスボード [#a60600d0] - Spirit には ATI Radion X1300 ・・・・ ファンレス、低価格ボードを組み込み - &ref(ati_spirit.JPG); - [[CentOS への ATI glx ドライバーのインストール手順:http://www.centos.org/modules/newbb/viewtopic.php?topic_id=5327]] - しかし、Mesa の OpenGL が動作しているな... なぜ ? [root@spirit ~]# fglrxinfo Xlib: extension "XFree86-DRI" missing on display ":0.0". display: :0.0 screen: 0 OpenGL vendor string: Mesa project: www.mesa3d.org OpenGL renderer string: Mesa GLX Indirect OpenGL version string: 1.2 (1.5 Mesa 6.5.1) *** 3D Desktop ( Compiz , AIGLX ) [#c9ea5a85] - 結果的には Radion X1300 (低価格、ファンレスボード)ではハードウエアが OpenGL に対応していないため動かせなかった - AIGLX(Accelerated Indirect GL X)は,Fedora Projectが開発しており,デスクトップでOpenGLの機能を利用して様々な表示効果を実現する。 - AIGLX を動かすには グラフィックスボードが OpenGL の &color(red){DRI (=Direct Rendering Infrastructure)}; をサポートしていなければならないが、下記の X起動ログで DRI compatible でないといわれた [root@spirit ~]# tail /var/log/Xorg.setup.log Build ID: xorg-x11-server 1.1.1-48.13.0.1.el5 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (++) Log file: "/dev/null", Time: Fri May 11 00:14:04 2007 (++) Using config file: "/tmp/tmpjqbOytxorg.config" (EE) AIGLX: Screen 0 is not DRI capable - 参考 URL -- [[IT pro 【Linuxウォッチ】第29回 Momonga Linuxで3Dデスクトップ「AIGLX」を試す:http://pc.nikkeibp.co.jp/article/COLUMN/20060919/248376/]] -- [[AIGLX project wiki:http://fedoraproject.org/wiki/RenderingProject/aiglx]] * メール [#y0673fed] ** fetchmail [#lcdf3de1] - rc ファイル (/raid/home の各ユーザーディレクトリに個別に設定) - 自動起動スクリプト[/etc/rc.d/init.d/fetchmail] (/home のロケーションを書き換え) ---- &ref(fetchmail); -- /etc/rc.d/init.d の下に下記のファイルを作成し実行権を付与 -- chkconfig fetchmail on で自動起動を設定 -- 各ユーザーの rc ファイルを読み込んで実行できるか検証 [root@spirit ~]# cat /etc/rc.d/init.d/fetchmail #!/bin/bash # # Fetchmail # # chkconfig: - 99 20 # description: Fetchmail auto start script # Source function library. . /etc/rc.d/init.d/functions start() { # Start daemons. for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmailrc ]; then if [ ! -f /raid/home/$user/.fetchmail.pid ]; then echo "fetchmail for $user starting..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail" else PID=`cat /raid/home/$user/.fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then echo "fetchmail for $user is already started..." else echo "fetchmail for $user is restartng..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail" fi fi fi done if [ -f /root/.fetchmailrc ]; then if [ ! -f /var/run/fetchmail.pid ]; then echo "fetchmail for root starting..." /usr/bin/fetchmail else PID=`cat /var/run/fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then echo "fetchmail for root is already started..." else echo "fetchmail for root is restartng..." /usr/bin/fetchmail fi fi fi } stop() { # Stop daemons. if [ -f /var/run/fetchmail.pid ]; then echo "fetchmail for root stoping..." /usr/bin/fetchmail --quit fi for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmail.pid ]; then echo "fetchmail for $user stoping..." su $user -s "/bin/bash" -c "/usr/bin/fetchmail --quit" fi done } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) run="0" if [ -f /var/run/fetchmail.pid ]; then PID=`cat /var/run/fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then run="1" echo "fetchmail for root is running..." fi fi for user in `ls /raid/home/` do if [ -f /raid/home/$user/.fetchmail.pid ]; then PID=`cat /raid/home/$user/.fetchmail.pid|cut -d " " -f 1` ps $PID>/dev/null if [ $? = 0 ]; then run="1" echo "fetchmail for $user is running..." fi fi done if [ $run == "0" ]; then echo "fetchmail is not running" exit 1 fi ;; *) echo "Usage: fetchmail {start|stop|restart|status}" exit 1 esac exit $? [root@spirit ~]# - マニュアルページ -- http://www.big.or.jp/~mio/it-old/fm/ref/fm_ref_fetchmailrc_5.html -- http://jo1upk.blogdns.net/linux/index.php?%E3%82%BD%E3%83%95%E3%83%88%2Ffetchmail * バックアップサーバー上のスクリプト (rsync で差分更新) [#p6dc63bb] - rsync で差分を更新する (cp コマンドよりずっと高速) - ssh の rsa 鍵交換によりパスワードの入力がいらなくなっている(cron での自動実行が可能) -- &ref(archives_sync.sh); -- &ref(image_sync.sh); -- &ref(mail_sync.sh); -- &ref(peewee_sync.sh); -- &ref(wiki_sync.sh); -- &ref(webdav_sync.sh); [root@backup script]# cat archives_sync.sh #!/bin/sh # sync spirit.hmuna.com master archived data to "backup.hmuna.com" remote copy while [ -n "$(echo $1 | grep '^-')" ]; do optins="$options $1" shift done # spirit のバックアップアーカイブの更新分をコピー (メール以外) # webdv と svn は以前のバックアップを消して最新のアーカイブだけを保存 #rm -fR /backup/archives/webdav/* rm -fR /backup/archives/svn/* eval `ssh-agent` cd /root ssh-add id_rsa rsync -avx -e ssh spirit.hmuna.com:/opt/backup/web/*.tgz /backup/archives/apache rsync -avx -e ssh spirit.hmuna.com:/opt/backup/etc/*.tgz /backup/archives/etc rsync -avx -e ssh spirit.hmuna.com:/opt/backup/dav/*.tgz /backup/archives/webdav rsync -avx -e ssh spirit.hmuna.com:/opt/backup/svn/*.tgz /backup/archives/svn # spirit の各ユーザ、プロセス毎の主要スクリプトをバックアップ(更新) rsync -avx -e ssh spirit.hmuna.com:/opt/backup/script/ /backup/archives/script eval `ssh-agent -k`
テキスト整形のルールを表示する
添付ファイル:
peewee_sync.sh
25件
[
詳細
]
wiki_sync.sh
24件
[
詳細
]
archives_sync.sh
26件
[
詳細
]
webdav_sync.sh
25件
[
詳細
]
ati_spirit.JPG
31件
[
詳細
]
mail_sync.sh
23件
[
詳細
]
image_sync.sh
24件
[
詳細
]