Tested and debugged mysql/mariadb ansible scripts. Now stack starts correctly but has still TBT with haproxy.

This commit is contained in:
Mauro Mugnaini 2020-11-06 19:15:00 +01:00
parent 1ee0e95090
commit 476a9db7e5
11 changed files with 23 additions and 19 deletions

View File

@ -1,4 +1,4 @@
--- ---
target_path: /tmp/conductor_stack_postgres_cluster_replacement target_path: /tmp/conductor_stack
conductor_network: conductor-network conductor_network: conductor-network
init_db: True init_db: True

View File

@ -29,6 +29,6 @@
- name: Copy conductor SQL schema init for JDBC DB - name: Copy conductor SQL schema init for JDBC DB
when: use_jdbc and init_db when: use_jdbc and init_db
template: template:
src: "templates/conductor-db-init-{{ conductor_db }}.sql" src: "templates/conductor-db-init-{{ conductor_db }}.sql.j2"
dest: "{{ target_path }}/conductor-db-init.sql" dest: "{{ target_path }}/conductor-db-init.sql"

View File

@ -1,3 +1,8 @@
CREATE DATABASE IF NOT EXISTS {{ jdbc_db }};
GRANT ALL PRIVILEGES ON {{ jdbc_db }}.* TO {{ jdbc_user}};
FLUSH PRIVILEGES;
USE {{ jdbc_db }};
-- V1__initial_schema.sql -- -- V1__initial_schema.sql --
-- -------------------------------------------------------------------------------------------------------------- -- --------------------------------------------------------------------------------------------------------------
-- SCHEMA FOR METADATA DAO -- SCHEMA FOR METADATA DAO

View File

@ -13,8 +13,8 @@ db={{ conductor_db }}
jdbc.url={{ jdbc_url }} jdbc.url={{ jdbc_url }}
jdbc.username={{ jdbc_user }} jdbc.username={{ jdbc_user }}
jdbc.password={{ jdbc_pass }} jdbc.password={{ jdbc_pass }}
conductor.postgres.connection.pool.size.max=10 conductor.{{ conductor_db }}.connection.pool.size.max=10
conductor.postgres.connection.pool.idle.min=2 conductor.{{ conductor_db }}.connection.pool.idle.min=2
flyway.enabled=false flyway.enabled=false
{% else %} {% else %}

View File

@ -7,4 +7,4 @@ conductor_db: mysql
jdbc_user: conductor jdbc_user: conductor
jdbc_pass: password jdbc_pass: password
jdbc_db: conductor jdbc_db: conductor
jdbc_url: jdbc:mysql://{{ mysql_service_name }}:3306/{{ jdbc_db }} jdbc_url: jdbc:mysql://{{ mysql_service_name }}:3306/{{ jdbc_db }}?useSSL=false&allowPublicKeyRetrieval=true

View File

@ -4,12 +4,11 @@ services:
{{ mysql_service_name }}: {{ mysql_service_name }}:
image: {{ mysql_image_name }} image: {{ mysql_image_name }}
ports:
- "3306:3306"
environment: environment:
MYSQL_USER: "{{ jdbc_user }}" MYSQL_USER: {{ jdbc_user }}
MYSQL_PASSWORD: "{{ jdbc_pass }}" MYSQL_PASSWORD: {{ jdbc_pass }}
MYSQL_DB: "{{ jdbc_db }}" MYSQL_ROOT_PASSWORD: {{ jdbc_pass }}
MYSQL_DB: {{ jdbc_db }}
{% if init_db %} {% if init_db %}
configs: configs:
- source: db-init - source: db-init

View File

@ -1,5 +1,5 @@
--- ---
conductor_workers_server: http://conductor-dev.int.d4science.net/api conductor_workers_server: http://conductor-dev.int.d4science.net/api
conductor_workers: [{service: 'base', image: 'nubisware/nubisware-conductor-worker-py-base', replicas: 2}, {service: 'provisioning', image: 'nubisware/nubisware-conductor-worker-py-provisioning', replicas: 2 } ] conductor_workers: [ { service: 'base', image: 'nubisware/nubisware-conductor-worker-py-base', replicas: 2, threads: 1, pollrate: 1 }, { service: 'provisioning', image: 'nubisware/nubisware-conductor-worker-py-provisioning', replicas: 2, threads: 1, pollrate: 1 } ]

View File

@ -7,16 +7,16 @@
- elasticsearch - elasticsearch
- conductor - conductor
tasks: tasks:
- name: Start mysql and es - name: "Start {{ mysql_image_name }} and es"
docker_stack: docker_stack:
name: conductor name: conductor
state: present state: present
compose: compose:
- "{{ target_path }}/mysql-swarm.yaml" - "{{ target_path }}/mysql-swarm.yaml"
- "{{ target_path }}/elasticsearch-swarm.yaml" - "{{ target_path }}/elasticsearch-swarm.yaml"
- name: Waiting for mysql and es DBs - name: "Waiting for {{ mysql_image_name }} and es DBs"
pause: pause:
seconds: 10 seconds: 60
- name: Start conductor - name: Start conductor
docker_stack: docker_stack:
@ -27,7 +27,7 @@
- name: Start haproxy - name: Start haproxy
docker_stack: docker_stack:
name: haproxy name: conductor
state: present state: present
compose: compose:
- "{{ target_path }}/haproxy-swarm.yaml" - "{{ target_path }}/haproxy-swarm.yaml"

View File

@ -6,16 +6,16 @@
- elasticsearch - elasticsearch
- conductor - conductor
tasks: tasks:
- name: Start {{ mysql_image }} and es - name: "Start {{ mysql_image_name }} and es"
docker_stack: docker_stack:
name: conductor name: conductor
state: present state: present
compose: compose:
- "{{ target_path }}/mysql-swarm.yaml" - "{{ target_path }}/mysql-swarm.yaml"
- "{{ target_path }}/elasticsearch-swarm.yaml" - "{{ target_path }}/elasticsearch-swarm.yaml"
- name: Waiting for {{ mysql_image }} and es DBs - name: "Waiting for {{ mysql_image_name }} and es DBs"
pause: pause:
seconds: 10 seconds: 60
- name: Start conductor - name: Start conductor
docker_stack: docker_stack:

View File

@ -27,7 +27,7 @@
- name: Start haproxy - name: Start haproxy
docker_stack: docker_stack:
name: haproxy name: conductor
state: present state: present
compose: compose:
- "{{ target_path }}/haproxy-swarm.yaml" - "{{ target_path }}/haproxy-swarm.yaml"