La CLI de NSX permite solucionar algunos problemas relacionados con el equilibrador de carga.

## Problema

El equilibrio de carga no funciona según lo esperado.

## Solución

1. Muestre la configuración y la información estadística.
```nsxedge> show configuration loadbalancer
nsxedge> show configuration loadbalancer virtual [virtual-server-name]
nsxedge> show configuration loadbalancer pool [pool-name]
nsxedge> show configuration loadbalancer monitor [monitor-name]
nsxedge> show configuration loadbalancer profile [profile-name]
nsxedge> show configuration loadbalancer rule [rule-name]
```
2. Compruebe el estado del motor del equilibrador de carga (Capa 4 o Capa 7).
```nsxedge> show service loadbalancer
haIndex:              0
-----------------------------------------------------------------------

-----------------------------------------------------------------------
STATUS     PID        MAX_MEM_MB MAX_SOCK   MAX_CONN   MAX_PIPE   CUR_CONN   CONN_RATE  CONN_RATE_LIMIT MAX_CONN_RATE
running    1580       0          2081       1024       0          0          0          0               0
-----------------------------------------------------------------------
MAX_CONN   ACT_CONN   INACT_CONN TOTAL_CONN
0          0          0          0

-> RemoteAddress:Port           Forward Weight ActiveConn InActConn
```
3. Compruebe el estado del grupo del equilibrador de carga (Capa 4 o Capa 7).
```nsxedge> show service loadbalancer pool
-----------------------------------------------------------------------

POOL Web-Tier-Pool-01
|  LB METHOD round-robin
|  LB PROTOCOL L7
|  Transparent disabled
|  SESSION (cur, max, total) = (0, 0, 0)
|  BYTES in = (0), out = (0)
+->POOL MEMBER: Web-Tier-Pool-01/web-01a, STATUS: UP
|  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
|  |  |  LAST STATE CHANGE: 2016-05-16 07:02:00
|  |  SESSION (cur, max, total) = (0, 0, 0)
|  |  BYTES in = (0), out = (0)
+->POOL MEMBER: Web-Tier-Pool-01/web-02a, STATUS: UP
|  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
|  |  |  LAST STATE CHANGE: 2016-05-16 07:02:01
|  |  SESSION (cur, max, total) = (0, 0, 0)
|  |  BYTES in = (0), out = (0)

```
4. Compruebe las estadísticas del los objetos del equilibrador de carga (VIPs, grupos o miembros).

Especifique el nombre del servidor virtual.

```nsxedge> show service loadbalancer virtual Web-Tier-VIP-01

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

VIRTUAL Web-Tier-VIP-01
|  SESSION (cur, max, total) = (0, 0, 0)
|  RATE (cur, max, limit) = (0, 0, 0)
|  BYTES in = (0), out = (0)
+->POOL Web-Tier-Pool-01
|  LB METHOD round-robin
|  LB PROTOCOL L7
|  Transparent disabled
|  SESSION (cur, max, total) = (0, 0, 0)
|  BYTES in = (0), out = (0)
+->POOL MEMBER: Web-Tier-Pool-01/web-01a, STATUS: UP
|  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
|  |  |  LAST STATE CHANGE: 2016-05-16 07:02:00
|  |  SESSION (cur, max, total) = (0, 0, 0)
|  |  BYTES in = (0), out = (0)
+->POOL MEMBER: Web-Tier-Pool-01/web-02a, STATUS: UP
|  |  HEALTH MONITOR = BUILT-IN, default_https_monitor:L7OK
|  |  |  LAST STATE CHANGE: 2016-05-16 07:02:01
|  |  SESSION (cur, max, total) = (0, 0, 0)
|  |  BYTES in = (0), out = (0)

```

```nsxedge> show service loadbalancer pool Web-Tier-VIP-01
TIMESTAMP            	SESSIONS   	BYTESIN    	BYTESOUT   	SESSIONRATE	HTTPREQS
2016-04-27 19:56:40  	00         	00         	00         	00         	00
2016-04-27 19:55:00  	00         	32         	100        	00         	00
```

5. Compruebe si el estado de supervisión del servicio es FAVORABLE (OK), ADVERTENCIA (WARNING) o CRÍTICO (CRITICAL).
```nsxedge> show service loadbalancer monitor
-----------------------------------------------------------------------

MONITOR PROVIDER   POOL               MEMBER     HEALTH STATUS
built-in           Web-Tier-Pool-01   web-01a    default_https_monitor:L7OK
built-in           Web-Tier-Pool-01   web-02a    default_https_monitor:L7OK
```
6. Compruebe el registro.
```nsxedge> show log
2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpuset
2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpu
2016-04-20T20:15:36+00:00 vShieldEdge kernel: Initializing cgroup subsys cpuacct
...
```
7. Compruebe la tabla de sesiones del equilibrador de carga.
```nsxedge> show service loadbalancer session
-----------------------------------------------------------------------
STATUS     PID        MAX_MEM_MB MAX_SOCK   MAX_CONN   MAX_PIPE   CUR_CONN   CONN_RATE  CONN_RATE_LIMIT MAX_CONN_RATE
running    1580       0          2081       1024       0          0          0          0               0

0x2192df1f300: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=09 age=0s calls=2 rq[f=c08200h,i=0,an=00h,rx=20s,wx=,ax=] rp[f=008000h,i=0,an=00h,rx=,wx=,ax=] s0=[7,8h,fd=1,ex=] s1=[7,0h,fd=-1,ex=] exp=19s

-----------------------------------------------------------------------
MAX_CONN   ACT_CONN   INACT_CONN TOTAL_CONN
0          0          0          0

```nsxedge> show service loadbalancer table