From 59717eae9cae419dca63673db85347433e7ae27f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 19 Mar 2020 12:01:23 +0100 Subject: [PATCH] orientdb: support hazelcast in unicast/tcp mode. --- library/roles/orientdb/defaults/main.yml | 9 ++++++--- library/roles/orientdb/tasks/main.yml | 5 +++-- library/roles/orientdb/templates/hazelcast.xml.j2 | 11 +++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/library/roles/orientdb/defaults/main.yml b/library/roles/orientdb/defaults/main.yml index b48eee88..b61a145d 100644 --- a/library/roles/orientdb/defaults/main.yml +++ b/library/roles/orientdb/defaults/main.yml @@ -1,7 +1,7 @@ --- orientdb_install: False orientdb_enabled: True -orientdb_version: 3.0.15 +orientdb_version: 3.0.29 orientdb_archive_commpression: tar.gz orientdb_dir: 'orientdb' orientdb_tar_filename: '{{ orientdb_dir }}-{{ orientdb_version }}' @@ -60,9 +60,12 @@ orientbd_graph_server_enabled: False orientdb_hazelcast_group_name: orientdb orientdb_hazelcast_group_password: orientdb orientbd_hazelcast_encryption: False -orientdb_hazelcast_multicast_enabled: True +orientdb_hazelcast_port_min: 2434 +orientdb_hazelcast_port_max: 2454 +orientdb_hazelcast_multicast_enabled: False orientdb_hazelcast_multicast_group: 235.1.1.1 -orientdb_hazelcast_multicast_port: 2434 +orientdb_hazelcast_unicast_members: + - { member: 'localhost', port: '{{ orientdb_hazelcast_port_min }}' } # For Reference see http://orientdb.com/docs/3.0.x/plugins/Automatic-Backup.html diff --git a/library/roles/orientdb/tasks/main.yml b/library/roles/orientdb/tasks/main.yml index 9396b3f2..e3ab1e78 100644 --- a/library/roles/orientdb/tasks/main.yml +++ b/library/roles/orientdb/tasks/main.yml @@ -52,11 +52,12 @@ template: src=orientdb.default.j2 dest=/etc/default/orientdb owner=root group=root mode=0444 notify: Restart orientdb - - name: Fix the pid file path inside the start/stop scripts - lineinfile: dest={{ orientdb_install_dir }}/bin/{{ item }} regexp="^ORIENTDB_PID=.*$" line="ORIENTDB_PID={{ orientdb_pid_dir }}/orientdb.pid" + - name: Fix the pid file path inside the start and shutdown scripts + lineinfile: dest={{ orientdb_install_dir }}/bin/{{ item }} regexp="^ORIENTDB_PID=.*$" line="ORIENTDB_PID={{ orientdb_pid_dir }}/orientdb.pid" insertafter="^PRG=.*$" firstmatch=yes with_items: - server.sh - shutdown.sh + tags: [ 'orientdb', 'orientdb_pid' ] - name: Install the orientdb configuration files template: src={{ item }}.j2 dest={{ orientdb_install_dir }}/config/{{ item }} owner={{ orientdb_user }} group={{ orientdb_user }} mode=0640 diff --git a/library/roles/orientdb/templates/hazelcast.xml.j2 b/library/roles/orientdb/templates/hazelcast.xml.j2 index 0b4b824c..6ba4cfb7 100644 --- a/library/roles/orientdb/templates/hazelcast.xml.j2 +++ b/library/roles/orientdb/templates/hazelcast.xml.j2 @@ -16,12 +16,19 @@ {{ orientdb_hazelcast_group_password }} - {{ orientdb_hazelcast_multicast_port }} + {{ orientdb_hazelcast_port_min }} {{ orientdb_hazelcast_multicast_group }} - {{ orientdb_hazelcast_multicast_port }} + {{ orientdb_hazelcast_port_min }} + {% if not orientdb_hazelcast_multicast_enabled %} + + {% for node in orientdb_hazelcast_unicast_members %} + {{ node.member }}:{{ node.port | default(orientdb_hazelcast_port_min) }} + {% endfor %} + + {% endif %} {% if orientbd_hazelcast_encryption %}