share data (IPs) between two OS::Nova::Server nodes
Hi, I am creating two OS::Nova::Server node for Elasticsearch, say Node0 & Node1, I need to update config files of Node0 & Node1 with IPs of Node0 & Node1. How can I do that? I am trying something like this -
heat_template_version: 2014-10-16
description: |
This will create an Elasticsearch cluster of 3 Elasticsearch nodes.
resources:
Node0:
type: OS::Nova::Server
properties:
name: n0
image: ubuntu16-ecomp.qcow2
flavor: onap_large
networks:
- network: NET_1266
user_data: |
#!/bin/sh
local_ip_1=`ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | awk '{print $1}'`
ip_arr="[ $local_ip_1, $local_ip_2 ]"
sed -i "/network\.host/a network.host: $(echo $ip_arr)" /etc/elasticsearch/elasticsearch.yml
user_data_format: RAW
Node1:
type: OS::Nova::Server
properties:
name: n1
image: ubuntu16-ecomp.qcow2
flavor: onap_large
networks:
- network: NET_1266
user_data: |
#!/bin/sh
local_ip_2=`ifconfig eth0 | grep "inet addr" | cut -d ':' -f 2 | awk '{print $1}'`
ip_arr="[ $local_ip_1, $local_ip_2 ]"
sed -i "/network\.host/a network.host: $(echo $ip_arr)" /etc/elasticsearch/elasticsearch.yml
user_data_format: RAW
As above, I need to share local_ip_1 & local_ip_2
between Node0 & Node1
, how can I do?
Please do not mind, I am completely new in HOT, I started today, I could not get much info in Google