LVSの Hash Table Sizeを大きくします。
OSは、CentOS7です。 kernelを再構築する必要があります。
# yum groupinstall -y "development tools" # yum install xmlto asciidoc hmaccalc python-devel newt-devel perl-ExtUtils-Embed pesign elfutils-devel zlib-devel binutils-devel audit-libs-devel numactl-devel pciutils-devel ncurses-devel
kernelのSRPMをダウンロードします。
yumdownloader --source kernel
SRPMを展開します。
# yum install kernel-3.10.0-327.13.1.el7.src.rpm
RedHatのkernelパッケージには必要です。
# yum install rng-tools # rngd -r /dev/urandom
RPMパッケージ名を変更しておきます。
sed -i -e 's/^# % define buildid .local/%define buildid .local/' /root/rpmbuild/SPECS/kernel.spec
Hash Table Sizeを12 -> 20に変更します。
sed -i -e 's/^CONFIG_IP_VS_TAB_BITS=12/CONFIG_IP_VS_TAB_BITS=20' /root/rpmbuild/SOURCES/kernel-3.10.0-x86_64.config
kernelのrpmを作ります。
rpmbuild -ba --target=$(uname -m) --with baseonly --without debug --without debuginfo kernel.spec
確認しておきます。サイズ大きくなりました。
[root@server ~]# ipvsadm -Ln IP Virtual Server version 1.2.1 (size=1048576) Prot LocalAddress:Port Scheduler Flags -> RemoteAddress:Port Forward Weight ActiveConn InActConn TCP 210.152.0.52:80 wlc persistent 60 -> 10.21.0.4:80 Route 0 0 0 -> 10.21.0.7:80 Route 0 0 0 -> 10.21.0.31:80 Route 0 0 0 -> 10.21.0.97:80 Route 0 0 0 -> 10.21.0.120:80 Route 0 0 0 -> 10.21.0.151:80 Route 0 0 0 -> 10.21.0.172:80 Route 0 0 0 -> 10.21.0.226:80 Route 0 0 0 [root@server ~]#
keepalivedの1.1.20と1.2.2はvrrpが通らないんだね
CVE-2015-7547の対応で1台目のlibc6をupgradeしたら/var/log/messagesにエラーがで始めた。
Keepalived_vrrp: VRRP_Instance(image1:192.168.201.1) ignoring received advertisment... Keepalived_vrrp: receive an invalid passwd! Keepalived_vrrp: bogus VRRP packet received on bond0 !!!
keepalivedの設定は変更してないしと思ってググったらイカがヒット
パスワードを短くしてkeepalivedを再起動したら今度はイカのようなエラーが。。
Keepalived_vrrp: VRRP_Instance(image1:192.168.201.1) ignoring received advertisment... Keepalived_vrrp: receive a 0 auth, expecting 1! Keepalived_vrrp: bogus VRRP packet received on bond0 !!!
結局、バージョンを合わせて直りました。
packerで複数NICなqemuイメージを作成する
packerで複数NICなqmuイメージをkickstartで作成するのに苦労したのでメモ
これが参考になった stackoverflow.com
qemuargsでmac addressを指定してるのは出来たイメージをkvmにインポートする時にブリッジを指定したかったから。
"qemuargs": [ [ "-serial", "file:serial.out" ], [ "-netdev", "user,id=net0,hostfwd=tcp::2222-:22,hostfwd=tcp::2223-:22,net=10.0.2.0/24" ], [ "-device", "virtio-net,netdev=net0,mac=52:54:00:12:34:56" ], [ "-netdev", "user,id=net1" ], [ "-device", "virtio-net-pci,netdev=net1,mac=52:54:01:12:34:56" ] ], "boot_command": [ "<tab>", " append console=ttyS0,115200n8 ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg ksdevice=eth0", "<enter>" ]
eth0はprovisionersのshellで設定。 eth1はkickstartで設定した。
kvmへのインポートはこんな感じで。
virt-install --memory 2048 --name test --disk /var/lib/libvirt/qemu/test --network bridge:br0 --mac=52:54:00:12:34:56 --network bridge:br1 --mac=52:54:01:12:34:56 --import
ATSメモ
The server must support at least Transport Layer Security (TLS) protocol version 1.2. TLS1.2が必要 https://developer.apple.com/library/prerelease/ios/technotes/App-Transport-Security-Technote/index.html
openssl 0.9.8はTLS1.2 , TLS1.1をサポートしてない。 https://www.suse.com/communities/conversations/tls-1-2/
CentOS 7なsystemd環境でautologinする
KVMでauto loginできたらと調べて上手くできたのでメモ
cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service diff -Nurr /usr/lib/systemd/system/getty\@.service getty\@ttyS0.service --- /usr/lib/systemd/system/getty@.service 2014-10-23 20:29:59.000000000 +0900 +++ getty@ttyS0.service 2014-12-01 14:39:07.338000000 +0900 @@ -25,7 +25,7 @@ [Service] # the VT is cleared by TTYVTDisallocate -ExecStart=-/sbin/agetty --noclear %I +ExecStart=-/sbin/agetty --autologin root --noclear %I Type=idle Restart=always RestartSec=0 @@ -44,3 +44,4 @@ [Install] WantedBy=getty.target +;Alias=getty@ttyS0.service これだけだとうまく動かないので追加 [https://wiki.archlinux.org/index.php/automatic_login_to_virtual_console:title] 後で調べる。
nginxをwildcard SSLを使ってSSLアクセラレータとして設定した時のメモ
同じドメインなのにSSLを使うとIPも必要だし何かいい方法ないかと考えた時に思いついた。 default.confをこんな感じで設定したらIPを消費しないで済んだし良かった。 upstream は別ファイルで管理した。
ssl_certificate /etc/pki/tls/certs/wildcard.example.com.crt; ssl_certificate_key /etc/pki/tls/private/wildcard.example.com.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers RC4:HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; proxy_next_upstream error timeout; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Port $remote_port; port_in_redirect off; add_header Front-End-Https on; server { listen 80; listen 443 ssl spdy; server_name aaa.example.com; location / { proxy_pass http://aaa; } } server { listen 80; listen 443 ssl spdy; server_name bbb.example.com; location / { proxy_pass http://bbb; } } server { listen 80; listen 443 ssl spdy; server_name ccc.example.com; location / { proxy_pass http://ccc; } } server { listen 80; listen 443 ssl spdy; server_name ddd.example.com; location / { proxy_pass http://ddd; } }