tech_memo
systemd †
カーネル †
Docker †
RPM †
Link †
performance †
ISO置場 †
Locale設定 †
ビープ音抑制 †
PXEブート †
ファイルディスクリプタからのファイル復旧 †
RHEL サブスクリプション アクティベイト †
ブートローダ †
マルチブートの際のハードディスク番号 †
- grub-legacyの場合、grub.confに以下のように記述する
root (hd1,0) #2番目のディスクの1番目のパーティション
- なお、パーティション番号については、論理パーティションはカウントしない
/dev/sda1
/dev/sda2
/dev/sda3
/dev/sda4 # 論理パーティション
/dev/sda5 # 拡張パーティション1
/dev/sda6 # 拡張パーティション2
- 上記例で、拡張パーティション2を指定する場合は、下記のようになる
root (hd0,4) #1番目のディスクの5番目のパーティション(論理はスキップ)
ユーザリソース †
- ユーザのスレッド数が1024を超えるとコマンド実行時に、下記のエラーが出力される
fork: Resource temporarily unavailable
- これはulimit -u でuser process数を増やせば解決するが、1024を超えた状態でほかのユーザからsuしようとすると、ulimitを拡張していても、以下のエラーが出力される
su: cannot set user id: Resource temporarily unavailable
- suするときにはulimitおよび、/etc/security/limits.confとは別の設定ファイルでリソース上限が設定されている。以下のファイルをrootで編集すれば解決する
[root@testserver12 ~]# vim /etc/security/limits.d/90-nproc.conf
* soft nproc 1024 # ★ここを増やす
root soft nproc unlimited
Samba †
全ユーザ共通環境変数設定 †
- /etc/profile.dに、環境変数設定用のシェルを置いておくとよい。
- 例
Ansble †
CPU †
perfコマンド + Flamegraph †
HyperThreading? ON/OFFの確認方法 †
- CPUソケット数確認
cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
- ソケット当たりのCPUコア数確認
cat /proc/cpuinfo | grep "cpu cores" | uniq
- 論理CPUコア数確認
cat /proc/cpuinfo | grep "processor" | wc -l
- 上記結果
1 * 2 == 3であれば、HT=OFF
CPU Hotplug の変更 (動的にCPUの特定coreの有効化/無効化) †
ベンチマークページ †
LVS †
rsync †
FTP †
sudo †
- /etc/sudoersに以下のように追記(rootで、visudoコマンドで編集すること)
#ユーザ名 ホスト名=(実行ユーザ名) [パスワードなしで実行:]コマンド
testuser ALL=(ALL) NOPASSWD:ALL
- sudo <コマンド>で実行できる。aliasを切っておくと便利。
[testuser@testserver18]$ sudo pdsh -w "testserver[01-15]" echo | dshbak -c
failed to install module options for "misc/netgroup"
----------------
testserver[01-15]
----------------
sudoファイルを壊してsudoできなくなった場合 †
sudo: sorry, you must have a tty to run sudo の回避 †
syslog †
- 出力ファイル設定ファイル
/etc/syslog.conf
- RHEL6以降は
/etc/rsyslog.conf
- ローテーション設定ファイル
/etc/logrotate.conf
Segmentation faultが発生したときに、/var/log/messageへの出力を無効化する †
sar †
- 実行間隔の変更
- /etc/cron.d/sysstatでcron設定されている。デフォルトは10分間隔
- RHEL6.3ではデフォルトでDisk情報も出力されている。(iostatとちがって1回目の出力情報も正しいっぽい)
kSar †
yum †
Ctrl-Cを押すと^Cが標準出力される †
VNC †
Cobbler †
RHEL 6.X †
dstat †
other †
shell command †
Linux-HA †
- tech_memo/linux/Linux-HA?
/tmp配下のファイルが消える †
- /etc/cron.daily/tmpwatchスクリプトで定義されている。
カーソルキー操作 †
- ^A
- ^B
- ^E
- ^F
- ^H
- ^J
- RETURNと同じ(=Ctrl + O,Ctrl + M)
- ^K
- ^T
- ^U
- ^W
- ^XX
- ^Y
cron †
Memory †
実メモリ利用量 †
Memory転送量のモニタ(Intel CPU E5シリーズ限定) †
デバイスの性能情報 †
NUMA †
Performance †
- ベンチマークツール 「STERAM」
- 以下のように実行スレッド数を増やさないとある程度で頭打ちになるので本当の性能が取れないので注意
gcc -O3 -fopenmp -D_OPENMP stream.c -o stream
export OMP_NUM_THREADS=8
./stream
-------------------------------------------------------------
STREAM version $Revision: 5.9 $
-------------------------------------------------------------
This system uses 8 bytes per DOUBLE PRECISION word.
-------------------------------------------------------------
Array size = 2000000, Offset = 0
Total memory required = 45.8 MB.
Each test is run 10 times, but only
the *best* time for each is used.
-------------------------------------------------------------
Number of Threads requested = 8
-------------------------------------------------------------
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
Printing one line per active thread....
-------------------------------------------------------------
Your clock granularity/precision appears to be 1 microseconds.
Each test below will take on the order of 1912 microseconds.
(= 1912 clock ticks)
Increase the size of the arrays if this shows that
you are not getting at least 20 clock ticks per test.
-------------------------------------------------------------
WARNING -- The above is only a rough guideline.
For best results, please be sure you know the
precision of your system timer.
-------------------------------------------------------------
Function Rate (MB/s) Avg time Min time Max time
Copy: 11453.0018 0.0028 0.0028 0.0028
Scale: 10896.0649 0.0029 0.0029 0.0030
Add: 11518.8575 0.0042 0.0042 0.0042
Triad: 12006.5954 0.0040 0.0040 0.0040
-------------------------------------------------------------
Solution Validates
-------------------------------------------------------------
- スレッドの数が指定した回数になっていることを確認
- コンパイルオプションについて
Swap領域追加 †
Swap領域縮小 †
Swap領域解放 †
Arun流メモリ使用量確認方法 †
find /proc/ -maxdepth 1 -type d | xargs -i{} grep VmData {}/status 2>/dev/null | awk 'BEGIN{a=0}{a+=$2}END{print a;}'
Huge Page †
Mount †
fstabを無効化してもマウントされる †
- https://qiita.com/10yama/items/1ab36a638c6e5c11c136
Systemd で起動するLinuxで、起動ディスクのパーティーションテーブルが GPT で UEFI ブートする場合、/etc/fstab に書いてないものがマウントされることがあります。
具体的には、Swapと、/, /home, /srv について、UEFIブートした起動ディスクに存在し、特定パーティーションタイプ(GUID)を持つ形で設定されているパーティーションは、/etc/fstab に書いてなかったりコメントアウトされていても、自動的にマウント・Swapon されます
各パーティションごとにアクセスしているユーザプロセスの確認 †
mountしているUSBのdevファイル確認 †
- 現在mountされているUSBがどのdeviceファイルになるかは以下でわかる
[root@testserver18 ~]# cat /etc/mtab
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sda1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
dbserver:/share /share nfs rw,addr=192.168.22.1 0 0
/dev/sdb1 /media/usb ext3 rw 0 0
fuse /tmp/.truecrypt_aux_mnt1 fuse rw,nosuid,nodev,allow_other 0 0
/dev/loop0 /media/usb/UID_CIVILIANS_DATA/RAW_DATA_100K fuseblk rw,allow_other,blksize=4096,default_permissions 0 0
nfsd /proc/fs/nfsd nfsd rw 0 0
192.168.22.102:/media/disk-1 /media/disk-1 nfs rw,addr=192.168.22.102 0 0
- mountがされておらず、USB接続だけされている場合はdmessgコマンドや/var/log/messageから確認する。
automount †
Disk †
Network †
NTP †
NTP設定 †
NTPサーバと即座に時刻同期する方法 †
ntpdateを使う方法 †
- 1. NTP server停止(server)
service ntpd stop
- 2. 時刻同期(client)
ntpdate testserver18
- 3. NTPサーバ起動
service ntpd start
/etc/ntp/step-tickersを使う方法 †
デーモン †
Other †
プロセスとファイルディスクリプタ †
WindowsファイルをUnixファイルに変換 †
dos2unix FILE
最新の20件
2023-01-26
2022-11-11
2022-03-02
2022-02-03
2021-11-18
2021-11-11
2021-10-27
2021-10-04
2021-09-30
2021-08-24
2021-04-01
2021-02-25
2020-08-13
2020-05-22
2020-04-16
2020-04-15
2020-03-23
2020-03-12
2020-02-27
今日の8件
- counter: 1155
- today: 1
- yesterday: 1
- online: 1