<?xml version="1.0" encoding="EUC-JP"?>
<rss version="2.0">
<channel>
<title>Anne Linux・Windowsをがんばるのだ</title>
<link>http://linux.anne-chan.com/</link>
<description>Linux,Windowsなどのコンピューター系の情報サイト</description>
<language>ja</language>
<copyright>Copyright 2009</copyright>
<lastBuildDate>Mon, 05 Jan 2009 22:02:48 +0900</lastBuildDate>
<generator>http://www.movabletype.org/?v=3.151-ja</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 

<item>
<title>負荷分散、広域ストレージ利用向けのLinuxカーネルモジュールをオープンソースで公開</title>
<description><![CDATA[<p>株式会社ディープバレイ（本社：愛知県北名古屋市、代表取締役社長：深谷　悟美）は、ファイル操作をリアルタイムに把握のできるカーネルモジュール「ffsrvmod」を開発し、オープンソースとして公開しました。</p>

<p><a href="http://deepvalley.jp/archives/17/">http://deepvalley.jp/archives/17/</a><br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2009/01/linux.html</link>
<guid>http://linux.anne-chan.com/archives/2009/01/linux.html</guid>
<category>Linux</category>
<pubDate>Mon, 05 Jan 2009 22:02:48 +0900</pubDate>
</item>
<item>
<title>disk image file　</title>
<description><![CDATA[<p><br />
dd if=/dev/zero of=disk.img bs=1024k count=1 seek=5120<br />
こんなんで、５Gのファイルが出来上がります。</p>

<p>出来上がったファイルを<br />
mkfs -t ext3 -F disk.img<br />
こうすると、ext3でフォーマットされたファイルが出来上がります。</p>

<p>さらに<br />
mount -o loop disk.img /mnt<br />
こうすることで、/mntへ普通にアクセスできるようになります。</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/12/disk_image_file.html</link>
<guid>http://linux.anne-chan.com/archives/2008/12/disk_image_file.html</guid>
<category>Linux</category>
<pubDate>Thu, 25 Dec 2008 21:14:45 +0900</pubDate>
</item>
<item>
<title>ffsys ffsrvmod カーネルモジュール</title>
<description><![CDATA[<p><a href="http://lab.deepvalley.jp/">http://lab.deepvalley.jp/</a></p>

<p>ｆｆｓｙｓは、ffsrvmodを使ったシステム全体の総称です。</p>

<p>ｆｆｓｙｓの中心になるffsrvmodは、Linuxシステムコールのファイル操作に関するものだけをフックし、外部にメッセージを送信する カーネルモジュール（LKM） です。</p>

<p>カーネルモジュールとして動く ffsrvmod はシンプルであり、sys_open,sys_close,をはじめ,utime,rename…など、ファイル操作をメッセージ順にSocketへ流し込みます。ただそれだけです。<br />
（全てではありません。最終的にファイルが完成？ファイル操作が終了？した時点でメッセージが流れるようにしています。）</p>

<p>ffsrvmod は、コマンド、ファイルのフルパス、その他必要なオプション（アクセス権など）を流すだけで、ファイルのデータそのものは扱いません。（もしかしたらデータも扱うかもしれませんが、今のところ予定はありません。）</p>

<p>現在はデータを冗長させるサンプルプログラムしか付属していませんが、今後ffsrvmodを使った大容量ストレージ・負荷分散・データベースの高速化を紹介して行く予定です。<br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/12/ffsys_ffsrvmod.html</link>
<guid>http://linux.anne-chan.com/archives/2008/12/ffsys_ffsrvmod.html</guid>
<category>Linux</category>
<pubDate>Thu, 25 Dec 2008 17:29:36 +0900</pubDate>
</item>
<item>
<title>カーネルスレッド</title>
<description><![CDATA[<p>struct task_struct *kthread_create(int (*threadfn)(void *data), void *data, const char namefmt[], ...)<br />
引数１ スレッド関数を指定<br />
引数２ 渡す引数<br />
引数３ psで表示される名前</p>

<p><br />
static int test_thread(void * num)<br />
{<br />
　　//thread処理<br />
}</p>

<p>static int __init init_test(void){ //threadを生成する初期化モジュール<br />
　　struct task_struct *th;<br />
　　//省略</p>

<p>　　//thread生成<br />
　　th = kthread_create(test_thread, &num, "test_thread");<br />
　　if (IS_ERR(th)) {<br />
　　　　//失敗<br />
　　　　goto ERR_RET;<br />
　　}<br />
　　//threadスタート<br />
　　wake_up_process(th);<br />
}<br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/11/post_26.html</link>
<guid>http://linux.anne-chan.com/archives/2008/11/post_26.html</guid>
<category>Linux</category>
<pubDate>Fri, 28 Nov 2008 11:01:22 +0900</pubDate>
</item>
<item>
<title>イメージマジック imagemagick 変換できる画像の種類の一覧</title>
<description><![CDATA[<p><br />
convert -list format</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/11/_imagemagick.html</link>
<guid>http://linux.anne-chan.com/archives/2008/11/_imagemagick.html</guid>
<category>Linux</category>
<pubDate>Sat, 15 Nov 2008 15:55:47 +0900</pubDate>
</item>
<item>
<title>OPENできるファイルの数</title>
<description><![CDATA[<p>procファイルシステムの以下の項目を読むことで、fsに関する事がわかります。<br />
procファイルシステムにはこれ以外にもたくさんの情報があります。</p>

<p><br />
/proc/sys/fs/file-max<br />
ファイルハンドルの最大数</p>

<p><br />
/proc/sys/fs/file-nr<br />
file-nr 内の 3 つの値は、割り当てられたファイルハンドルの数、未使用のファイルハンドルの数、ファイルハンドルの最大数、を示しています。</p>

<p>割り当てられたファイルハンドルの数が最大数に近いが未使用のファイルハンドルの数が 0 よりもかなり大きいならば、ファイルハンドル使用のピークでそれだけ使ったということを示しており、最大数を増やす必要はありません。<br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/11/open.html</link>
<guid>http://linux.anne-chan.com/archives/2008/11/open.html</guid>
<category>Linux</category>
<pubDate>Fri, 07 Nov 2008 12:10:46 +0900</pubDate>
</item>
<item>
<title>rcp scp rsh などは</title>
<description><![CDATA[<p>192.168.10.10から接続したい場合、</p>

<p>接続先のサーバーで<br />
echo rsh >> /etc/securetty<br />
echo 192.168.10.10 root >> /root/.rhosts</p>

<p>yum install rsh*<br />
chkconfig rsh on<br />
/etc/init.d/xinetd restart</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/11/rcp_scp_rsh.html</link>
<guid>http://linux.anne-chan.com/archives/2008/11/rcp_scp_rsh.html</guid>
<category>Linux</category>
<pubDate>Wed, 05 Nov 2008 18:48:14 +0900</pubDate>
</item>
<item>
<title>MRTG で DISK I/O </title>
<description><![CDATA[DISK I/Oに関する情報は　/proc/stat　に入ってます。<br>
これを使うのが一番手軽な方法かと・・<br>
（ちなみに、カーネルによって/proc/statの場合と/proc/diskstatsの場合があります）<br>
<br>
<br>
ローカルマシンが対象ならばこんなかんじでスクリプトをまず作ります。<br>
<br>
<blockquote style="background-color:#000000; color:#00FF00; width:400px; padding-left:10px;">
<pre><code><XMP>
#!/usr/bin/perl
use FileHandle;
my $fh = FileHandle->new("cat /proc/stat|");
while(<$fh>){
        if(/^disk_io: \([^(]+\([0-9]+,[0-9]+,([0-9]+),[0-9]+,([0-9]+)\)/) {
                print "$1\n";
                print "$2\n\n\n";
        }
}
close($fh);
</XMP></code></pre>
</blockquote>
<br>
<br>
リモートが対象ならば<br>
<blockquote style="background-color:#000000; color:#00FF00; width:400px; padding-left:10px;">
<pre><code><XMP>
#!/usr/bin/perl
open(SSH,"ssh 192.168.1.6 cat /proc/diskstats |");
while(<SSH>){
        if(/hda [0-9]+ [0-9]+ ([0-9]+) [0-9]+ [0-9]+ [0-9]+ ([0-9]+)/) {
        print "$1\n";
        print "$2\n\n\n";
    }
}
close(SSH);
</XMP></pre></code>
</blockquote>
<br>
sshで接続してるので、<a href="http://linux.anne-chan.com/archives/2008/10/ssh.html">sshをパスワードなしで接続</a>ここの様にしておく。<br>
<br>
<br>
ちなみに上記はPerlで作成してありますが、何でもOKです。<br>
いっそのことシェルで作っちゃってもOKよ。（その場合、MTRG.CFGの中に直接記述できます。）<br>
<br>
<br>
上記Perlで数字が２行と改行２行の計４行出力されてればOK。<br>
<br>
MTRG.CFGはこんな感じで書きます<br>
<br>
<blockquote style="background-color:#000000; color:#00FF00; width:400px; padding-left:10px;">
<pre><code><XMP>
Target[diskio192.168.1.59]: `/etc/mrtg/diskio-1.59.pl`
MaxBytes[diskio192.168.1.59]: 200
Title[diskio192.168.1.59]: Disk I/O
PageTop[diskio192.168.1.59]: <H1>Disk I/O on 1.59</H1>
YLegend[diskio192.168.1.59]: Disk I/O
ShortLegend[diskio192.168.1.59]: blocks/s
LegendI[diskio192.168.1.59]:read
LegendO[diskio192.168.1.59]:write
</XMP></pre></code>
</blockquote>
<br>
<br>
<br>
/proc/diskstats に関する情報<br>
<br>
Field 1 -- # of reads issued <br>
Field 2 -- # of reads merged<br>
Field 3 -- # of sectors read <br>
Field 4 -- # of milliseconds spent reading <br>
Field 5 -- # of writes completed <br>
Field 6 -- # of writes merged <br>
Field 7 -- # of sectors written <br>
Field 8 -- # of milliseconds spent writing <br>
Field 9 -- # of I/Os currently in progress <br>
Field 10 -- # of milliseconds spent doing I/Os <br>
Field 11 -- weighted # of milliseconds spent doing I/Os <br>

]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/mrtg_disk_io_1.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/mrtg_disk_io_1.html</guid>
<category>Linux</category>
<pubDate>Sat, 04 Oct 2008 18:59:50 +0900</pubDate>
</item>
<item>
<title>swap領域を簡単に増やすには</title>
<description><![CDATA[<p>テスト環境なんかで適当に作った後、SWAPが足りなくてOutOfMemoryの連発なんてときは</p>

<blockquote style="background-color:#000000; color:#00FF00; width:400px; padding-left:10px;">
<pre><code><XMP>
dd if=/dev/zero of=swapfile bs=1024 count=1000000　（１Gです）
mkswap -v1 swapfile
swapon swapfile
</XMP></code></pre>
</blockquote>

<p>これでOK</p>

<p>あくまでも一時的な処置です・・</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/swap_1.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/swap_1.html</guid>
<category>Linux</category>
<pubDate>Sat, 04 Oct 2008 00:39:28 +0900</pubDate>
</item>
<item>
<title>Postgres create table</title>
<description><![CDATA[<p><br />
CREATE TABLE test2 as select * from test order by main_id desc , main2_id desc;</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/postgres_create.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/postgres_create.html</guid>
<category>Linux</category>
<pubDate>Fri, 03 Oct 2008 23:53:43 +0900</pubDate>
</item>
<item>
<title>Pgpool-2</title>
<description><![CDATA[<p>wget http://pgfoundry.org/frs/download.php/1843/pgpool-II-2.1.tar.gz<br />
./configure<br />
make<br />
make install</p>

<p>cp /usr/local/etc/pgpool.conf.sample /usr/local/etc/pgpool.conf<br />
cp /usr/local/etc/pcp.conf.sample /usr/local/etc/pcp.conf</p>

<p>vi /usr/local/etc/pcp.conf<br />
USERNAME:MD5PASS</p>

<p>pgpool-II-2.1.tar.gzを展開したディレクトリの中の/sqlフォルダ内に<br />
/usr/src/pgpool-II-2.1/sql/system_db.sql<br />
があるので、system_dbを作成しておく</p>

<p>こんな感じ<br />
createdb -U postgres -h localhost pgpool<br />
psql -U postgres -h localhost pgpool < system_db.sql</p>

<p><br />
PgpoolAdmin<br />
wget http://pgfoundry.org/frs/download.php/1716/pgpoolAdmin-2.1-beta1.tar.gz<br />
展開されたディレクトリをWEBアクセス可能な場所に移動</p>

<p>http://サーバー/PgpoolAdmin/install/checkDirectory.php</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/pgpool2.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/pgpool2.html</guid>
<category>Linux</category>
<pubDate>Fri, 03 Oct 2008 17:32:24 +0900</pubDate>
</item>
<item>
<title>EXT3 チューニング</title>
<description><![CDATA[<p>LABEL=/hoge /hoge ext3 rw,noatime,data=writeback 1 2<br />
tune2fs -o journal_data_writeback /dev/md2</p>

<p><br />
data=journal  <br />
ファイルデータとメタデータの両方を記録することでデータの整合性は一番高いモードですが、オーバーヘッドが非常に大きくなります。<br />
 <br />
data=ordered（標準）  <br />
このモードではメタデータのみが記録されます。ファイルデータを先に書き込むことでデータの内容は保証されます。<br />
 <br />
data=writeback  <br />
 データの整合性よりデータへのもっともはやいアクセスを提供するオプションです。ステムクラッシュ時には古いデータのままである可能性があります。整合性を取らなくてもいいような一次的なファイルを保存するだけのファイルシステムであればwritebackモードを使用することも有効な手段と考えられます。<br />
 </p>

<p><br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/ext3.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/ext3.html</guid>
<category>Linux</category>
<pubDate>Fri, 03 Oct 2008 17:26:58 +0900</pubDate>
</item>
<item>
<title>Postgres テーブルスペース</title>
<description><![CDATA[<p>テーブルスペースの一覧<br />
<blockquote style="background-color:#000000; color:#00FF00; width:350px; padding-left:10px;"><br />
\db+<br />
                 List of tablespaces<br />
    Name    |  Owner   | Location | Access privileges <br />
------------+----------+----------+-------------------<br />
 pg_default | postgres |          | <br />
 pg_global  | postgres |          | <br />
(2 rows)<br />
</blockquote></p>

<p>テーブルスペースとは、その名の通りテーブルの場所です。<br />
たとえば<br />
<blockquote style="background-color:#000000; color:#00FF00; width:350px; padding-left:10px;"><br />
CREATE TABLESPACE disk2 LOCATION '/disk2/pgdata';<br />
</blockquote><br />
のようなコマンドをたたくと<br />
<blockquote style="background-color:#000000; color:#00FF00; width:350px; padding-left:10px;"><br />
\db+<br />
                 List of tablespaces<br />
    Name    |  Owner   | Location | Access privileges <br />
------------+----------+----------+-------------------<br />
 disk2 　　 | postgres |          | <br />
 pg_default | postgres |          | <br />
 pg_global  | postgres |          | <br />
(3 rows)<br />
</blockquote></p>

<p>すでにあるテーブルを移動させたい時は<br />
<blockquote style="background-color:#000000; color:#00FF00; width:350px; padding-left:10px;"><br />
ALTER TABLE srctabl1 SET TABLESPACE disk1;<br />
</blockquote></p>

<p>この基本的な使い方は、高負荷時のDiskI/Oの分散です。<br />
負荷分散なので、同一Diskの別フォルダに作成しても意味ないので気をつけましょう。</p>

<p><br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/postgres.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/postgres.html</guid>
<category>Linux</category>
<pubDate>Fri, 03 Oct 2008 16:37:52 +0900</pubDate>
</item>
<item>
<title>SSH を パスワード なし で 接続したい</title>
<description><![CDATA[<p>接続元マシンでの作業<br />
ssh-keygen -t rsa　を実行すると、自分の秘密鍵・公開鍵が/root/.ssh/に生成させる<br />
いくつか質問がきますが（パスフレーズやファイルの生成場所）何も入力しない。<br />
id_rsa（秘密鍵）<br />
id_rsa.pub（公開鍵）<br />
cat /root/.ssh/id_rsa.pub</p>

<p><br />
接続先マシンでの作業<br />
vi /root/.ssh/authorized_keys<br />
この中に上記で作成された公開鍵の中身を記述しておく</p>

<p>cat ./.ssh/id_rsa.pub | ssh root@des_host名 "cat >> ./.ssh/authorized_keys"<br />
こんな感じのコマンドならば、すべて接続元のマシンで完了するよ。<br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/ssh.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/ssh.html</guid>
<category>Linux</category>
<pubDate>Fri, 03 Oct 2008 14:01:47 +0900</pubDate>
</item>
<item>
<title>windows 2000 server 自動ログイン</title>
<description><![CDATA[<p><br />
rundll32.exe %SystemRoot%\system32\netplwiz.dll,UsersRunDll<br />
</p>]]></description>
<link>http://linux.anne-chan.com/archives/2008/10/windows_2000_se.html</link>
<guid>http://linux.anne-chan.com/archives/2008/10/windows_2000_se.html</guid>
<category>Windows</category>
<pubDate>Thu, 02 Oct 2008 10:00:40 +0900</pubDate>
</item>


</channel>
</rss>