Get Started with Hazelcast Enterprise in VMware Tanzu

What You’ll Learn

In this tutorial, you’ll learn how to:

  • Install and configure the Hazelcast IMDG Enterprise tile in VMware Tanzu Application Service(TAS).

  • Create a Hazelcast IMDG Enterprise cluster via service instances in TAS.

  • Use a client application to add some data to a map in the Hazelcast cluster.

Before you Begin

  • cf cli

  • VMware Tanzu Application Service and Ops Manager environments

  • Git

  • JDK 1.8+

  • Apache Maven 3.2+

Step 1. Install and Configure Hazelcast IMDG Enterprise for VMware Tanzu

Complete the following steps to download and install the Hazelcast IMDG Enterprise for VMware Tanzu tile on Ops Manager.

  1. Download the product file from VMware Tanzu Network.

  2. Go to your Ops Manager dashboard at the pre-installed VMware Tanzu Application Service environment.

  3. Navigate to the Ops Manager Installation Dashboard and click Import a Product to upload the product file.

  4. Click Add next to the uploaded Hazelcast IMDG Enterprise for VMware Tanzu tile in the Ops Manager Available Products view to add it to your staging area.

  5. Click the newly added Hazelcast IMDG Enterprise for VMware Tanzu tile.

    tile

  6. Click Assign AZs and Networks. In the AZ and Network Assignments pane, do the following:

    1. Select the Network in which to deploy the Hazelcast Service Broker.

    2. Select the Service Network in which to create VMs for Hazelcast.

    3. Click Save.

    az

  7. Click First On-demand plan. In the Hazelcast on-demand plan pane, do the following:

    1. Enter a Plan name.

    2. Enter a Plan description. For an example of how the plan name and description appear on the command line, see Step 1 in the Using Hazelcast IMDG Enterprise for VMware Tanzu topic.

  8. Specify the number of Hazelcast instances for this plan. This property defines the number of Hazelcast instances to be created. It can be overridden for each service instance when creating a service instance by using instanceCount parameter. See Step 2 in the Using Hazelcast IMDG Enterprise for VMware Tanzu topic for more information.

  9. Select a Hazelcast VM type. Choose a suitable VM type according to your data size and processing power requirements.

  10. If you are planning on using features like Hot Restart that require a persistent disk, select a Hazelcast Disk type. Otherwise, you can leave this option empty because Hazelcast, by default, does not require a persistent disk.

  11. Select a Management Center VM type.

  12. If you are planning on migrating Management Center between service instances and deployments that require a persistent disk, select a Management Center VM type. Otherwise, you can leave this option empty because Management Center, by default, does not require a persistent disk.

  13. Select the Hazelcast availability zone(s) in which to create VMs for this plan.

  14. Click Save.

    first plan

  15. If you want to modify the additional Hazelcast IMDG Enterprise for VMware Tanzu plans, repeat the step above to configure the second and third on-demand plans.

  16. Click Errands and ensure that both Register on-demand broker and Deregister on-demand broker are selected. These are necessary to create and destroy Hazelcast service instances. You can disable smoke-tests errand to decrease installation time.

    errands

  17. Click Resource Config and review the IaaS resources used by the Hazelcast IMDG Enterprise for VMware Tanzu components. Do not modify these default settings.

    resource config

  18. Return to the Ops Manager Installation Dashboard and click Apply Changes to complete the installation of Hazelcast IMDG Enterprise for VMware Tanzu. Installation porcess takes 15 minutes approximately.

Step 2. Use Hazelcast IMDG Enterprise for VMware Tanzu

After your VMware Tanzu operator installs the Hazelcast IMDG Enterprise for VMware Tanzu tile, it automatically registers itself to the Marketplace.

  1. Login with the CLI to TAS environment:

        $ cf login -a API-URL -u USERNAME -p PASSWORD -o ORG -s SPACE --skip-ssl-validation
  2. To check availability of Hazelcast IMDG Enterprise for VMware Tanzu, run the following command:

        $ cf marketplace
        Getting services from marketplace in org system / space system as admin...
        OK
        service         plans                            description
        hazelcast       small, medium, large    Hazelcast Service
  3. Clone the project to get JSON file containing service-specific configuration parameters:

        $ git clone https://github.com/hazelcast-guides/vmware-tanzu.git
  4. To create a 3 nodes Hazelcast IMDG cluster and Management Center that coonnects to it, run the following command:

        $ cf create-service hazelcast PLAN SERVICE_INSTANCE_NAME -c /path/to/project/hazelcast-mancenter.json
    • Replace PUT_LICENSE_KEY_HERE with the active Hazelcast IMDG Enterprise License or a trial license.

You can create Hazelcast IMDG cluster without Management Center via following one line command as well [Installing and Configuring Hazelcast IMDG Enterprise for VMware Tanzu]:
    $ cf cs hazelcast PLAN SERVICE_INSTANCE_NAME -c '{"hazelcast": {"license-key": "PUT_LICENSE_KEY_HERE"}}'
  1. After the services are created, you can build sample client application that utilizes VCAP_SERVICES environment variable at project path:

        $ mvn clean install
  2. To push application and , run following commands:

        $ cf push APP_NAME -m 2G -i 1 -p /path/to/project/target/tanzu-sample-client-app-0.1.jar --no-manifest --no-start
  3. Now you can bind Hazelcast IMDG services to the application and start it:

        $ cf bind-service APP_NAME SERVICE_INSTANCE_NAME
        $ cf start APP_NAME
  4. To put/get data into Hazelcast IMDG map, run following commands:

        $ export APP_ROUTE=`cf app APP_NAME | grep routes | awk '{ print $2 }'`
        $ curl -s "http://${APP_ROUTE}/put?key=1&value=1"
        $ curl -s "http://${APP_ROUTE}/get?key=1"
  5. You can reach Management Center dashboard via http://mancenter.YOUR_APPS_DOMAIN URL. Replace YOUR_APPS_DOMAIN with the output of following command:

        $ cf domains | grep -i apps.*.cf-app.com | awk '{ print $1 }'

See Also

You can check other use cases for the tile like WAN Replication, Rolling Upgrade at official documentation.