2017-01-01から1年間の記事一覧

Linux OpenVPN 高速化チューニング

OpenVPNで通信速度に影響する下記設定について検証。 ・udp or tcp ・comp-lzo の有無 ・tcp-nodelay の有無(tcpのみ) ・mssfix、fragment のチューニング mssfix … カプセル化されるTCPパケットのサイズ制限(デフォルト値:1450) fragment UDPで接続す…

CentOS7 WAF(ModSecurity)のインストール

・apacheのインストール # yum install httpd ・ModSecurityのインストール # yum install mod_security mod_security_crs ・設定 # cp -p /etc/httpd/conf.d/mod_security.conf /etc/httpd/conf.d/mod_security.conf.org # vi /etc/httpd/conf.d/mod_securi…

KVM VMの自動起動/自動シャットダウン設定

・ホスト側の設定 # vi /etc/sysconfig/libvirt-guests START_DELAY=30 ON_SHUTDOWN=shutdown SHUTDOWN_TIMEOUT=180 # virsh autostart 自動起動したいVM名> # ls /etc/libvirt/qemu/autostart 解除する場合は下記 # virsh autostart --disable 自動起動した…

KVM libvirt で cdrom をマウントする

# virus edit vm_name <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/mnt/storage-1/application_installer/ISO/virtio-win-0.1.139.iso'/> </source></driver></disk>

CentOS7 VAAPIでHWエンコード

・リポジトリの追加 # yum -y install yum-utils epel-release # yum-config-manager --disable epel-release # yum-config-manager --add-repo=http://negativo17.org/repos/epel-multimedia.repo # yum-config-manager --disable epel-multimedia ・インス…

CentOS7 HandBrakeを野良リポジトリからインストールする

・リポジトリの追加 # yum -y install yum-utils epel-release # yum-config-manager --disable epel-release # yum-config-manager --add-repo=http://negativo17.org/repos/epel-multimedia.repo # yum-config-manager --disable epel-multimedia ・インス…

CentOS7 KVMでNVIDIAのGPUをWindowsにパススルーする

WindowsのNVIDIAドライバはOSがKVMハイパーバイザー環境で動作していることを検知すると error 43 で動作停止するという仕様のため、回避するために以下の対策が必要。 1. libvirt のドメイン設定でハイパーバイザーのベンダーIDを偽装する 2. libvirt のド…

CentOS7 KVM virt-installで仮想マシンをインストールする一例

・仮想ディスク作成 # qemu-img create -f qcow2 /usr/local/var/lib/libvirt/images/vm1.qcow2 8G ・virt-install # virt-install \ --connect qemu:///system \ --boot uefi \ ← UEFIモードでインストールしたい場合は指定する。OVMFの事前設定が必要。 --…

CentOS7 KVM ksmdを停止する

ksm は複数のVMが持っている同一メモリーページを集約してメモリー使用量を減らすことができる。 ただしCPUリソースをそれなりに食うのと、十分なメモリーがあればあまり恩恵がないので、不要であれば無効化する。 # systemctl stop ksmtuned # systemctl di…

CentOS7 KVMをネストする

・状態確認 # cat /sys/module/kvm_intel/parameters/nested N ※無効化されている ・有効化 # vi /etc/modprobe.d/kvm-nested.conf options kvm_intel nested=1 # modprobe -r kvm_intel # modprobe kvm_intel ※仮想マシンはすべて停止しておくこと # cat /s…

CentOS7 最新の安定板カーネルへの更新方法

・最新カーネルをyumで追加できるようにする # rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org # rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm ・通常時は epel を無効化する # yum -y install yum-utils # yu…

CentOS7 KVM 最新のQEMUとlibvirtをインストールする

どちらも yum でインストールできるが、 2017/6時点で古いバージョンがインストールされる。 最新のものを使いたい場合は手動でインストールする。・インストール済みの QEMU、libvirt のアンインストール # yum -y remove qemu-kvm libvirt virt-manager ・…

Zabbix で smartctl の値を監視する

・エージェント側の smartctl で値を取得できることを確認 # smartctl -A /dev/sda | grep Temperature | awk '{print $10}' # smartctl -A /dev/sda | grep Offline_Uncorrectable | awk '{print $10}' # smartctl -A /dev/sda | grep Reallocated_Sector_C…

CentOS7 smartctlの見方と不良セクタの修復方法

・smartの見方 # smartctl -A /dev/sda ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 173 3 Spin_Up_Time 0x0027 227 180 021 Pre-fail Always - 3641 4 St…