How to access the IP of my other instance inside my app


Ushani Balasooriya
 

Hi there,

Im going to deploy my application in BOSH and cluster it with n number of nodes. E.g., 2

So in my app, when I deploy the app in my manifest.yml I have defined below. So it starts at 10.244.15.21 and next node starts in 10.244.15.22 when give instances : 2 in my manifest.yml

static:
- 10.244.15.2 - 10.244.15.20

So in my each app I need to access each other nodes' IPs inside a XML file. How can i do this dynamically in a xml file. Please advice. Thanks

E.g.,

<parameter name="localMemberHost">127.0.0.1</parameter>

<members>
<member>
<hostName>10.244.15.21</hostName>
<port>4000</port>
</member>

<member>
<hostName>10.244.15.22</hostName>
<port>4000</port>
</member>
</members>


Daniel Mikusa <dmikusa@...>
 

I think you want Bosh links, but more specifically a self link ->
https://bosh.io/docs/links.html#self

Dan

On Wed, Sep 20, 2017 at 5:48 AM, Ushani Balasooriya <ushanib(a)gmail.com>
wrote:

Hi there,

Im going to deploy my application in BOSH and cluster it with n number of
nodes. E.g., 2

So in my app, when I deploy the app in my manifest.yml I have defined
below. So it starts at 10.244.15.21 and next node starts in 10.244.15.22
when give instances : 2 in my manifest.yml

static:
- 10.244.15.2 - 10.244.15.20

So in my each app I need to access each other nodes' IPs inside a XML
file. How can i do this dynamically in a xml file. Please advice. Thanks

E.g.,

<parameter name="localMemberHost">127.0.0.1</parameter>

<members>
<member>
<hostName>10.244.15.21</hostName>
<port>4000</port>
</member>

<member>
<hostName>10.244.15.22</hostName>
<port>4000</port>
</member>
</members>


Ushani Balasooriya
 

Hi Daniel,
I'm trying create a cluster setup which is configurable for n number of instances. So, How can I access the IP set for a particular IP dynamically?
Or is there a way where I can access them using a pre defined host which it can resolve the IP by itself?

Appreciate your help


Daniel Mikusa <dmikusa@...>
 

Take a look at the example referenced from the docs. You can see the links
exposed in the spec file and how they're consumed in the various templates.

https://github.com/cppforlife/zookeeper-release/tree/master/jobs/zookeeper

Dan


On Wed, Sep 20, 2017 at 10:44 AM, Ushani Balasooriya <ushanib(a)gmail.com>
wrote:

Hi Daniel,
I'm trying create a cluster setup which is configurable for n number of
instances. So, How can I access the IP set for a particular IP dynamically?
Or is there a way where I can access them using a pre defined host which
it can resolve the IP by itself?

Appreciate your help


Ushani Balasooriya
 

Thanks Dan will check


Ushani Balasooriya
 

Hi Dan,

I checked the doc and thanks for the info.

But what I really need is a way to capture the ips of instances dynamically created when we define a number in deploy. manifest.
E.g.,

- instances: 3
name: wso2is
networks:
- name: wso2is_network
resource_pool: wso2is-resource-pool
templates:
- name: wso2is



========

Instance Process State AZ IPs VM CID VM Type
wso2is/1aa7dc45-e657-4519-ba43-d9f08f4b708b running - 10.244.15.23 70899e3d-8efb-4197-63dc-267feffe3bb3 wso2is-resource-pool
wso2is/317d9109-a2bf-42a4-b959-9f556a599a91 running - 10.244.15.22 4410cbbb-dc84-4d78-42e9-56b7d60a6f5c wso2is-resource-pool
wso2is/6502084e-8ae2-43f9-9416-eb54952b6289 running - 10.244.15.24 da258279-6a96-4e8c-49ad-e752073b108f wso2is-resource-pool

I need to access 10.244.15.23 , 10.244.15.22, 10.244.15.24 IPs dynamically.

Thanks


Eric Malm <emalm@...>
 

Hi, Ushani,

The zookeeper release gets exactly those IPs via the "address" property on
each of the instances in its "peers" link:
https://github.com/cppforlife/zookeeper-release/blob/master/jobs/zookeeper/templates/zoo.cfg.erb#L1-L5.
The Template Accessor section in https://bosh.io/docs/links.html#templates
has more information on the available properties in a link. Presumably a
similar pattern would work for your WSO2 release.

Best,
Eric, CF Diego PM

On Thu, Sep 21, 2017 at 4:22 AM, Ushani Balasooriya <ushanib(a)gmail.com>
wrote:

Hi Dan,

I checked the doc and thanks for the info.

But what I really need is a way to capture the ips of instances
dynamically created when we define a number in deploy. manifest.
E.g.,

- instances: 3
name: wso2is
networks:
- name: wso2is_network
resource_pool: wso2is-resource-pool
templates:
- name: wso2is



========

Instance Process State AZ IPs
VM CID VM Type
wso2is/1aa7dc45-e657-4519-ba43-d9f08f4b708b running -
10.244.15.23 70899e3d-8efb-4197-63dc-267feffe3bb3 wso2is-resource-pool
wso2is/317d9109-a2bf-42a4-b959-9f556a599a91 running -
10.244.15.22 4410cbbb-dc84-4d78-42e9-56b7d60a6f5c wso2is-resource-pool
wso2is/6502084e-8ae2-43f9-9416-eb54952b6289 running -
10.244.15.24 da258279-6a96-4e8c-49ad-e752073b108f wso2is-resource-pool

I need to access 10.244.15.23 , 10.244.15.22, 10.244.15.24 IPs
dynamically.

Thanks


Ushani Balasooriya
 

Thanks Eric. I could do it by using a small bash script . Thanks for your input.