■CPUとHDDをmuninで監視する設定メモ
 稼働中のマシンのCPU温度やHDDの状況をmuninで監視する設定のメモ。

■CPU温度の監視
 事前にlm_sensors設定を行っていること

・有効な設定の確認をする
 # /usr/share/munin/plugins/sensors_ suggest

・temp設定を追加する
 # cd /etc/munin/plugins/
 # ln -s /usr/share/munin/plugins/sensors_ sensors_temp

・動作確認
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins sensors_temp

・設定を有効にする
 # service munin-node restart

■HDDの温度及びSMARTデータの監視
 HDDがSMART対応の必要があるので注意

・温度監視を追加
 # cd /etc/munin/plugins/
 # ln -s /usr/share/munin/plugins/hddtemp_smartctl hddtemp_smartctl

・SMARTデータの監視追加
 # ln -s /usr/share/munin/plugins/smart_ smart_sda

・設定ファイルを作成して設定追加
 # vi /etc/munin/plugin-conf.d/hddtemp_smartctl
 以下を追記
 env.drives sda
 env.type_sda ata

 # vi /etc/munin/plugin-conf.d/smart_
 以下を追記
 [smart_*]
 user root
 
 [smart_sda]
 env.smartargs -d ata

・動作確認
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins hddtemp_smartctl
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins smart_sda
 以下のエラーが出た場合には修正をする

  Traceback (most recent call last):
   File “/etc/munin/plugins/smart_sda”, line 398, in ?
   exit(0)
  TypeError: ‘str’ object is not callable

 398行目の exit(0) → sys.exit(0) に修正

・設定を有効にする
 # service munin-node restart

,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

mysqlの障害を監視する各種設定メモ
 mysqlが過負荷になる現象が確認されたので、障害対応と監視を強化するために行った作業のメモ。

■muninによる監視の追加
・muninは導入済みの想定
 /usr/share/munin/plugins/mysql_ を利用する

・基本監視可能項目のリスト 出力された項目が設定可能
 # /usr/share/munin/plugins/mysql_ suggest
 Cache::Cacheのエラーが出る場合は以下を実行
 # yum install perl-Cache-Cache

・基本監視項目を設定
 # cd /etc/munin/plugins
 # ln -s /usr/share/munin/plugins/mysql_ mysql_commands
 # ln -s /usr/share/munin/plugins/mysql_ mysql_connections
 # ln -s /usr/share/munin/plugins/mysql_ mysql_slow
 # ln -s /usr/share/munin/plugins/mysql_ mysql_myisam_indexes
 # ln -s /usr/share/munin/plugins/mysql_ mysql_network_traffic
 # ln -s /usr/share/munin/plugins/mysql_ mysql_qcache
 # ln -s /usr/share/munin/plugins/mysql_ mysql_qcache_mem

・設定の追加
 # vi /etc/munin/plugin-conf.d/munin-node
 以下を追記
 [mysql_*]
 env.mysqlconnection DBI:mysql:mysql;host=127.0.0.1;port=3306
 env.mysqluser root
 env.mysqlpassword password

・データ取得できているか動作確認する
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_commands
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_connections
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_slow
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_myisam_indexes
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_network_traffic
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_qcache
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins mysql_qcache_mem

・設定を有効にする
 # service munin-node restart

■mysqlに障害対応用ログ取得設定を追記
・slowログとバイナリーログを7日分出力する
 # vi /etc/my.cnf
 log-slow-queries=/var/log/mysql/slow.log
 long_query_time=3
 log-bin = /var/log/mysql/mysql-bin
 set-variable = expire_logs_days=7

・保存場所を作成してmysqlを再起動
 # mkdir /var/log/mysql
 # chown -R mysql:mysql /var/log/mysql
 # service mysqld restart

■稼働中のmysqlの状態把握ができるようにする
・mytopをインストールする
 # yum install mytop

・設定ファイルを作成する
 # vi ~/.mytop
 以下の内容を設定に合わせて記入
 user=root
 pass=password
 host=localhost
 db=mysqldbname
 delay=3
 port=3306
 socket=
 batchmode=0
 header=1
 color=1
 idle=1

・mytopを実行する
 # mytop
 終了時はqキー

・innotopをインストールする
 # yum install innotop

