voxpupuli / puppet-proxysql

Puppet module to configure ProxySQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing configuration directives

damo2929 opened this issue · comments

  • Puppet: 5
  • Module version: v2

module doesn't support all the configuration directive the upstream proxysql package does as such you can't template all the needed functionality with this class.

What are you seeing

[root@testbox temp-puppet-rhel7]# puppet apply proxysql.pp
Error: no parameter named 'writer_is_also_reader' (file: /root/temp-puppet-rhel7/proxysql.pp, line: 120) on Proxy_mysql_replication_hostgroup[30-31] (file: /root/temp-puppet-rhel7/proxysql.pp, line: 120) on node testbox

proxy_mysql_replication_hostgroup { '30-31':
	writer_hostgroup => 30,
	reader_hostgroup => 31,
	writer_is_also_reader => 0,
	max_writers => 1,
	comment => 'Zabbix cluster: ensure all read and write traffic goes to a single active master' 
}

What behaviour did you expect instead

the variables to be mapped up to the configuration field values so that the host groups can be configured in a way that matches the proxysql v4 manual.

checked module readme and double check. and there is definitely an issue

issue is also happening with max_writers also

[root@testbox temp-puppet-rhel7]# puppet apply proxysql.pp
Error: no parameter named 'max_writers' (file: /root/temp-puppet-rhel7/proxysql.pp, line: 120) on Proxy_mysql_replication_hostgroup[30-31] (file: /root/temp-puppet-rhel7/proxysql.pp, line: 120) on node testbox

You are mixing replication hostgroup with group replication hostgroup...

ok so I have changed it to

proxy_mysql_group_replication_hostgroup { '30-32-31-33':
	writer_hostgroup => 30,
	reader_hostgroup => 31,
	backup_writer_hostgroup => 32,
	offline_hostgroup       => 33,
	writer_is_also_reader => 0,
	max_writers => 1,
	comment => 'Zabbix cluster: ensure all read and write traffic goes to a single active master' 
}

but still get

Error: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'proxy_mysql_group_replication_hostgroup' (file: /root/temp-puppet-rhel7/proxysql.pp, line: 120, column: 2)

are you using the correct version of the module? this is also how we run the acceptance tests:

proxy_mysql_group_replication_hostgroup { '5-2-10-11':
ensure => 'present',
reader_hostgroup => 10,
writer_hostgroup => 5,
backup_writer_hostgroup => 2,
offline_hostgroup => 11,
comment => 'Test MySQL GR Cluster 5-2-10-11',
}

I have fresh pupped the unit down from puppet forge after removing it just to check.

puppet module list
/etc/puppetlabs/code/environments/production/modules
├── camptocamp-kmod (v2.2.0)
├── camptocamp-systemd (v2.0.0)
├── herculesteam-augeasproviders_core (v2.1.4)
├── herculesteam-augeasproviders_mounttab (v2.0.3)
├── herculesteam-augeasproviders_pam (v2.1.1)
├── herculesteam-augeasproviders_ssh (v3.0.0)
├── herculesteam-augeasproviders_sysctl (v2.2.0)
├── puppet-corosync (v6.0.1)
├── puppet-proxysql (v2.0.0)
├── puppet-selinux (v1.5.2)
├── puppet-staging (v3.2.0)
├── puppet-zabbix (v6.4.2)
├── puppetlabs-accounts (v2.0.0)
├── puppetlabs-apache (v2.3.1)
├── puppetlabs-apt (v4.5.1)
├── puppetlabs-concat (v4.2.1)
├── puppetlabs-firewall (v1.12.0)
├── puppetlabs-mount_providers (v1.0.0)
├── puppetlabs-mysql (v6.2.0)
├── puppetlabs-pe_gem (v0.2.0)
├── puppetlabs-postgresql (v5.7.0)
├── puppetlabs-ruby (v1.0.0)
├── puppetlabs-stdlib (v4.25.1)
├── puppetlabs-translate (v1.1.0)
├── saz-limits (v3.0.2)
└── saz-sudo (v5.0.0)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)

so under version 2 I can't use the group directives they just crash
if I use my original config that worked on the version 1.1.2 I get connection errors

Notice: /Stage[main]/Proxysql::Service/Service[proxysql]: Triggered 'refresh' from 1 event
Notice: /Stage[main]/Proxysql::Service/Exec[wait_for_admin_socket_to_open]: Triggered 'refresh' from 1 event
Notice: /Stage[main]/Proxysql::Admin_credentials/File[root-mycnf-file]/content: content changed '{md5}a0a9c4018eb982760654f5d2c505a3bf' to '{md5}2b8d03384a8b838f361ae8799c5be27e'
Notice: /Stage[main]/Proxysql::Reload_config/Exec[reload-config]/returns: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/proxysql_admin.sock' (111)
Error: /Stage[main]/Proxysql::Reload_config/Exec[reload-config]: Failed to call refresh: '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf --execute="
LOAD ADMIN VARIABLES FROM CONFIG; LOAD ADMIN VARIABLES TO RUNTIME; SAVE ADMIN VARIABLES TO DISK; LOAD MYSQL VARIABLES FROM CONFIG; LOAD MYSQL VARIABLES TO RUNTIME; SAVE MYSQL VARIABLES TO DISK; "
' returned 1 instead of one of [0]
Error: /Stage[main]/Proxysql::Reload_config/Exec[reload-config]: '/usr/bin/mysql --defaults-extra-file=/root/.my.cnf --execute="
LOAD ADMIN VARIABLES FROM CONFIG; LOAD ADMIN VARIABLES TO RUNTIME; SAVE ADMIN VARIABLES TO DISK; LOAD MYSQL VARIABLES FROM CONFIG; LOAD MYSQL VARIABLES TO RUNTIME; SAVE MYSQL VARIABLES TO DISK; "
' returned 1 instead of one of [0]
Notice: /Stage[main]/Proxysql/Anchor[proxysql::end]: Dependency Exec[reload-config] has failures: true
Warning: /Stage[main]/Proxysql/Anchor[proxysql::end]: Skipping because of failed dependencies
Error: Failed to apply catalog: Execution of '/bin/mysql --defaults-extra-file=/root/.my.cnf -NBe SELECT hostname, port, hostgroup_id FROM mysql_servers' returned 1: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/proxysql_admin.sock' (111)

It's only in the Master, not in v2.0.0. I think you have to user master or wait for next Version.