-
Notifications
You must be signed in to change notification settings - Fork 16
/
redisent.html.md.erb
71 lines (61 loc) · 2.74 KB
/
redisent.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: Redis Enterprise
owner: Services
---
## <a id='integrating-your-service'></a> Integrating the Service With Your App
After the [creation](../devguide/services/managing-services.html#create) of the service and the [binding](../devguide/services/application-binding.html#bind) of the service to the application, the environment variable [VCAP_SERVICES](../devguide/deploy-apps/environment-variable.html#VCAP-SERVICES) is created. Information about the credentials are stored in this variable as shown here:
```json
{
"redisent": [
{
"credentials": {
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-master.service.consul",
"master": "redis://09a2ff2e-e485-49ce-b175-06206beeab42",
"password": "HGiTVNno25gf6Gc3",
"port": 33505,
"sentinels": [
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-2.service.consul",
"port": 27348
},
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-0.service.consul",
"port": 27348
},
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-1.service.consul",
"port": 27348
}
],
"servers": [
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-2.service.consul",
"port": 33505
},
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-0.service.consul",
"port": 33505
},
{
"host": "09a2ff2e-e485-49ce-b175-06206beeab42-1.service.consul",
"port": 33505
}
]
},
"label": "redisent",
"name": "redisent-example",
"plan": "large",
"provider": null,
"syslog_drain_url": null,
"tags": [],
"volume_mounts": []
}
]
}
```
You can connect to your service by discovering the current master via one of the "`sentinels`". Be sure to use one of the [supported client libraries](http://redis.io/clients) with the sentinel feature. See the [Redis Enterprise sample app](https://github.com/swisscom/cf-redis-example-app/tree/redisent).
For administrative work, you can connect directly via the `"host"` and `"port"`, which always points to the currently elected master. Please note that this connection variant should not be used for your production applications, always use sentinel-based discovery when possible.
## <a id='administrative'></a> Administrating your Redis instances
To connect to a running Redis instance with your local development tools, you can use the [`cf ssh`](../devguide/deploy-apps/ssh-services.html) feature of the cf CLI.
## <a id='sample-application'></a> Sample Application
Swisscom: [Redis Enterprise Example](https://github.com/swisscom/cf-redis-example-app/tree/redisent)