1.在啟動CDH中master的服務cloudera-scm-server start並立刻掛掉了,提示如下錯誤
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cloudera.server.cmf.TrialState': Cannot resolve reference to bean 'entityManagerFactoryBean' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactoryBean': FactoryBean threw exception on object creation; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: cmf.server] Unable to build EntityManagerFactory at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
2.問題出現的原因,是因為連接到mysql的scm庫出錯了。
①首先查看連接到mysql的scm庫的配置文件db.properties是否正常。
一般情況下位置在 /opt/cm-5.16.1/etc/cloudera-scm-server
②看看里面的配置是否正確
# The database type # Currently 'mysql', 'postgresql' and 'oracle' are valid databases. com.cloudera.cmf.db.type=mysql # The database host # If a non standard port is needed, use 'hostname:port' com.cloudera.cmf.db.host=localhost #ip和端口 # The database name com.cloudera.cmf.db.name=scm #庫名 # The database user com.cloudera.cmf.db.user=scm #庫用戶,要在數據庫中確認一下用戶權限 # The database user's password
com.cloudera.cmf.db.password=scm #庫密碼 # The db setup type # By default, it is set to INIT # If scm-server uses Embedded DB then it is set to EMBEDDED # If scm-server uses External DB then it is set to EXTERNAL com.cloudera.cmf.db.setupType=INIT #master為EXTERNAL,slave為INIT
③其實最好的測試辦法,就是直接使用用戶名和密碼登錄mysql看看是否能正常訪問scm庫。
3.重啟master后可用了。
slave可能會出現下面報錯:nested exception is java.lang.RuntimeException: ScmActive at bootup: Failed to validate the identity of Cloudera Manager.
在下一篇《CDH報錯:ScmActive at bootup: Failed to validate the identity of Cloudera Manager.》中進行解決。
以上。