-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postfixadmin using replicated database #809
Comments
I think the easiest solution would be to install/setup PostfixAdmin on a standalone database server, then do a dump of that database and then restore onto the galera one. This will avoid the 'invalid' tables (assuming we've patched them all over time so they're all now acceptable!). |
Genius. I didn't think of that. I was also thinking of another solution. On Galera clusters in the /etc/mysql/mariadb.conf.d/60-galera.cnf file the setting innodb_force_primary_key = 1 is used to ensure all tables added to the cluster have a primary key. I THINK you could also set this is 0 on all nodes in the cluster which would allow update.php to add the correct tables. Assuming the primary keys are added later you can switch it back to 1 after PFA install. I will report back once I have tried one of these options. Thanks @DavidGoodwin |
Update. I decided to try to change the cluster settings to allow tables to be imported without a primary key. This worked but it crashed my cluster when I restarted it. For anyone else needing to do this, I would use @DavidGoodwin suggestion and set up PFA in a non-replication environment then dump and import the database to the replication cluster. ESPECIALLY IF YOU HAVE DATA IN YOUR CLUSTER. Mine is a new cluster so it didn't matter. If you don't have any data in your database cluster I would use my option as it's slightly faster, Process below.
You will probably want to force primary keys again after you have got PFA installed. Thanks again @DavidGoodwin |
Hi Everyone!
Can someone provide me with some help? I'm having a terrible time trying to get PFA working on a Galera cluster. When running setup.php its trying to create the domain_admins table but without a primary key so it fails.
CREATE TABLE IF NOT EXISTS
domain_admins(
usernamevarchar(255) NOT NULL default '',
domainvarchar(255) NOT NULL default '',
createddatetime NOT NULL default '2000-01-01 00:00:00',
activetinyint(1) NOT NULL default '1', KEY username (
username) ) CHARACTER SET latin1 COLLATE latin1_general_ci COMMENT='Postfix Admin - Domain Admins';
I looked at upgrade.php and could see in the code it was missing a primary key for that table so I added it. Next I got an error about the log table was also missing a primary key so I added that. I ran setup.php again.
I then got an error about duplicate primary keys.
ALTER TABLE
domain_adminsADD COLUMN id int(11) not null auto_increment primary key
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined
How do I get this working. I need to add a primary key to the table to install this but somewhere later on you are adding another key to the table.
I already saw the #475 thread but the modifications in that upgrade.php file do not work.
I'm stuck!
The text was updated successfully, but these errors were encountered: