JavaEar 专注于收集分享传播有价值的技术资料

Caused by:Ambari Upgradation java.sql.SQLSyntaxErrorException: Unknown table 'hostcomponentstate' in information_schema

I'm trying to upgrade Ambari 2.1 to 2.5.

Steps followed:

Stopped ambari-server

Took backup of ambari database from MySql database.

Ran ambari-server upgrade.

I'm getting this SQL Error,

Exception in thread "main" org.apache.ambari.server.AmbariException: Unknown table 'hostcomponentstate' in information_schema
    at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:212)
    at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:427)
Caused by: java.sql.SQLSyntaxErrorException: Unknown table 'hostcomponentstate' in information_schema
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:536)
    at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
    at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:1983)
    at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:1936)
    at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1422)
    at com.mysql.cj.jdbc.DatabaseMetaData$7.forEach(DatabaseMetaData.java:3182)
    at com.mysql.cj.jdbc.DatabaseMetaData$7.forEach(DatabaseMetaData.java:3170)
    at com.mysql.cj.jdbc.IterateBlock.doForAll(IterateBlock.java:50)
    at com.mysql.cj.jdbc.DatabaseMetaData.getPrimaryKeys(DatabaseMetaData.java:3223)
    at org.apache.ambari.server.orm.DBAccessorImpl.tableHasPrimaryKey(DBAccessorImpl.java:1082)
    at org.apache.ambari.server.upgrade.UpgradeCatalog211.executeHostComponentStateDDLUpdates(UpgradeCatalog211.java:204)
    at org.apache.ambari.server.upgrade.UpgradeCatalog211.executeDDLUpdates(UpgradeCatalog211.java:108)
    at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:925)
    at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:209)
    ... 1 more

Am I missing any step or any configuration change is required?

1个回答

    最佳答案
  1. You may try upgrading first to Ambari 2.2.x

    Not sure that such a long upgrade path works flawlessly