2012年10月31日水曜日

A10 ロードバランサを運用する前に覚えておきたいポイント


A10のAXシリーズを運用するうえで必要な最低限の知識をまとめておく。

※同様の機能を提供する機器としてはBIG-IPが有名だろう。


 コマンド
※enableモードへの移行は省略している

【機器情報】
● バージョン、その他機器情報の確認
# show version


【作業、障害時操作】
● ActiveかStandbyかの確認
# show ha

● Active/Standby切り替え
ActiveかStandbyかはプロンプトにも表示される。
コマンドはactive側で実施する。
# configure
(config)# ha force-self-standby

● Active/Standbyの切り戻し
切り戻しはStandby側で先の設定を無効にし、
(config)# no ha force-self-standby

切り替わった新active側で再度下のコマンドをを実施する。
(config)# ha force-self-standby

● リアルサーバの組み込み
# configure
(config)# slb server $リアルサーバ名
(config-real server)# enable

● リアルサーバの切り離し
# configure
(config)# slb server $リアルサーバ名
(config-real server)# disable

● コネクション数変更
# configure
(config)# slb server $リアルサーバ名
(config-real server)# conn-limit XXXX


【リソース】
●  各DataCPUコア毎に利用率を表示
# show cpu

●  メモリ利用率を表示
# show memory system


【トラフィック】
● バーチャルサーバ単位での負荷分散ステータスを表示
# show slb virtual-server
extended-stats キーを入れておかないと過去の統計(最大のトラフィックetc)は見れない

ヘルスチェックのステータス確認にはbindオプションをつけた方が分かりやすい
# show slb virtual-server bind

● サービスグループ単位での負荷分散ステータスを表示
# show slb service-group

● サーバ単位での負荷分散ステータスを表示
# show slb server

● サーバヘルスチェックステータス表示
# show health stat

● インターフェイスのステータスと各種カウンタの表示
# show statistics interface

● SLBセッションのサマリ表示
# show session brief

● パーシステンステーブルの表示
# show session persist src-ip / dst-ip

パーシステンステーブルを削除することもできる。
テーブルを初期化することでトラフィックの偏りなども均質にできる可能性がある。
# clear session persist src-ip / dst-ip

● Arpテーブル表示
# show arp

● MACテーブル表示
# show mac

● IP FIBテーブルを表示
# show ip fib

● IP Rougingテーブル(RIB)を表示
# show ip route

● L2/3 パケット処理のステータス表示
# show slb switch


【コンフィグ】
● コンフィグレーション確認
# show startup-config

# show running-config

● 保存
# write memory

● コンフィグレーション同期
active側で実施する。
(config)# ha sync all to-running-config

(config)# ha sync all to-startup-config


【デバッグ】
● AXのディスク上の保存されたシステムログの表示
# show log

● その時点のシステム、プロセス関連のステータス情報のスナップショットを出力
# show techsupport

● 本体温度、FAN、電源の状態を確認
# show environment

● ログ情報の保存
# backup log ftp://*.*.*.*/ax_backup.tgz
User name []? ****
Password []? ****
※アップロードを行うプルトコルはtftp, ftp, scp, rcp が可能

● パケットキャプチャ
モードを変更する。
# axdebug

キャプチャsするfilterを定義する(絞り込みたい)場合の設定
(axdebug)# filter 1
(axdebug-filter:1)# ip 1.2.3.4 /32

キャプチャするパケット数の定義
ax(axdebug)# count <0-65535>
※デフォルトは3000 パケットまで。0 で設定上の上限なし

キャプチャ時間の定義
(axdebug)# timeout <0-65535>
※分単位で設定。デフォルト5分。0 で設定上の上限なし

キャプチャの開始
(axdebug)# capture non-dispaly save <file name>

キャプチャの状態確認
(axdebug)# show axdebug status

キャプチャファイルの確認
(axdebug)#show axdebug file

キャプチャの停止
(axdebug)# no axdebug

