Commit 41fd5012 authored by Alain Takoudjou's avatar Alain Takoudjou

repman: fix publish parameter for db

parent f82e550e
...@@ -18,7 +18,7 @@ md5sum = da50540b1c0fc69ffbf8f6e345a3baad ...@@ -18,7 +18,7 @@ md5sum = da50540b1c0fc69ffbf8f6e345a3baad
[instance-repman.cfg] [instance-repman.cfg]
_update_hash_filename_ = instance-repman.cfg.jinja2.in _update_hash_filename_ = instance-repman.cfg.jinja2.in
md5sum = bba44129ccd30440f636d1f53f876919 md5sum = 927f27209870e402bca20f6e072625a2
[config-toml.in] [config-toml.in]
_update_hash_filename_ = templates/config.toml.in _update_hash_filename_ = templates/config.toml.in
...@@ -34,11 +34,11 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30 ...@@ -34,11 +34,11 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30
[template-mariadb.cfg] [template-mariadb.cfg]
_update_hash_filename_ = instance-mariadb.cfg.jinja2.in _update_hash_filename_ = instance-mariadb.cfg.jinja2.in
md5sum = 63af2f4fc184cfc9d09f8b72dee5165a md5sum = d7206889f165dbedc5b4ace98e4105d0
[template-my-cnf] [template-my-cnf]
_update_hash_filename_ = templates/my.cnf.in _update_hash_filename_ = templates/my.cnf.in
md5sum = 04a12d3271857fcf29cb010fd7e38a5c md5sum = d2b53cb8ee245c79939c6eab3bde4a0b
[template-mariadb-initial-setup] [template-mariadb-initial-setup]
_update_hash_filename_ = templates/mariadb_initial_setup.sql.in _update_hash_filename_ = templates/mariadb_initial_setup.sql.in
...@@ -58,7 +58,7 @@ md5sum = 99324b56192003254081ef336dcee94c ...@@ -58,7 +58,7 @@ md5sum = 99324b56192003254081ef336dcee94c
[dbjobs-in] [dbjobs-in]
_update_hash_filename_ = templates/dbjobs.in _update_hash_filename_ = templates/dbjobs.in
md5sum = 870c849268b5ec0c22d8ee0668bebbc9 md5sum = ccdf01a2af32936ddfb58f7bab6154c5
[mysqld-need-start.sh.in] [mysqld-need-start.sh.in]
_update_hash_filename_ = templates/mysqld-need-start.sh.in _update_hash_filename_ = templates/mysqld-need-start.sh.in
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{% set ip = (ipv4_set | list)[0] -%} {% set ip = (ipv4_set | list)[0] -%}
{% endif -%} {% endif -%}
{% set dash = parameter_dict['dash-location'] ~ '/bin/dash' %} {% set dash = parameter_dict['dash-location'] ~ '/bin/dash' %}
{% set database_list = slapparameter_dict.get('database-list', [{'name': 'repdb', 'user': 'user', 'password': 'insecure'}]) -%} {% set database_list = slapparameter_dict['database-list'] -%}
# XXX- TODO: add cron with check db need restart then restart # XXX- TODO: add cron with check db need restart then restart
# API check restard needed: http://repman/api/clusters/{clusterName}/servers/{serverName}/{serverPort}/need-restart # API check restard needed: http://repman/api/clusters/{clusterName}/servers/{serverName}/{serverPort}/need-restart
...@@ -170,12 +170,11 @@ template = inline:{% raw -%} ...@@ -170,12 +170,11 @@ template = inline:{% raw -%}
{%- endraw %} {%- endraw %}
context = section parameter_dict odbc-ini-text context = section parameter_dict odbc-ini-text
# XXX - probably not needed anymore, to check [{{ section('logrotate-entry-mariadb') }}]
#[logrotate-entry-mariadb] < = logrotate-entry-base
#< = logrotate-entry-base name = mariadb
#name = mariadb log = ${dbjob-parameter:log-dir}/errors.log ${dbjob-parameter:log-dir}/sql-errors
#log = ${my-cnf-parameters:error-log} ${my-cnf-parameters:slow-query-log} post = "${binary-wrap-mysql:wrapper-path}" -B -e "FLUSH LOGS"
#post = "${binary-wrap-mysql:wrapper-path}" -B -e "FLUSH LOGS"
[{{ section('binary-link') }}] [{{ section('binary-link') }}]
recipe = slapos.cookbook:symbolic.link recipe = slapos.cookbook:symbolic.link
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{% set ip = (ipv6_set | list)[0] -%} {% set ip = (ipv6_set | list)[0] -%}
{% set ipv4 = (ipv4_set | list)[0] -%} {% set ipv4 = (ipv4_set | list)[0] -%}
{% set cluster_list = [] -%} {% set cluster_list = [] -%}
{% set tags = "gtidstrict,bind,pkg,innodb,noquerycache,slow,pfs,linux,readonly,diskmonitor,sqlerror,compressbinlog" -%} {% set tags = "gtidstrict,bind,pkg,innodb,noquerycache,slow,pfs,linux,readonly,diskmonitor,sqlerror,compressbinlog,bm4ci,mroonga,utctime" -%}
{% set frontend_parameter_dict = slapparameter_dict.get('slave-frontend', {}) -%} {% set frontend_parameter_dict = slapparameter_dict.get('slave-frontend', {}) -%}
[directory] [directory]
...@@ -26,6 +26,7 @@ data = ${:var}/lib ...@@ -26,6 +26,7 @@ data = ${:var}/lib
nginx-prefix = ${:var}/nginx nginx-prefix = ${:var}/nginx
tmp = ${:home}/tmp tmp = ${:home}/tmp
{% import "supervisord_lib" as supervisord_lib with context %} {% import "supervisord_lib" as supervisord_lib with context %}
{% set proxysql_controller = "proxysql-controller" -%} {% set proxysql_controller = "proxysql-controller" -%}
{{ supervisord_lib.supervisord(proxysql_controller, buildout_bin_directory, supervisord_conf, use_service_hash=False) }} {{ supervisord_lib.supervisord(proxysql_controller, buildout_bin_directory, supervisord_conf, use_service_hash=False) }}
...@@ -67,6 +68,7 @@ mode = 755 ...@@ -67,6 +68,7 @@ mode = 755
{% do mariadb_dict.__setitem__('innodb-file-per-table', parameter_dict.get('innodb-file-per-table', 1)) -%} {% do mariadb_dict.__setitem__('innodb-file-per-table', parameter_dict.get('innodb-file-per-table', 1)) -%}
{% do mariadb_dict.__setitem__('use-ipv6', parameter_dict.get('use-ipv6', True)) -%} {% do mariadb_dict.__setitem__('use-ipv6', parameter_dict.get('use-ipv6', True)) -%}
{% set database_list = parameter_dict.get('database-list', [{'name': 'repdb', 'user': 'user', 'password': 'insecure'}]) -%}
# Request mariadb instances # Request mariadb instances
{% set db_amount = parameter_dict.get('database-amount', 2) -%} {% set db_amount = parameter_dict.get('database-amount', 2) -%}
{% if db_amount < 2 -%} {% if db_amount < 2 -%}
...@@ -94,6 +96,7 @@ config-repman-url = ${nginx-parameter:backend-url} ...@@ -94,6 +96,7 @@ config-repman-url = ${nginx-parameter:backend-url}
config-repman-secure-url = ${nginx-parameter:backend-ssl-url} config-repman-secure-url = ${nginx-parameter:backend-ssl-url}
config-cluster = {{ name }} config-cluster = {{ name }}
config-name = {{ dbname }} config-name = {{ dbname }}
config-database-list = {{ dumps(database_list) }}
return = return =
database-host database-host
receiver-port receiver-port
...@@ -229,6 +232,17 @@ config-port = {{ '${' ~ name ~ '-cluster-parameter:proxy-port}' }} ...@@ -229,6 +232,17 @@ config-port = {{ '${' ~ name ~ '-cluster-parameter:proxy-port}' }}
{% do part_list.append('config-' ~ name) -%} {% do part_list.append('config-' ~ name) -%}
{% do cluster_list.append("{'name': '" ~ name ~ "', 'host': '" ~ ipv4 ~ "', 'port': '${" ~ name ~ "-cluster-parameter:proxy-admin-port}'}") -%} {% do cluster_list.append("{'name': '" ~ name ~ "', 'host': '" ~ ipv4 ~ "', 'port': '${" ~ name ~ "-cluster-parameter:proxy-admin-port}'}") -%}
{% set publish_database_list = [] -%}
{% for database in database_list -%}
{% if database.get('user') -%}
{% do publish_database_list.append("mysql://" ~ database['user'] ~ ":" ~ database['password'] ~ "@" ~ ipv4 ~ ":${" ~ name ~ "-cluster-parameter:proxy-port}/" ~ database['name']) -%}
{% else -%}
{% do publish_database_list.append("mysql://" ~ ipv4 ~ ":${" ~ name ~ "-cluster-parameter:proxy-port}/" ~ database['name']) -%}
{% endif -%}
{% endfor -%}
{% do publish_dict.__setitem__(name ~ '-database-list', "!py!['" ~ publish_database_list | join("', '") ~ "']") -%}
{% endfor -%} {% endfor -%}
[slap-configuration] [slap-configuration]
......
...@@ -111,11 +111,9 @@ do ...@@ -111,11 +111,9 @@ do
;; ;;
error) error)
cat $ERROLOG| socat -u stdio TCP:$ADDRESS &>{{ parameter_dict['log-dir'] }}/dbjob.out cat $ERROLOG| socat -u stdio TCP:$ADDRESS &>{{ parameter_dict['log-dir'] }}/dbjob.out
> $ERROLOG
;; ;;
slowquery) slowquery)
cat $SLOWLOG| socat -u stdio TCP:$ADDRESS &>{{ parameter_dict['log-dir'] }}/dbjob.out cat $SLOWLOG| socat -u stdio TCP:$ADDRESS &>{{ parameter_dict['log-dir'] }}/dbjob.out
> $SLOWLOG
;; ;;
optimize) optimize)
mysqlcheck --defaults-file={{ parameter_dict['dbjob-cnf'] }} -o --all-databases --skip-write-binlog &>{{ parameter_dict['log-dir'] }}/dbjob.out mysqlcheck --defaults-file={{ parameter_dict['dbjob-cnf'] }} -o --all-databases --skip-write-binlog &>{{ parameter_dict['log-dir'] }}/dbjob.out
......
...@@ -11,16 +11,9 @@ ...@@ -11,16 +11,9 @@
#sql_mode="NO_ENGINE_SUBSTITUTION" #sql_mode="NO_ENGINE_SUBSTITUTION"
socket = {{ socket }} socket = {{ socket }}
bind_address = {{ parameter_dict['ip'] }}
datadir = {{ parameter_dict['data-directory'] }} datadir = {{ parameter_dict['data-directory'] }}
pid_file = {{ parameter_dict['pid-file'] }} pid_file = {{ parameter_dict['pid-file'] }}
default_time_zone = '+00:00'
plugin_load = ha_mroonga
max_connections = {{ parameter_dict['max-connection-count'] }}
{% set innodb_buffer_pool_size = parameter_dict['innodb-buffer-pool-size'] -%} {% set innodb_buffer_pool_size = parameter_dict['innodb-buffer-pool-size'] -%}
{% if innodb_buffer_pool_size %}innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}{% endif %} {% if innodb_buffer_pool_size %}innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}{% endif %}
{% set innodb_buffer_pool_instances = parameter_dict['innodb-buffer-pool-instances'] -%} {% set innodb_buffer_pool_instances = parameter_dict['innodb-buffer-pool-instances'] -%}
...@@ -62,9 +55,6 @@ ssl-cipher = {{ parameter_dict['ssl-cipher'] }} ...@@ -62,9 +55,6 @@ ssl-cipher = {{ parameter_dict['ssl-cipher'] }}
{{x}}innodb_doublewrite = 0 {{x}}innodb_doublewrite = 0
{{x}}sync_frm = 0 {{x}}sync_frm = 0
# Force utf8 usage
character_set_server = utf8mb4
collation_server = utf8mb4_general_ci
skip_character_set_client_handshake skip_character_set_client_handshake
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment