这篇文章给大家分享的是有关CDP安装SMM服务启动异常怎么办的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
报错信息为:
Exception in thread "main" org.flywaydb.core.api.FlywayException: Unable to instantiate JDBC driver: com.mysql.cj.jdbc.Driver => Check whether the jar file is present
at org.flywaydb.core.internal.util.jdbc.DriverDataSource.<init>(DriverDataSource.java:142)
at org.flywaydb.core.api.configuration.ClassicConfiguration.setDataSource(ClassicConfiguration.java:1147)
at org.flywaydb.core.Flyway.setDataSource(Flyway.java:712)
at com.hortonworks.registries.storage.tool.sql.SchemaFlywayFactory.mysqlFlyway(SchemaFlywayFactory.java:58)
at com.hortonworks.registries.storage.tool.sql.SchemaFlywayFactory.get(SchemaFlywayFactory.java:44)
at com.hortonworks.registries.storage.tool.sql.TablesInitializer.main(TablesInitializer.java:176)
Caused by: org.flywaydb.core.api.FlywayException: Unable to instantiate class com.mysql.cj.jdbc.Driver : com.mysql.cj.jdbc.Driver
at org.flywaydb.core.internal.util.ClassUtils.instantiate(ClassUtils.java:61)
at org.flywaydb.core.internal.util.jdbc.DriverDataSource.<init>(DriverDataSource.java:132)
... 5 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
根据报错分析是找不到JDBC驱动。在CDP7.1中SMM和SchemaRegistry必须将mysql-connector-java.jar放在自己的库目录中,而我们默认是放在/usr/share/java中的。所以这里我们需要把JDBC驱动放置到需要的库中。
1.把JDBC驱动分别软链到SMM和SchemaRegistry的库目录中
[root@cdh03 java]# cd /opt/cloudera/parcels/CDH/lib/schemaregistry/bootstrap/lib
[root@cdh03 lib]# ln -s /usr/share/java/mysql-connector-java.jar
[root@cdh03 lib]# cd /opt/cloudera/parcels/CDH/lib/schemaregistry/libs
[root@cdh03 libs]# ln -s /usr/share/java/mysql-connector-java.jar
[root@cdh03 libs]# cd /opt/cloudera/parcels/CDH/lib/streams_messaging_manager/bootstrap/lib
[root@cdh03 lib]# ln -s /usr/share/java/mysql-connector-java.jar
[root@cdh03 lib]# cd /opt/cloudera/parcels/CDH/lib/streams_messaging_manager/libs
[root@cdh03 libs]# ln -s /usr/share/java/mysql-connector-java.jar
2.配置完之后,从CM启动服务测试
重启成功,异常解决。
在CDP7.1中SMM和SchemaRegistry必须将JDBC驱动放在自己的库目录中,这跟以前默认的地址/usr/share/java不同,需要手动进行配置。
感谢各位的阅读!关于“CDP安装SMM服务启动异常怎么办”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。