d584f18754b8a17e4426fd13c3cc53068b3cc65f
[integration/packaging/ansible-opendaylight.git] / templates / akka.conf.j2
1 # {{ ansible_managed }}
2
3 {%- set odl_cluster_list = [] %}
4 {% set vars = {'host_ip': None,'member_index': None} %}
5
6 {% for host in groups["neutron_server_container"]  %}
7    {% if inventory_hostname == host %}
8       {% set _ = vars.update({'host_ip': hostvars[host]['container_address']|string}) %}
9       {% set _ = vars.update({'member_index': '"' + "member-" + loop.index|string + '"'}) %}
10    {% endif %}
11    {% set ip_address =  hostvars[host]['container_address']|string %}
12    {% set _ = odl_cluster_list.append('"' + "akka.tcp://opendaylight-cluster-data@" + ip_address + ":" + {{ akka_remoting_port }} + '"')  %}
13 {%- endfor %}
14
15 odl-cluster-data {
16   akka {
17     remote {
18       artery {
19         enabled = off
20         canonical.hostname = "{{vars.host_ip}}"
21         canonical.port = { akka_remoting_port }}
22       }
23       netty.tcp {
24         hostname = "{{vars.host_ip}}"
25         port = { akka_remoting_port }}
26       }
27       # when under load we might trip a false positive on the failure detector
28       # transport-failure-detector {
29         # heartbeat-interval = 4 s
30         # acceptable-heartbeat-pause = 16s
31       # }
32     }
33
34     cluster {
35       # Remove ".tcp" when using artery.
36       seed-nodes = [{{ odl_cluster_list | join(',') }}]
37       roles = [
38         {{vars.member_index}}
39       ]
40
41     }
42
43     persistence {
44       # By default the snapshots/journal directories live in KARAF_HOME. You can choose to put it somewhere else by
45       # modifying the following two properties. The directory location specified may be a relative or absolute path.
46       # The relative path is always relative to KARAF_HOME.
47
48       # snapshot-store.local.dir = "target/snapshots"
49       # journal.leveldb.dir = "target/journal"
50
51       journal {
52         leveldb {
53           # Set native = off to use a Java-only implementation of leveldb.
54           # Note that the Java-only version is not currently considered by Akka to be production quality.
55
56           # native = off
57         }
58       }
59     }
60   }
61 }
62