・innotopを起動する
 # innotop
 画面の指示に従い設定を入力する
 ヘルプは?、終了はqキー

・innotopの設定を編集する
 # vi ~/.innotop/innotop.ini
 connectionsの設定を編集
 mysqldbname=user=root pass=password have_user= have_pass=
  dsn=DBI:mysql:;host=localhost;port=3306 savepass= dl_table=

■プロセス監視ツールを追加する
・atopをインストールする
 # yum install atop
 実行は以下
 # atop
 異常値を色で示してくれるのでわかりやすい

■プロセスの状況を監視する設定をmuninに追加する
・user単位の使用状況を確認可能なmuninプラグインcpubyuserを設定する
 http://exchange.munin-monitoring.org/plugins/cpubyuser/details
 # cd /usr/share/munin/plugins/
 # wget http://exchange.munin-monitoring.org/plugins/cpubyuser/version/1/download
 # mv download cpubyuser

・cpubyuserの設定を追加
 # vi /etc/munin/plugin-conf.d/munin-node
 以下監視したいuser名を追記
 [cpubyuser]
 env.USERS root postfix mysql apache munin munin-node

・process単位の使用状況を確認可能なmuninプラグインcpu_by_processを設定する
 http://exchange.munin-monitoring.org/plugins/cpu_by_process/details
 # wget http://exchange.munin-monitoring.org/plugins/cpu_by_process/version/1/download
 # mv download cpu_by_process

・cpu_by_processの設定を追加
 # vi /etc/munin/plugin-conf.d/munin-node
 以下を追記
 [cpu_by_process]
 user root

・プラグインを有効にする
 # cd /etc/munin/plugins
 # ln -s /usr/share/munin/plugins/cpubyuser cpubyuser
 # ln -s /usr/share/munin/plugins/cpu_by_process cpu_by_process

・データ取得できているか動作確認する
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins cpubyuser
 # /usr/sbin/munin-run -servicedir /etc/munin/plugins cpu_by_process

・設定を有効にする
 # service munin-node restart

, ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■UL20Aに Ubuntu 11.10 をインストールしたメモ
 Ubuntuの11.10が本家でリリースされたのでインストールしてみたメモ。今回は32bit推奨とあまり強くは書いてないようだったので64bit版を選択してみた。以下やってみたことを箇条書きに。

■インストールまで
・MacOSXのChromeでubuntu-11.10-desktop-amd64.isoをダウンロード
・ダウンロードしたisoをunetbootin.appでUSBメモリに書き込む
・USBメモリをUL20Aに挿してUSBメモリからブートしてinstallを選択 簡単w

■インストール
・USBメモリからブートしたら後はいつもの通り画面の指示に従うだけ
・今回もHDD全体を使って新規インストールに
・インストーラデザインが全体的にキレイになってる気がする
・インストール中にアップデートダウンロードと3rdパーティ製ソフトのインストールにチェック
・日本語設定も問題なく可能 簡単w

■インストール後やったこと&気付いたこと
・日本語フォントが貧弱 古い明朝体のまま
・システム設定の外観からフォント設定とかの項目が消えてる…
・Ubuntuソフトウェアセンターでフォントを選択するも何も出てこない…
・仕方ないのでaptでフォントを追加
 $ sudo apt-get update
 $ sudo apt-get upgrade
 $ sudo apt-get install fonts-vlgothic
 これで日本語がキレイに表示される(VLGothic好きなのでw)
・フォルダ表記を英語に変更
 $ LANG=C xdg-user-dirs-gtk-update
・コマンドラインからsshの導入
 $ sudo apt-get install ssh
・日本語入力用にMozcを導入
 $ sudo apt-get install ibus-mozc
 メニューバーのキーボードアイコンから再起動メニューを選択
 再起動後、同設定メニューを選択
 インプットメソッドタブを選択し、インプットメソッドの選択から日本語→Mozc選択
 追加ボタンを押して、Mozcを追加
 追加されたMozcを選択して上へボタンを押して太字になったことを確認
 閉じるボタンを押す
 キーボードアイコンからMozcを選択すれば日本語入力可能になる
