CDH断电后cloudera-scm-server启动报错
报错背景:
CDH未关闭的情况下,Linux断电,导致cloudera-scm-server无法启动。
报错现象:
输入启动命令之后:/opt/cm-5.15.1/etc/init.d/cloudera-scm-server start,
cloudera-scm-server 会启动,但是几秒中之后就会死掉,显示:cloudera-scm-server 已死,但 pid 文件存在。
于是查看日志文件:vim /opt/cm-5.15.1/log/cloudera-scm-server/cloudera-scm-server.log,
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: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory$.getObject(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:)
at com.cloudera.server.cmf.Main.bootstrapSpringContext(Main.java:)
at com.cloudera.server.cmf.Main.<init>(Main.java:)
at com.cloudera.server.cmf.Main.main(Main.java:)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactoryBean': FactoryBean threw exception on object creation; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:)
... more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:)
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:)
at com.cloudera.enterprise.AbstractWrappedEntityManager.beginForRollbackAndReadonly(AbstractWrappedEntityManager.java:)
at com.cloudera.enterprise.dbutil.DbUtil.isInnoDbEnabled(DbUtil.java:)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.checkMysqlTableEngineType(EntityManagerFactoryBean.java:)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.getObject(EntityManagerFactoryBean.java:)
at com.cloudera.server.cmf.bootstrap.EntityManagerFactoryBean.getObject(EntityManagerFactoryBean.java:)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:)
... more
Caused by: org.hibernate.exception.GenericJDBCException: Could not open connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doBegin(JdbcTransaction.java:)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.begin(AbstractTransactionImpl.java:)
at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:)
... more
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:)
at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:)
... more
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:)
... more
Caused by: java.sql.SQLException: Access denied for user 'scm'@'master' (using password: YES)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:)
at sun.reflect.GeneratedConstructorAccessor5.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:)
at java.lang.reflect.Constructor.newInstance(Constructor.java:)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool.access$(BasicResourcePool.java:)
at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:)
报错原因:
日志里面写的很清楚,
原因:Access denied for user 'scm'@'master' (using password: YES)
翻译:用户“scm”@“主机”拒绝访问(使用密码:是)
为什么会拒绝访问呢?一头雾水啊!!!
分析以下,拒绝访问可能是没有权限访问,或者MySQL数据库没有启动。
首先排除MySQL数据库没有启动的原因,接下来就是寻找没有访问权限的原因了。
根据百度的结果,大部分造成此种结果的原因是没有提供MySQL的远程访问权限。
但是我很确定当时我已经设置了MySQL数据库开放远程访问权限。
走投无路,只能死马当作活马医了,重新开放权限。
报错解决:
[root@master sources]# mysql -uroot -proot
mysql> use mysql; mysql> select host,user,password from user; mysql> update user set password=password('root') where user='root'; mysql> grant all privileges on *.* to 'root'@'master' identified by 'root'; --'root'@'%'中 %代表所有主机
但是执行到上面这一步的时候又报错:
Access denied for user 'root'@'master' (using password: YES)
这次我是彻底懵逼了,为了解决权限的错误执行的命令竟然报出权限的错误。
在网上找了很长时间也没有找到解决方案,于是我只能重装数据库了。
重装完成数据库之后,再次执行赋予远程登录的权限就成功了。
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> select host,user,password from user;
+-----------+------+-------------------------------------------+
| host | user | password |
+-----------+------+-------------------------------------------+
| localhost | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| master | root | *D2338747885A51AACEED4A7276143CB759A5B844 |
| 127.0.0.1 | root | *D2338747885A51AACEED4A7276143CB759A5B844 |
| ::1 | root | *D2338747885A51AACEED4A7276143CB759A5B844 |
+-----------+------+-------------------------------------------+
4 rows in set (0.00 sec) mysql> update user set password=password('root') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 4 Changed: 3 Warnings: 0 mysql> grant all privileges on *.* to 'root'@'master' identified by 'root';
Query OK, 0 rows affected (0.00 sec) mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql> exit
Bye
然后再执行数据库初始化
/opt/cm-5.15.1/share/cmf/schema/scm_prepare_database.sh mysql cm -hmaster -uroot -proot --scm-host master scm scm scm
参数分别是: 数据库类型 数据库名称 -h数据库主机名 -u数据库用户名 -p数据库密码--scm-host cmserver主机名 scm scm scm
主节点:通过/bigdata/cm-5.15.1/etc/init.d/cloudera-scm-server start启动服务端
[root@master /]# /opt/cm-5.15.1/etc/init.d/cloudera-scm-server start
这个时候cloudera-scm-server就不会挂掉了
CDH断电后cloudera-scm-server启动报错的更多相关文章
- Eclipse导入Maven项目,使用server 启动报错,class 找不到,
问题发现: 1.导入maven 项目后,用server 启动,选择项中没有这个项目 解决: 说明server 没有把该项目当成web项目,需要设置 项目右键 properties ---- proj ...
- Tomcat Server启动报错:Multiple Contexts have a path of "/east".
原因是 conf/server.xml 文件中多了一个<Context></Context>标签,路径有重复,把他删掉就好了.
- Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024)的解决
1.1.Windows 8.1升级至Windows 10后,启动VisualSVN Server Manager报错:提供程序无法执行所尝试的操作 (0x80041024),VisualSVN Ser ...
- idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost connection toMySQL server at
我是使用navicat的windows端 连接centos下mysql服务器 第一次常规连接mysql正常,idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost co ...
- eclipse tomcat路径更改后启动报错
eclipse tomcat路径更改后启动报错 CreateTime--2018年5月3日14:48:22 Author:Marydon 1.情景还原 2.原因 本地的tomcat路径修改后,ec ...
- Hadoop0.20.203.0在关机重启后,namenode启动报错(/dfs/name is in an inconsistent state)
Hadoop0.20.203.0在关机重启后,namenode启动报错: 2011-10-21 05:22:20,504 INFO org.apache.hadoop.hdfs.server.comm ...
- windows修改系统登录密码后,出现SQLserver服务无法启动,启动报错17051
windows修改系统登录密码后,出现SQLserver服务无法启动,启动报错17051具体报错如下: 根据错误提示,去到windows的事件查看器.在win10上,右击左下角的菜单图标:然后依次点击 ...
- 安装mongodb后启动报错libstdc++
安装mongo后启动报错如下图 显然说是libstdc++.so文件版本的问题,这种一般都是gcc版本太低了 接着查询gcc的版本 strings /usr/lib/libstdc++.so.6 ...
- CDH Spark-shell启动报错
Spark-shell启动报错 具体报错如下: 在CDH YARN 中修改以下两个配置: yarn.scheduler.maximum-allocation-mb 2048 yarn.no ...
- MySQL5.6启动报错The server quit without updating PID file
Mysql启动报错如下: [root@db01 opt]# service mysqld start Starting MySQL.... ERROR! The server quit without ...
随机推荐
- web移动端类型检测
移动端检测 插件通用下载: https://www.bootcdn.cn/ 根据一个库 device.js 下载地址 传送 api 传送 和 传送 常用检测类型 device.ipad() 返回一个布 ...
- 2018-软工机试-B- 梵高先生
B. 梵高先生 单点时限: 1.0 sec 内存限制: 256 MB 谁的父亲死了 请你告诉我如何悲伤 谁的爱人走了 请你告诉我如何遗忘 ——李志<梵高先生> 2009年的最后一天 在义乌 ...
- 2018-08 【bug汇总】
1. 问题描述:更细参数时更新失败. 报错信息:无报错信息,返回为成功. 问题分析:代码查看逻辑无问题.说明可能不是逻辑的问题,dubug查看发现,参数并没有传入进来,查看传递参数的requestBe ...
- Power BI 3-4月功能更新培训合集
Power BI 3-4月功能更新培训合集 Power BI每月功能的更新,都有很多大咖精辟解读,我们一直也都是积极中期待,相信所有P友如是或更甚. 视频学习可以结合微软Power BI 3-4月文 ...
- 【转载】 什么是AutoML
文章来源:企鹅号 - 仲耀晖的碎碎念 tzattack Studio presents 来源:Google AI Blog 编译:仲耀晖 ------------------------------- ...
- wireshark 无线抓包
1)抓取无线网卡的数据包(类似有线,仅抓取本网卡的数据包,适用与windows,linux) 1. 打开菜单项“Capture”下的子菜单“Capture Options”选项: 2. 找到设置面 ...
- appium---android元素定位
原文链接:https://www.cnblogs.com/meitian/p/6103391.html 一.常用识别元素的工具 uiautomator:Android SDK自带的一个工具,在tool ...
- MATLAB实现二值化函数
function bc = binary_conversion(a) %这是灰度值二值化转换函数,阈值为平均值j=imread(a); %读取灰度图像 j=double ...
- vue 图片加载失败调用
<img :src="bak" @error="imgLoadError()" alt="bak"> data(){ retur ...
- Springboot 使用过滤器进行加密解密(二)
之前写过一篇关于过滤器实现加密解密功能的文章,但是在实际开发业务中发现,还是有一些问题的,在此特地说明. 第一:过滤器走两遍的问题: 1.过滤器上,添加了两个注解 第一个:@Compent 将此F ...