キャプチャファイルのエクスポート
(axdebug)# export axdebug file_name ?
use-mgmt-port Use management port as source port
tftp: Remote file path of tftp: file system(Format: tftp://host/file)
ftp: Remote file path of ftp: file system(Format: ftp://[user@]host[:port]/file)
scp: Remote file path of scp: file system(Format: scp://[user@]host/file)
rcp: Remote file path of rcp: file system(Format: rcp://[user@]host/file)
※キャプチャファイルはpcap形式でZIP圧縮された状態でエクスポート

キャプチャファイルの削除
(axdebug)# delete <file_name>



 設定変更
【white, blackリストの更新】
接続元のIPアドレスを元に振り分けるサーバを
制御している場合もあるだろう。
そのIPリスト更新する手順を残しておく。

ここではslb template policy内で以下のように定義しているとする。

ip_list(名前はip_list_oldとする)であるのIPアドレス群を管理し、
接続元IPアドレスがそのリスト内でマッチしたら、
http_matchグループへ飛ばす。

slb template policy bwlist_http
   bw-list name ip_list_old
   bw-list id 1 service-group http_match
  (略)

このIPリストを以下のように更新する。
変更前:ip_list_old
変更前:ip_list_new


1. IPリストのインポート
事前に任意のサーバにIPリストは配置しておくこと。

IPリスト例
network x.x.x.0/24 1
network y.y.y.0/24 1
network z.z.z.0/24 1
※最後の数字はtemplateのpolicy内で指定したbw-listのidである。

# import bw-list ip-list_new scp://<ID>@<サーバアドレス>/<パス>/<リスト名>


2. IPリストの確認
# show bw-list
適用しているi-listが表示される

# show bw-list ip-list_new detail
※GUIでは仕様上、全行が表示されない為、CLIから確認すること


3. IPリストの更新
ip_list_newに入れ替える。
コマンド実行直後から新しいIPリストが適用される。
# conf terminal
(config)# slb template policy bwlist_http
bw-list name ip_list_new


4.不要なIPリストの削除
# conf terminal
(config)# no bw-list ip_list_old

実際は切り戻しのため最低1世代前は残し、2世代前のものを削除する、
などの方針のほうがよいだろう。


5.コンフィグ保存


6.コンフィグ同期
同期をとる前に2点注意がある。
・peer機器でも上記手順1(IPリストのインポート)を実施しておくこと
・また、IPリスト名は両機器で揃えておくこと



障害発生時TRAP内容
● trap内容
発報メッセージ OID

レベル CRITICAL
axSystemShutdown                .1.3.6.1.4.1.22610.2.4.3.12.2.1.2
axFan1Failure                   .1.3.6.1.4.1.22610.2.4.3.12.2.1.4
axFan2Failure                   .1.3.6.1.4.1.22610.2.4.3.12.2.1.5
axFan3Failure                   .1.3.6.1.4.1.22610.2.4.3.12.2.1.6
axUpperPowerSupplyFailure       .1.3.6.1.4.1.22610.2.4.3.12.2.1.9
axLowerPowerSupplyFailure       .1.3.6.1.4.1.22610.2.4.3.12.2.1.10
axPrimaryHardDiskFailure        .1.3.6.1.4.1.22610.2.4.3.12.2.1.11
axSecondaryHardDiskFailure      .1.3.6.1.4.1.22610.2.4.3.12.2.1.12
axSystemRestart                 .1.3.6.1.4.1.22610.2.4.3.12.2.1.15
axHAStandby                     .1.3.6.1.4.1.22610.2.4.3.12.2.2.1
axServerDown                    .1.3.6.1.4.1.22610.2.4.3.12.2.2.6
axServiceDown                   .1.3.6.1.4.1.22610.2.4.3.12.2.2.4
axVirtualServerPortDown         .1.3.6.1.4.1.22610.2.4.3.12.2.2.12

レベル NOTICE
axSystemTempHigh                .1.3.6.1.4.1.22610.2.4.3.12.2.1.3
axHardDiskUsageHigh             .1.3.6.1.4.1.22610.2.4.3.12.2.1.13
axMemoryUsageHigh               .1.3.6.1.4.1.22610.2.4.3.12.2.1.14
axSystemDropPacketEvent         .1.3.6.1.4.1.22610.2.4.3.12.2.1.16
axSystemControlCpuHigh          .1.3.6.1.4.1.22610.2.4.3.12.2.1.18
axSystemDataCpuHigh             .1.3.6.1.4.1.22610.2.4.3.12.2.1.19
axHAActive                      .1.3.6.1.4.1.22610.2.4.3.12.2.2.2
axHAActiveActive                .1.3.6.1.4.1.22610.2.4.3.12.2.2.3
axServerConnLimit               .1.3.6.1.4.1.22610.2.4.3.12.2.2.8
axServiceConnLimit              .1.3.6.1.4.1.22610.2.4.3.12.2.2.10
axServerConnRateLimit           .1.3.6.1.4.1.22610.2.4.3.12.2.2.19
axServiceConnRateLimit          .1.3.6.1.4.1.22610.2.4.3.12.2.2.20
axNetworkTrunkPortsThreshold    .1.3.6.1.4.1.22610.2.4.3.12.2.3.1
axApplicationBufferReachLimit   .1.3.6.1.4.1.22610.2.4.3.12.2.2.14
axVirtualServerReachConnLimit   .1.3.6.1.4.1.22610.2.4.3.12.2.2.17
axVirtualServerPortReachConnLimit       .1.3.6.1.4.1.22610.2.4.3.12.2.2.15
axVirtualServerPortReachConnRateLimit   .1.3.6.1.4.1.22610.2.4.3.12.2.2.16
axVirtualServerReachConnRateLimit       .1.3.6.1.4.1.22610.2.4.3.12.2.2.18

レベル INFO
axSystemStart                   .1.3.6.1.4.1.22610.2.4.3.12.2.1.1
axSystemRelieveDropPacketEvent  .1.3.6.1.4.1.22610.2.4.3.12.2.1.17
axServiceUp                     .1.3.6.1.4.1.22610.2.4.3.12.2.2.5
axServerUp                      .1.3.6.1.4.1.22610.2.4.3.12.2.2.7
axServerConnResume              .1.3.6.1.4.1.22610.2.4.3.12.2.2.9
axServiceConnResume             .1.3.6.1.4.1.22610.2.4.3.12.2.2.11
axVirtualServerPortUp           .1.3.6.1.4.1.22610.2.4.3.12.2.2.13



統計情報取得用mib
【トラフィック】
● axVirtualServerStatTable
Get the virtual server statistics table.

axVirtualServerStatName
.1.3.6.1.4.1.22610.2.4.3.4.2.1.1.2

axVirtualServerStatCurConns
.1.3.6.1.4.1.22610.2.4.3.4.2.1.1.9

● axServiceGroupStatTable
Get the service group statistics table. This table shows statistics for service groups.

axServiceGroupStatName
.1.3.6.1.4.1.22610.2.4.3.3.2.1.1.1

axServiceGroupStatCurConns
.1.3.6.1.4.1.22610.2.4.3.3.2.1.1.7

● axServiceGroupMemberStatTable
Get the service group member statistics table.

axServiceGroupMemberStatName
.1.3.6.1.4.1.22610.2.4.3.3.4.1.1.1

axServiceGroupMemberStatCurConns
.1.3.6.1.4.1.22610.2.4.3.3.4.1.1.11


【ディスク】
● axSysDiskTotalSpace
Get the total amount of space on the AX hard disk. The space is measured in Megabytes (MB).
.1.3.6.1.4.1.22610.2.4.1.4.1

● axSysDiskFreeSpace
Get the amount of hard disk space that is currently free (unused). The space is measured in MB.
.1.3.6.1.4.1.22610.2.4.1.4.2


【プロセッサ】
● axSysAverageControlCpuUsage
Description Gets the average control CPU utilization over the last 5 seconds.
.1.3.6.1.4.1.22610.2.4.1.3.4

● axSysAverageDataCpuUsage
Description Gets the average data CPU utilization over the last 5 seconds.
.1.3.6.1.4.1.22610.2.4.1.3.5


【メモリ】
● axSysMemoryTotal
Get the total amount of memory on the system. Memory is measured in Kilobytes(Kb).
.1.3.6.1.4.1.22610.2.4.1.2.1

● axSysMemoryUsage
Get the amount of memory that is currently in use. Memory is measured in Kb.
.1.3.6.1.4.1.22610.2.4.1.2.2