・標準ブラウザはFirefox 7.0.1!さすが!
・標準メーラーはThunderbird 7.0.1!さすが!
・Synapticは標準インストールされないのね…
・Ubuntuソフトウェアセンターなんだか使いにくいというか使えないヤツというか…
・とりあえずSynapticは追加
・Ubuntu Tweakもないね…
 0.6のベータ版はここから入手可能、11.10でも動くらしいがちょっと様子見
・なんとなく11.04に比べて完成度低い感じがしたりしなかったり…うーむ

とりあえずここまで
随時追記します

,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (2 投票, 平均値/最大値: 4.50 / 5)
Loading...

■Scientific Linux 5.7でmysqld複数起動設定
 基本はCentOS5系と同じなのだが、省略できない手順がありそのままではmysqld_multiが起動できなかったため、改めて書いておく。CentOSよりも自動で処理してもらえる部分が少ないので注意。

1)設定ファイルを編集する
# cat /etc/my.cnf

[client]
#password = your_password
port = 13306
socket = /var/lib/mysql1/mysql.sock
default-character-set=utf8

[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = root
password = rootpasswd

# The MySQL server
[mysqld1]
port = 13306
socket = /var/lib/mysql1/mysql.sock
pid-file = /var/lib/mysql1/host.pid
datadir = /var/lib/mysql1/
skip-locking
key_buffer = 96M
max_allowed_packet = 3M
table_cache = 128
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8
default-character-set=utf8
character_set_server=utf8
skip-federated
log-bin=mysql-bin

[mysqld2]
port = 13307
socket = /var/lib/mysql2/mysql.sock2
pid-file = /var/lib/mysql2/host.pid2
datadir = /var/lib/mysql2/
skip-locking
key_buffer = 96M
max_allowed_packet = 3M
table_cache = 128
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 8
default-character-set=utf8
character_set_server=utf8
skip-federated
log-bin=mysql-bin

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

2)mysqld_multiで起動できるよう以下のコマンドを各datadirで行う
#/usr/bin/mysql_install_db –user=mysql –datadir=/var/lib/mysql1/
#/usr/bin/mysql_install_db –user=mysql –datadir=/var/lib/mysql2/

3)各mysqldを起動しパスワード設定を行う
# mysqld_multi start 1
# mysql –socket=/var/lib/mysql1/mysql.sock -u root
mysql> set password = password(‘rootpasswd’);
mysql> quit
# mysqld_multi stop 1
# mysqld_multi start 2
# mysql –socket=/var/lib/mysql2/mysql.sock -u root
mysql> set password = password(‘rootpasswd’);
mysql> quit
# mysqld_multi stop 2

4)起動確認を行う
# mysqld_multi start
# mysqld_multi stop

■php関連の設定方法
phpアプリのconfig.phpでの設定例
‘hostspec’ => ‘localhost:13306′,
 標準socketでない場合には
‘hostspec’ => ‘localhost:/var/lib/mysql2/mysql.sock2′,

デフォルトはバックアップ等も考慮してclients他3306で運用が望ましい

■起動scriptを設置する
起動用に /etc/init.d/に以下のscriptを配置

# vi /etc/init.d/mysqld_multi
—ここから
# cat /etc/init.d/mysqld_multi
#!/bin/sh
# Mysql daemon start/stop script.
#
# Usually this is put in /etc/init.d (at least on machines SYSV R4
# based systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/S01mysql.
# When this is done the mysql server will be started when the machine is started
# and shut down when the systems goes down.
# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description: A very fast and reliable SQL database engine.
# The following variables are only set for letting mysql.server find things
# if you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf or other configuration files
MYSQLDIR=/usr
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:$MYSQLDIR/bin
export PATH
# See how we were called.
case “$1″ in
start)
echo -n “Starting mysqld: “
$MYSQLDIR/bin/mysqld_multi start 1,2
echo
;;
stop)
echo -n “Shutting down mysqld: “
$MYSQLDIR/bin/mysqld_multi stop 1,2
echo
;;
status)
$MYSQLDIR/bin/mysqld_multi report 1,2
;;
restart)
$0 stop
$0 start
;;
*)
echo “Usage: $0 {start|stop|restart|status}”
exit 1
esac
exit 0
–ここまで

作成したら実行権限を与える
# chmod +x /etc/init.d/mysqld_multi

実行可能か動作確認をする
# service mysqld_multi start
# service mysqld_multi stop

