This section covers the configuration steps for geolocation-based algorithm using NSX Advanced Load Balancer CLI.

To enable geolocation-based algorithm using NSX Advanced Load Balancer CLI:

Procedure

  1. When setting SE group properties in an environment that will use the geolocation algorithm, pay special attention to the memory configuration.
    [admin:10-10-24-207]: > configure serviceenginegroup mySEgrp
    [admin:10-10-24-207]: serviceenginegroup> where
    Tenant: admin
    +-------+---------+
    | Field | Value   |
    +-------+---------+
    | name  | mySEgrp |
    +-------+---------+
    [admin:10-10-24-207]: serviceenginegroup> memory_per_se 8196
    [admin:10-10-24-207]: serviceenginegroup> extra_shared_config_memory 2048
    [admin:10-10-24-207]: serviceenginegroup> save
    [admin:kh-c1]: serviceenginegroup>
  2. Upload one or more geoDB file(s).
    [admin:10-10-24-207]: > upload gslbfiles [FILENAME]
  3. Create a GSLB geolocation profile.
    [admin:10-10-24-207]: > configure gslbgeodbprofile mygslbprofile
    [admin:10-10-24-207]: gslbgeodbprofile> where
    Tenant: admin
    +-------+---------------+
    | Field | Value         |
    +-------+---------------+
    | name  | mygslbprofile |
    +-------+---------------+
    [admin:10-10-24-207]: gslbgeodbprofile> [TAB][TAB]
    cancel        Exit the current submode without saving
    description   Help string not found for argument
    do            Execute a show command
    entries       (submode)
    name          A user-friendly name for the geodb profile.
    new           (Editor Mode) Create new object in editor mode
    no            Remove field
    save          Save and exit the current submode
    show_schema   show object schema
    tenant_ref    Help string not found for argument
    watch         Watch a given show command
    where         Display the in-progress object
    [admin:10-10-24-207]: gslbgeodbprofile> where
    Tenant: admin
    +-------+---------------+
    | Field | Value         |
    +-------+---------------+
    | name  | mygslbprofile |
    +-------+---------------+
    [admin:10-10-24-207: gslbgeodbprofile> new
    # description: ' # Field Type: Optional'
    # entries:
    # - file:
    #     checksum: ' # Field Type: Optional'
    #     file_id: ' # Field Type: Optional'
    #     filename: ' # Field Type: Optional'
    #     format: '<choices: GSLB_GEODB_FILE_FORMAT_MAXMIND_CITY |      GSLB_GEODB_FILE_FORMAT_AVI>
    #       # Field Type: Optional'
    #     timestamp: ' # Field Type: Optional'
    #   priority: ' # Field Type: Optional'
    # name: ' # Field Type: Required'
    # tenant_uuid: ' # Field Type: Required'
    # uuid: ' # Field Type: Required'
    #
    name: mygslbprofile
    </code></pre>
    
  4. Select the geolocation load balancing algorithm for the GSLB service pool.
    [admin:10-10-24-207]: > configure gslbservice gs-1
    [admin:10-10-24-207]: gslbservice> new
    # - algorithm: '<choices: GSLB_ALGORITHM_CONSISTENT_HASH |    GSLB_ALGORITHM_ROUND_ROBIN
    #     | GSLB_ALGORITHM_GEO> # Field Type: Optional'
    #   consistent_hash_mask: ' # Field Type: Optional'
    #   members:
    #   - cluster_uuid: ' # Field Type: Optional'
    #     enabled: '(true | false) # Field Type: Optional'
    #     fqdn: ' # Field Type: Optional'
    #     hm_proxies:
    #     - proxy_type: ' # Field Type:
    #         Optional'
    #       site_uuid: ' # Field Type: Optional'
    #     ip:
    #       addr: ' # Field Type: Required'
    #       type: '<choices: V4 | DNS> # Field Type: Required'
    #     location:
    #       location:
    #         latitude: ' # Field Type: Optional'
    #         longitude: ' # Field Type: Optional'
    #         name: ' # Field Type: Optional'
    #         tag: ' # Field Type: Optional'
    #       source: '<choices: GSLB_LOCATION_SRC_FROM_GEODB | GSLB_LOCATION_SRC_USER_CONFIGURED
    #         | GSLB_LOCATION_SRC_INHERIT_FROM_SITE> # Field Type: Optional'
    #     ratio: ' # Field Type: Optional'
    #     vs_uuid: ' # Field Type: Optional'
    #   name: ' # Field Type: Optional'
    #   priority: ' # Field Type: Optional'
    # health_monitor_scope: '<choices: GSLB_SERVICE_HEALTH_MONITOR_ONLY_NON_AVI_MEMBERS
    #   | GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS> # Field Type: Optional'
    # health_monitor_uuids: 
    # name: ' # Field Type: Required'
    # num_dns_ip: ' # Field Type: Optional'
    # tenant_uuid: ' # Field Type: Required'
    # ttl: ' # Field Type: Optional'
    # use_edns_client_subnet: '(true | false) # Field Type: Optional'
    # uuid: ' # Field Type: Required'
    # wildcard_match: '(true | false) # Field Type: Optional'
    #
    groups:
    - algorithm: GSLB_ALGORITHM_GEO
    name: gs-1
    </code></pre>
    
  5. A GSLB service using the geolocation algorithm will show the location (and any other values that might have been set using configure gslbservice).
    [admin:10-10-24-207]: > show gslbservice gs-1
    +----------------------------------+-----------------------------------------------------+
    | Field                            | Value                                               |
    +----------------------------------+-----------------------------------------------------+
    | uuid                             | gslbservice-95abaa9f-3703-4012-8846-7158f6034be6    |
    | name                             | gs-1                                                |
    | domain_names[1]                  | 1.com                                               |
    | groups[1]                        |                                                     |
    |   name                           | group1                                              |
    |   priority                       | 13                                                  |
    |   algorithm                      | GSLB_ALGORITHM_GEO                                  |
    |   members[1]                     |                                                     |
    |     ip                           | 100.64.218.64                                       |
    |     ratio                        | 1                                                   |
    |     enabled                      | True                                                |
    |     hostname                     | abc123.com                                          |
    |     resolve_fqdn_to_v6           | False                                               |
    |     preference_order             | 1                                                   |
    |   members[2]                     |                                                     |
    |     cluster_uuid                 | cluster-42117bdf-85a3-4de7-a5da-5c678c11e1f7        |
    |     vs_uuid                      | virtualservice-651ef7a6-0cf4-451e-82fc-0fa22c6cd330 |
    |     ip                           | 100.64.218.68                                       |
    |     ratio                        | 1                                                   |
    |     enabled                      | True                                                |
    |     resolve_fqdn_to_v6           | False                                               |
    |     preference_order             | 1                                                   |
    |   enabled                        | True                                                |
    | health_monitor_refs[1]           | ghm-ping-2                                          |
    | controller_health_status_enabled | True                                                |
    | health_monitor_scope             | GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS             |
    | enabled                          | True                                                |
    | use_edns_client_subnet           | True                                                |
    | wildcard_match                   | False                                               |
    | site_persistence_enabled         | False                                               |
    | pool_algorithm                   | GSLB_SERVICE_ALGORITHM_PRIORITY                     |
    | min_members                      | 0                                                   |
    | resolve_cname                    | False                                               |
    | is_federated                     | True                                                |
    | tenant_ref                       | admin                                               |
    +----------------------------------+-----------------------------------------------------+

     The geo algorithm can fail because the NSX Advanced Load Balancer is unable to determine location due to some reason. In case of such a failure, we can configure the fall back algorithm. Consistent hash method can be chosen as the fallback algorithm for GSLB pool selection. In the consistent hash load balancing method, traffic is distributed based on the client’s source IP address. If the fall back algorithm is not configured, by default, the round robin method is used as the fallback algorithm.

What to do next

For more details on Geo-DB, see Geolocation Database (Geo-DB).