Fix venus when proxysql used

This patch fixes defaults for venus
so it can be used with proxysql turned on

Closes-Bug: #2066937
Change-Id: I0d2eb3ea6c50801a94139312399c8f8df092b4d3
This commit is contained in:
Michal Arbet 2024-05-23 17:32:54 +02:00
parent 09067aa0cd
commit 39fa523be4
2 changed files with 15 additions and 2 deletions

View File

@ -42,6 +42,19 @@ venus_database_name: "venus"
venus_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}venus{% endif %}"
venus_database_address: "{{ database_address | put_address_in_context('url') }}:{{ database_port }}"
####################
# Database sharding
####################
venus_database_shard_root_user: "{% if enable_proxysql | bool %}root_shard_{{ venus_database_shard_id }}{% else %}{{ database_user }}{% endif %}"
venus_database_shard_id: "{{ mariadb_default_database_shard_id | int }}"
venus_database_shard:
users:
- user: "{{ venus_database_user }}"
password: "{{ venus_database_password }}"
rules:
- schema: "{{ venus_database_name }}"
shard_id: "{{ venus_database_shard_id }}"
####################
# Docker

View File

@ -7,7 +7,7 @@
module_args:
login_host: "{{ database_address }}"
login_port: "{{ database_port }}"
login_user: "{{ database_user }}"
login_user: "{{ venus_database_shard_root_user }}"
login_password: "{{ database_password }}"
name: "{{ venus_database_name }}"
run_once: True
@ -23,7 +23,7 @@
module_args:
login_host: "{{ database_address }}"
login_port: "{{ database_port }}"
login_user: "{{ database_user }}"
login_user: "{{ venus_database_shard_root_user }}"
login_password: "{{ database_password }}"
name: "{{ venus_database_user }}"
password: "{{ venus_database_password }}"