■自動起動時の設定を追加
元々のmysqldはオフに、mysqld_multiをオンに
mysqld_multi はリストにないので追加する

# chkconfig mysqld off
# chkconfig –add mysqld_multi
# chkconfig mysqld_multi on

#ntsysv で確認

,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■Scientific Linux 5.7 + Core i5 でlm_sensorsを有効にしたメモ
 Core i5でlm_sensorsを有効にできたのでメモ。おそらくCore i7も同様の手順でCPUの温度チェックが可能と思われる。

SL標準のlm_sensorsをインストール
# yum install lm_sensors

coretempのカーネルモジュールをinstall
# rpm -ivh http://www.pperry.f2s.com/linux/coretemp/kmod-coretemp-1.1-2.el5.x86_64.rpm
# modprobe coretemp

ロードされているか確認
# lsmod | grep coretemp

最新のsensors-detectを使用する
# wget http://dl.lm-sensors.org/lm-sensors/files/sensors-detect
# chmod 755 sensors-detect
# ./sensors-detect (ほとんどYESにしておけばOK)

新しい設定が書き込まれたら動作確認する
# sensors

,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (1 投票, 平均値/最大値: 5.00 / 5)
Loading...

■Scientific Linux 5.6から5.7へのアップグレードメモ
 Scientific Linux 5.7がリリースになったので5.6からアップグレードした作業メモ。

■作業手順
一旦最新状態にアップデート
# yum update

repoデータを56から57に変更する(jaistを使用)
# vi /etc/yum.repos.d/sl.repo
# vi /etc/yum.repos.d/sl-security.repo
# vi /etc/yum.repos.d/sl-fastbugs.repo

baseurl=http://ftp.jaist.ac.jp/pub/Linux/scientific/56/$…
 ↓
baseurl=http://ftp.jaist.ac.jp/pub/Linux/scientific/57/$…

アップデート手順
# yum clean all
# yum update yum
# yum update glibc
# yum update

確認
# cat /etc/issue
Scientific Linux SL release 5.7 (Boron)
Kernel \r on an \m

以下の設定で構築されたimagemagickやらmysqlやらphpやらが入れ替わった状態だが、特に問題なくアップデート完了。

 D520にScientific Linux 5.6をインストールしたメモ
 http://blog.isnext.net/issy/archives/1281

 Scientific Linux 5.6でSNSサーバを構築するメモ
 http://blog.isnext.net/issy/archives/1289

 Scientific Linux 5.6にphp5.2.xを導入するメモ
 http://blog.isnext.net/issy/archives/1299

, ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■Scientific Linux 5.6でrootkitチェック
 Scientific Linux 5.6でrootkitチェックを行った時のメモ。当然ながらインターネットからアクセスできる状態にする前にやっておくこと。Scientific Linuxではepelのリポジトリを使ってchkrootkitとrkhunterが利用可能なのでそれらを利用する。通常はyum-conf-epel-5-1をインストールすることでepelが利用可能。現環境ではphp等の関係でIUS Community Projectを利用しており、epelが導入されているのでそのまま利用可能だった。CentOSも同様の手順で利用可能。どちらも古くからあるツールだがepelに含まれることで使いやすくなっているのがありがたい。

■chrootkit
インストール
 # yum install chrootkit
チェック
 # chrootkit (フル出力)
 # chrootkit -q(問題のみ出力)

chkrootkitはアラートが出た場合それを無視する設定をしないことを推奨している模様。以前はignoreする設定方法があったと思うのだが、今回探してみたが見つけられなかった。

■rkhunter
インストール
 # yum install rkhunter
チェック
 # rkhunter —update(アップデート)
 # rkhunter -c –createlogfile
 一度実行して出力確認する
 標準以外のリポジトリ使用時はアラートが出る可能性があるので
 内容を確認して”Checking for prerequisites”でWarningが出るようなら
 以下を実行する
 # rkhunter –propupd
 再度チェックを実行してアラートが消えることを確認する
 # rkhunter -c –createlogfile

rkhunterは自動でcron.dairyに組み込まれるが、chkrootkitは組み込まれないので必要に応じてcron用ファイルを作成する。

, ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■Scientific Linux 5.6にphp5.2.xを導入するメモ
 Scientific Linux 5.6に標準導入されるのはCentOS5.6同様にphp5.1.6になるため、最新のWordPress3.2.xが動作できない。そこで5.2.x系の最新版を導入する(カスタマイズしたSNSアプリがphp5.3対応未完のため)。導入するリポジトリはIUS Community Projectのもの。同ProjectはPHP,Python,MySQLの最新版をRH系ディストリビューション向けに提供することを目的としている。いずれ5.3系にする場合にもメリットがあると思われるので導入することにした。

■IUSリポジトリの導入
 epelのリポジトリを同時にインストールする必要があるのでSLの設定で利用したyum-conf-epel-5-1を削除してから、IUSリポジトリをインストールする。詳細な説明は本家のガイドを参照。
[code]
# yum remove yum-conf-epel-5-1
# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-8.ius.el5.noarch.rpm
# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -Uvh ius-release*.rpm epel-release*.rpm
# yum update
[/code]
■phpの入替え
 yumのreplaceプラグインを利用して一気に入替えを行う。epelからphp-eacceleratorを導入している場合、依存性欠如で削除されてしまうため注意が必要。
[code]
# yum install yum-plugin-replace
# yum replace php –replace-with php52
[/code]
■eAcceleratorをインストールする
 sourceforge.netから最新のeaccelerator-0.9.6.1.tar.bz2をダウンロードしておく。インストール手順の詳細はこちら

事前準備
# yum install php52-devel gcc

コンパイルインストール
[code]
# tar jxvf eaccelerator-0.9.6.1.tar.bz2
# cd eaccelerator-0.9.6.1
# phpize
# ./configure
# make
# make install
[/code]
設定ファイル作成
[code]
# vi /etc/php.d/eaccelerator.ini
 extension=”eaccelerator.so”
 ;zend_extension=”/usr/lib/php/modules/eaccelerator.so”
 eaccelerator.shm_size=”128″
 eaccelerator.cache_dir = “/var/cache/php-eaccelerator”
 eaccelerator.enable=”1″
 eaccelerator.optimizer=”1″
 eaccelerator.check_mtime=”1″
 eaccelerator.debug=”0″
 eaccelerator.log_file = “/var/log/httpd/eaccelerator_log”
 eaccelerator.name_space = “”
 eaccelerator.filter=””
 eaccelerator.shm_max=”0″
 eaccelerator.shm_ttl=”3600″
 eaccelerator.shm_prune_period=”0″
 eaccelerator.shm_only=”0″
 eaccelerator.compress=”1″
 eaccelerator.compress_level=”9″
 eaccelerator.keys = “shm_and_disk”
 eaccelerator.sessions = “shm_and_disk”
 eaccelerator.content = “shm_and_disk”
 ;eaccelerator.allowed_admin_path = “”
[/code]
キャッシュディレクトリ作成
[code]
# mkdir /var/cache/php-eaccelerator
# chmod 0777 /var/cache/php-eaccelerator
[/code]
apache再起動
# apachectl graceful

phpinfoで有効になっていることを確認する

, , , ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■Scientific Linux 5.6でSNSサーバを構築するメモ
 CentOS5系で運用中のSNSサーバをScientific Linux5系に移行するため、試験環境としてDell D520にインストールを行った時のメモ。ここからはSNS等アプリケーション導入前までの構築メモ。OS自体は前記事を参照。

 D520にScientific Linux 5.6をインストールしたメモ
 http://blog.isnext.net/issy/archives/1281

■高機能メールサーバCommuniGate Proをインストール
 phpアプリで必要なケースが多いのでpostfixを活かしたままCGPを有効にする
・postfix側の設定変更
 # vi /etc/postfix/master.cf
  smtp inet n – n – – smtpd
   ↓
  #smtp inet n – n – – smtpd
 # vi /etc/postfix/main.cf
  mydestination = $myhostname, localhost.$mydomain, localhost
   ↓
  mydestination = localhost
  追記
  relayhost = 自IPアドレス
  myhostname = po.ホストネーム セルフループ回避呪文
・postfixを再起動
 # service postfix restart
・postfixがsmtpをLISTENしてないことを確認
 # lsof -i

・CommuniGate Proの最新版をインストール
 (商用だがCommunityライセンス下で5ユーザまで無料で利用可能)
 # wget http://www.communigate.com/pub/CommuniGatePro/CGatePro-Linux.x86_64.rpm
 # rpm -ivh CGatePro-Linux.x86_64.rpm
 # service CommuniGate start
・CGPの管理画面にアクセスするためにiptableでポート追加
 # vi /etc/sysconfig/iptables
  -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 8010 -j ACCEPT 追記
 # service iptables restart
・ブラウザでhttp://サーバIPアドレス:8010/へアクセスして設定
 postmasterのパスワード設定
 Basic認証が表示されるのでID:postmasterと設定したパスワードでログイン
  japanese japanese(ISO) (+0900)japan/Korea expert で設定

■日本語全文検索対応mysql/Tritonnインストール
・標準導入のMySQLを削除する
 # yum remove mysql
・perl-DBIのインストールを確認(あればOK)
 # rpm -qa | grep -i perl-DBI
・最新のtritonnパッケージ群をダウンロード
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/MySQL-client-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/MySQL-devel-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/MySQL-server-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/MySQL-shared-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/mecab-0.98-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/mecab-ipadic-2.7.0.20070801-tritonn.1.0.12a.x86_64.rpm
 # wget http://iij.dl.sourceforge.jp/tritonn/44614/senna-1.1.4-tritonn.1.0.12a.x86_64.rpm
・以下の順番でインストール
 # rpm -ivh mecab-0.98-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh mecab-ipadic-2.7.0.20070801-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh senna-1.1.4-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh MySQL-shared-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh MySQL-client-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh MySQL-server-5.0.87-tritonn.1.0.12a.x86_64.rpm
 # rpm -ivh MySQL-devel-5.0.87-tritonn.1.0.12a.x86_64.rpm
・MySQLのパスワード設定を行う
 # /usr/bin/mysqladmin -u root password ‘rootpassword’
・ログインして動作確認
 # mysql -u root -p
・設定ファイルを適当に選んで配置する
 # cp /usr/share/mysql/my-large.cnf /etc/my.cnf
・utf8で使いたい場合には以下の行を各項目で追記
 # vi /etc/my.cnf
  [mysqld]
  default-character-set = utf8
  [mysqldump]
  default-character-set = utf8
  [mysql]
  default-character-set = utf8
・設定を反映させる(mysqldでないことに注意)
 # service mysql restart
・設定変更を確認
 # mysql -u root -p
  mysql> status
  …
  Server characterset: utf8
  Db characterset: utf8
  Client characterset: utf8
  Conn. characterset: utf8
  …

■MyNETS(SNSサーバアプリ)の導入準備をする
・MyNETSに必要なコンポーネントをインストール
 # yum install php-mcrypt php-mbstring php-gd php-mysql php-xmlrpc php-xml php-eaccelerator ImageMagick
・ImageMagickの強制アップデートをする
 SL5.6のImageMagickにもCentOSと同じ問題があるので最新版で入替えする
 # wget http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.7.1-3.x86_64.rpm
 # rpm -Uvh –force ImageMagick-6.7.1-3.x86_64.rpm

■監視系に必要なアプリを導入する
・sysstatをインストール
 # yum install sysstat
・lm_sensorsをインストール
 # yum install lm_sensors
 # sensors-detect で設定
 # sensors で動作確認
・muninをインストール
 # yum install munin munin-node
 # munin-node-configure で設定確認
・apacheの監視を有効にする
 # vi /etc/httpd/conf/httpd.conf
  #ExtendedStatus On
   ↓
  ExtendedStatus On

  #<Location /server-status>
  # SetHandler server-status
  # Order deny,allow
  # Deny from all
  # Allow from .example.com
  #</Location>
   ↓
  <Location /server-status>
   SetHandler server-status
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
  </Location>
・muninを再設定する
 # munin-node-configure -suggest で設定可能な内容を確認
 # munin-node-configure -shell | sh で設定
 # munin-node-configure 設定を確認
 # service munin-node start 監視を開始

※MySQLに関するmunin監視設定は以下を参照

 muninで複数mysqldを監視する設定メモ
 http://blog.isnext.net/issy/archives/957

■SNSアプリケーションの導入
 以下のURLの「8)SNSサーバとしての設定」を参照

 カスタム版MyNETSとCentOS5で1万人規模のSNSを構築する
 http://blog.isnext.net/issy/archives/384

, , , , , ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...

■D520にScientific Linux 5.6をインストールしたメモ
 CentOS5系からScientific Linux5系に移行するため、Dell D520にインストールを行った時のメモ。D520には4Gの物理メモリが搭載可能だがファームウェアの制限で4Gフルに利用することができない。ファームウェアがA04だったため最新のA08に入れ替えても同様だった(ファームウェアアップデートにはWindows OSが必要になるので注意)。ファームウェアで認識してくれないため、x86_64版のScientific Linuxをインストールしても最大メモリは約3.3Gとなる。HDDは日立製HTS723232A7A364。とても静かでシーク音もほとんど聴こえないくらい。D520のアイドル時の消費電力は18-32W程度。平均して26Wくらいか。ある程度稼働している状況で55Wくらい。

■ファームウェアの設定
 F2キーで設定画面。シリアル・パラレル・1394・PCカードなど使わないオンボードデバイスは全てオフ。サーバとして利用するのでディスプレイの輝度も最小に設定。HDDはperformance設定。

■インストール設定覚書
・パーテーション
 /boot 101M
 / 299872M
 swap 5248M
・ネットワーク
 IPv4は固定設定
 IPv6はDisableに
・インストールコンフィグ
 Serverのみチェック 
 今すぐカスタマイズ
・カスタマイズ内容
 SL Addon
  以下の2つをチェック
  FUSE
  Yum Utility
   yum-conf-epel yum-fastestmirrorのみチェック
 アプリケーション
  エディタとテキストベースのインターネットのみ
 サーバ
  以下の3つだけにして更に一部修正する
  MySQLデータベース mysql-python外す
  Webサーバ httpd-manual mod-perl mod-python php-ldap squid tux webalizer外す
        php-mysql付ける
  メールサーバ postfixとcyrus-sasl sendmailのみ
 ベースシステム
  java ダイアルアップネットワークサポートの2つ外す
・Firewall Configration
 SELinuxをDisable
 カスタマイズで HTTP/HTTPS/SMTPを追加
・System Services
 以下のものだけチェック
  cpuspeed
  crond
  dnsmasq
  httpd
  iptables
  irqbalance
  microcode_ctl
  network
  sendmail(最初はpostfixリストされない)
  smartd
  readahead_early
  sshd
  syslog
・再起動しておく

■再起動後基本設定
・まずはアップデート
 # yum update
・sshdとiptablesの設定変更
 # vi /etc/ssh/sshd_config
  #Port 22 を Port 10022 に変更
 # vi /etc/sysconfig/iptables
  -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 10022 -j ACCEPT 追加
 # service sshd restart
 # service iptables restart
・sendmailからpostfixに変更
 # yum remove sendmail
 # ntsysv でpostfixにチェックがついているか確認

■パフォーマンス設定
・noatime設定の追加
 # vi /etc/fstab
  LABEL=/ / ext3 defaults,noatime 1 1 noatimeを追記
 # mount -o remount / で再マウント
 # mount でnoatimeが有効になっているか確認
  /dev/sda on / type ext3 (rw,noatime)
・I/Oスケジューラを変更
 # vi /etc/rc.d/rc.local
  echo deadline> /sys/block/sda/queue/scheduler 追記
 # cat /sys/block/sda/queue/scheduler で確認
  noop anticipatory [deadline] cfq
・利用可能な内部通信socketを増やす
 # vi /etc/rc.d/rc.local
  echo 16384 65535 > /proc/sys/net/ipv4/ip_local_port_range 追記
 # cat /proc/sys/net/ipv4/ip_local_port_range で確認
  16384 65535
・プロセススワップを抑制
 # vi /etc/sysctl.conf
  vm.swappiness = 0 追記
・1プロセスが同時に開けるファイル数を増やす
 # vi /etc/security/limits.conf
  root soft nofile 25600
  root hard nofile 25600
  mysql soft nofile 12800
  mysql hard nofile 12800
  apache soft nofile 12800
  apache hard nofile 12800 追記
・再起動して設定が有効なことを確認

ここからはSNS用サーバ設定を追加していく予定。
長文になるため別記事にする。

, ,
とりあえず付けておく無駄ではなかったなまぁまぁ読めたちょっと役に立ったかなかなり良かったかも (まだ評価されていません)
Loading...