「原創」F5 BIGIP LTM V10 通過命令行新建pool

F5 TMOS從Version 10開始引入了TMSH命令行工具(全稱:Traffic Management Shell),有別於之前的Bigpipe Shell,前者提供了更友好的操作體驗,比如提供了分層結構、支持Tab自動補齊、支持打"?"提示等。下面分別通過TMSH和Bigpipe Shell命令行演示新建pool:

TMSH:

[root@f5:Active] / # tmsh create /ltm pool bpool members add { 2.2.2.2:80 2.2.2.3:80 } monitor tcp

[root@f5:Active] / #

新建一個名為"bpool"的Pool,Pool member 2個,包含2.2.2.2:80和2.2.2.3:80,健康檢查方式為tcp,TMOS默認lb method為round robin(輪詢)

Advertisements

保存配置,以防設備重啟丟失:

[root@f5:Active] / # tmsh save /sys config

/config/bigip_base.conf was renamed to /config/bigip_base.conf.bak (26 lines).

/config/bigip_sys.conf was renamed to /config/bigip_sys.conf.bak (23 lines).

/config/bigip.conf was renamed to /config/bigip.conf.bak (44 lines).

/config/bigip_local.conf was renamed to /config/bigip_local.conf.bak (1 lines).

Advertisements

查看名為"bpool"的Pool:

[root@f5:Active] / # tmsh show /ltm pool bpool

Ltm::Pool: bpool

---------------------------------

Status

Availability : offline

State : enabled

Reason :

Traffic ServerSide

Bits In 0

Bits Out 0

Packets In 0

Packets Out 0

Current Connections 0

Maximum Connections 0

Total Connections 0

[root@f5:Active] / # tmsh list /ltm pool bpool

ltm pool bpool {

members {

2.2.2.2:http { }

2.2.2.3:http { }

}

monitor tcp

}

Bigpipe Shell:

[root@f5:Active] / # b pool mypool { monitor all tcp members 2.2.2.4:80 2.2.2.5:80 }

[root@f5:Active] / # b save

/config/bigip.conf was renamed to /config/bigip.conf.bak (44 lines).

/config/bigip_local.conf was renamed to /config/bigip_local.conf.bak (1 lines).

/config/bigip_sys.conf was renamed to /config/bigip_sys.conf.bak (23 lines).

[root@f5:Active] / # b pool mypool show

POOL mypool LB METHOD round robin MIN/CUR ACTIVE MEMBERS 0/0

| (cur, max, limit, tot) = (0, 0, 0, 0)

| (pkts,bits) in = (0, 0), out = (0, 0)

+-> POOL MEMBER mypool/2.2.2.4:http inactive,down

| | session enabled priority 0 ratio 1

| | (cur, max, limit, tot) = (0, 0, 0, 0)

| | (pkts,bits) in = (0, 0), out = (0, 0)

| | requests (total) = 0

+-> POOL MEMBER mypool/2.2.2.5:http inactive,down

| session enabled priority 0 ratio 1

| (cur, max, limit, tot) = (0, 0, 0, 0)

| (pkts,bits) in = (0, 0), out = (0, 0)

| requests (total) = 0

[root@f5:Active] / # b pool mypool list

pool mypool {

monitor all tcp

members {

2.2.2.4:http {}

2.2.2.5:http {}

}

}

Advertisements

你可能會喜歡