library/roles/orientdb: Fix some problems with permissions and configuration. See https://support.d4science.org/issues/5568.

This commit is contained in:
Andrea Dell'Amico 2016-10-26 16:23:29 +02:00
parent fcff879965
commit 2a1212a176
4 changed files with 20 additions and 6 deletions

View File

@ -12,6 +12,7 @@ orientdb_home_prefix: /home
orientdb_base_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}'
orientdb_install_dir: '{{ orientdb_base_dir }}/{{ orientdb_dir }}'
orientdb_data_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/databases'
orientdb_pid_dir: '{{ orientdb_home_prefix }}/{{ orientdb_user }}/pid'
orientdb_configuration_files:
- orientdb-server-log.properties
- orientdb-server-config.xml
@ -37,10 +38,10 @@ orientdb_java_heap: '-Xms1024m -Xmx2048m'
orientdb_default_settings: ''
orientdb_distributed: False
orientdb_distributed_autodeploy: true
orientdb_distributed_autodeploy: 'true'
orientdb_distributed_writequorum: 'majority'
orientdb_distributed_readquorum: 1
orientdb_distributed_readyourwrites: true
orientdb_distributed_readyourwrites: 'true'
orientdb_distributed_executionmode: 'undefined'
orientdb_hazelcast_group_name: orientdb
orientdb_hazelcast_group_password: orientdb

View File

@ -27,7 +27,10 @@
- name: Create the databases directory inside the orientdb user home
become: True
become_user: '{{ orientdb_user }}'
file: dest={{ orientdb_data_dir }} state=directory mode=0750
file: dest={{ item }} state=directory mode=0750
with_items:
- '{{ orientdb_data_dir }}'
- '{{ orientdb_pid_dir }}'
- name: Fetch and install the hook jars
get_url: url='{{ item }}' dest={{ orientdb_install_dir }}/lib
@ -38,8 +41,14 @@
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"
with_items:
- server.sh
- shutdown.sh
- name: Install the orientdb configuration files
template: src={{ item }}.j2 dest={{ orientdb_install_dir }}/config/{{ item }} owner={{ orientdb_user }} group={{ orientdb_user }} mode=0440
template: src={{ item }}.j2 dest={{ orientdb_install_dir }}/config/{{ item }} owner={{ orientdb_user }} group={{ orientdb_user }} mode=0640
with_items: '{{ orientdb_configuration_files }}'
notify: Restart orientdb

View File

@ -2,3 +2,7 @@ export ORIENTDB_DIR="{{ orientdb_home_prefix }}/{{ orientdb_user }}/{{ orientdb_
export ORIENTDB_USER="{{ orientdb_user }}"
export ORIENTDB_OPTS_MEMORY="{{ orientdb_java_heap }}"
export ORIENTDB_SETTINGS="{{ orientdb_default_settings }}"
ORIENTDB_SERVER_OPTS=
{% if orientdb_distributed %}
ORIENTDB_SERVER_OPTS="-Ddistributed=true"
{% endif %}

View File

@ -29,7 +29,7 @@ start() {
fi
echo "Starting OrientDB server daemon..."
cd "$ORIENTDB_DIR/bin"
su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./server.sh 1>../log/orientdb.log 2>../log/orientdb.err &"
su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./server.sh $ORIENTDB_SERVER_OPTS 1>{{ orientdb_log_dir }}/orientdb.log 2>{{ orientdb_log_dir }}/orientdb.err &"
}
stop() {
@ -41,7 +41,7 @@ stop() {
fi
echo "Stopping OrientDB server daemon..."
cd "$ORIENTDB_DIR/bin"
su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh 1>>../log/orientdb.log 2>>../log/orientdb.err &"
su $ORIENTDB_USER -c "cd \"$ORIENTDB_DIR/bin\"; /usr/bin/nohup ./shutdown.sh 1>>{{ orientdb_log_dir }}/orientdb.log 2>>{{ orientdb_log_dir }}/orientdb.err &"
}
status() {