Created on 02-03-2016 06:09 PM - edited 09-16-2022 03:01 AM
ambari upgrade
upgrading ambari-server from 1.7 to 2.2 with mysql 5.6
while running ambari-server upgrade it failed with org.apache.ambari.server.AmbariException: Cannot add foreign key constraint
any work around, i couldn't even create the FK manually either.. is it a known issue?
Created 02-05-2016 12:33 AM
This is known issue for MYSQL DBs and we need to convert all the tables to use InnoDB engine.
You can use the below SQL to generate the commands to alter the tables to InnoDB engine.
SELECT concat('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES
WHERE TABLE_SCHEMA = 'ambaridb' AND ENGINE = 'MyISAM' AND TABLE_TYPE='BASE TABLE';
Once we get the output , remove the ' | ' and run the alter commands.
Once we run alter commands, commit and exit mysql.
and than run ambari-server upgrade.
Created 02-05-2016 12:33 AM
This is known issue for MYSQL DBs and we need to convert all the tables to use InnoDB engine.
You can use the below SQL to generate the commands to alter the tables to InnoDB engine.
SELECT concat('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM Information_schema.TABLES
WHERE TABLE_SCHEMA = 'ambaridb' AND ENGINE = 'MyISAM' AND TABLE_TYPE='BASE TABLE';
Once we get the output , remove the ' | ' and run the alter commands.
Once we run alter commands, commit and exit mysql.
and than run ambari-server upgrade.
Created 02-05-2016 12:35 AM
@Raja Sekhar Chintalapati did that solve your issue?