Quick Start Tutorial with Redis Enterprise Pack for Pivotal Cloud Foundry (PCF)
Redis Enterprise Pack for PCF exposes its service plans on the Marketplace. Developers can provision highly available and scalable Redis databases by creating instances of the service plans using Apps Manager or the Cloud Foundry Command Line Interface (cf CLI).
Step 1 – Import the Redis Enterprise Pack Tile
You will need to import the Redis Enterprise Pack .pivotal file into your Pivotal Cloud Foundry environment to get started.
- Download the .pivotal file for Redis Enterprise Pack.
- Navigate to your Ops Manager URL and click on Import a Product button and select the downloaded .pivotal file for Redis Enterprise Pack
Step 2 – Configure Redis Enterprise Pack
- Click the newly imported tile.
- Navigate to the Assign AZs and Network section on the right navigation bar. Ensure you have a network selected for the cluster to use.
- Navigate to the Redis Enterprise Pack section on the right navigation bar. You will need to provide the following details:
- From the Settings tab, click Redis Enterprise Pack and complete the following fields and then click Save:
- Cluster Name: Provide a sub-domain for the cluster name. The cluster name is a sub-domain under the System Domain which is found under the Pivotal Elastic Runtime in Ops Manager. This is the connection string for Redis applications will use to connect to Redis databases on Redis Enterprise Pack.
- Admin Email: Provide an email which will have full administrative privileges to the new Redis Enterprise Pack cluster.
- Admin account password: Provide the password for the administrative account.
- Static IPs: For production clusters, you can provide a set of static IPs addresses to use for cluster nodes and enabled Multiple Availability Zone (Rack) awareness.
- Navigate to the “Resource Config” section on the left navigation bar. Ensure there are resources assigned to the required resources for Redis Enterprise Pack.
Step 3 – Deploy the Redis Enterprise Pack Cluster
- Once the tile configuration is done, you can save the changes and click the “Apply changes” to deploy the cluster.
- You can switch into the tile and to the “Status” tab to view the state of the cluster nodes under the jobs named “redis-pack-node” and “redis-pack-service-broker“.
Step 4 – Create a New Database on the Redis Enterprise Pack Cluster
- Connect to the Redis Enterprise Pack Admin Console using the “Cluster Name” you previously specified at the following URL: https://rpadmin.cluster-name
- Log in using the Administrator email account and password you specified above in the tile configuration.
- Navigate to the “databases” tab and create a new database by selecting “redis db“.
- On the “new redis db” page, enter “database1” for the database name and then click the “show advanced option” link and for the “endpoint port number” input “12000“.
- Click “Activate” to create your database.
You now have a Redis database on Redis Enterprise Pack!
Step 5 – Connect to Redis Database Using redis-cli
redis-cli is a simple command-line tool to interact with Redis database. You can connect to one of the IP addresses of the nodes through ssh and find redis-cli under /opt/redislabs/bin/redis-cli
Run redis-cli, located in the /opt/redislabs/bin directory, to connect to port 12000 and to the database-endpoint that is reported in the database properties after you created the database. Here is how you can store and retrieve a key in database1
# sudo /opt/redislabs/bin/redis-cli -p 12000 -h <your-database-endpoint> 127.0.0.1:16653> set key1 123 OK 127.0.0.1:16653> get key1 "123"