調査1.NFS Client側で統計情報取得
# nfsstat -c
Client rpc stats:
calls retrans authrefrsh
259 0 265
Client nfs v3:
null getattr setattr lookup access readlink
0 0% 118 46% 5 1% 5 1% 101 39% 0 0%
read write create mkdir symlink mknod
0 0% 0 0% 4 1% 2 0% 0 0% 0 0%
remove rmdir rename link readdir readdirplus
0 0% 0 0% 0 0% 0 0% 0 0% 4 1%
fsstat fsinfo pathconf commit
0 0% 10 3% 5 1% 0 0%
アクセス種別に応じた回数や比率が出力される。
調査2.NFS Client側でtcpdump
# tcpdump host [nfs server ip]
# rpcdebug -m nfs -s vfs
# tail -f /var/log/messages
(NFS Client)# touch test
Jun 17 16:07:34 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:07:34 localhost kernel: NFS: permission(0:14/981489865), mask=0x1, res=0
Jun 17 16:07:34 localhost kernel: NFS: permission(0:14/981489865), mask=0x3, res=0
Jun 17 16:07:34 localhost kernel: NFS: create(0:14/981489865), test ※touch test(create)
Jun 17 16:07:34 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x1feff)
Jun 17 16:07:34 localhost kernel: NFS: nfs_fhget(0:14/1409289744 ct=1)
Jun 17 16:07:34 localhost kernel: NFS: permission(0:14/1409289744), mask=0x0, res=0
Jun 17 16:07:34 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x1feff)
Jun 17 16:07:34 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x7e7f)
Jun 17 16:07:34 localhost kernel: NFS: dentry_delete(/test, 8)
(NFS Client)# touch test
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:08:38 localhost kernel: NFS: permission(0:14/981489865), mask=0x1, res=0
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:08:38 localhost kernel: NFS: permission(0:14/981489865), mask=0x1, res=0
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x7e7f) ※touch test(modify)
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x7e7f)
Jun 17 16:08:38 localhost kernel: NFS: permission(0:14/1409289744), mask=0x22, res=0
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x1feff)
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x7e7f)
Jun 17 16:08:38 localhost kernel: NFS: dentry_delete(/test, 8)
(NFS Client)# rm test
Jun 17 16:11:10 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:11:10 localhost kernel: NFS: permission(0:14/981489865), mask=0x1, res=0
Jun 17 16:11:10 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:11:10 localhost kernel: NFS: permission(0:14/981489865), mask=0x1, res=0
Jun 17 16:11:10 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x7e7f)
Jun 17 16:11:10 localhost kernel: NFS: permission(0:14/981489865), mask=0x3, res=0
Jun 17 16:11:10 localhost kernel: NFS: unlink(0:14/981489865, test)
Jun 17 16:11:10 localhost kernel: NFS: safe_remove(/test) ※rm test
Jun 17 16:11:10 localhost kernel: NFS: nfs_update_inode(0:14/981489865 ct=2 info=0x1feff)
Jun 17 16:11:10 localhost kernel: NFS: dentry_delete(/test, 18)
上記のようにログが残る。ちなみに
Jun 17 16:08:38 localhost kernel: NFS: nfs_update_inode(0:14/1409289744 ct=1 info=0x7e7f)
ここに記載されている1409289744 は、inode番号なので、# find -inum 1409289744
./test
と対象のファイル名を調べることができる。
調査4.NFS Serverのネットワークパケット取得(NetworkMonitor)
0 件のコメント:
コメントを投稿