本文主要是介绍CDH-CDH .InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天,我启动了 cdh 遇到了启动不起来的问题,我通过排查日志,定位到了出错的原因。
日志目录: /var/log/cloudera-scm-server
出错的异常日志:
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.at sun.reflect.GeneratedConstructorAccessor37.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)... 12 more
可以看到是时区不能识别的问题,我们通过这篇博客
https://community.cloudera.com/t5/Cloudera-Manager-Installation/Embedded-to-External-mysql-Cloudera-Manager-is-not-starting/td-p/77219
受到了一定的启发,最终定位是系统的时区 与 cdh 外部存储的时区 不一致导致的。
我们看下本地的系统时区:
[root@cdh-manager cloudera-scm-server]# date
Tue Apr 2 16:25:07 CST 2019
可以看到是 cst 时区,东八区,而 MySQL 默认是 EDT 时区,我们这里修改下 MySQL 的时区,
我们通过修改配置文件的方式,永久修改MySQL 时区。
[root@cdh-manager log]# vim /etc/my.cnf[mysqld]
#设置时区
default-time-zone = '+8:00'
修改过后,在MySQL 执行如下查询:
mysql> show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | EDT |
| time_zone | +08:00 |
+------------------+--------+
可以看到时区修改为了CST 时区。最终再次启动 server 服务:
systemctl restart cloudera-scm-server
最终服务启动:
[root@cdh-manager mysql]# netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.75.133:9000 0.0.0.0:* LISTEN 11081/python2
tcp 0 0 192.168.75.133:9868 0.0.0.0:* LISTEN 18752/java
tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 18158/java
tcp 0 0 0.0.0.0:5678 0.0.0.0:* LISTEN 18691/java
tcp 0 0 192.168.75.133:9870 0.0.0.0:* LISTEN 18779/java
tcp 0 0 0.0.0.0:7182 0.0.0.0:* LISTEN 18158/java
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:7184 0.0.0.0:* LISTEN 18675/java
tcp 0 0 0.0.0.0:7185 0.0.0.0:* LISTEN 18675/java
tcp 0 0 192.168.75.133:8083 0.0.0.0:* LISTEN 18691/java
tcp 0 0 0.0.0.0:8084 0.0.0.0:* LISTEN 18675/java
tcp 0 0 192.168.75.133:8020 0.0.0.0:* LISTEN 18779/java
tcp 0 0 0.0.0.0:10101 0.0.0.0:* LISTEN 18689/java
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 10295/dnsmasq
tcp 0 0 127.0.0.1:7190 0.0.0.0:* LISTEN 21246/python2
tcp 0 0 192.168.75.133:8022 0.0.0.0:* LISTEN 18779/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9700/sshd
tcp 0 0 0.0.0.0:7191 0.0.0.0:* LISTEN 21246/python2
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 9695/cupsd
tcp 0 0 192.168.75.133:8088 0.0.0.0:* LISTEN 18617/java
tcp 0 0 127.0.0.1:19001 0.0.0.0:* LISTEN 9703/python2
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 10260/master
tcp 0 0 0.0.0.0:9083 0.0.0.0:* LISTEN 18628/java
tcp 0 0 192.168.75.133:8030 0.0.0.0:* LISTEN 18617/java
tcp 0 0 192.168.75.133:8031 0.0.0.0:* LISTEN 18617/java
tcp 0 0 192.168.75.133:8032 0.0.0.0:* LISTEN 18617/java
tcp 0 0 192.168.75.133:8033 0.0.0.0:* LISTEN 18617/java
tcp6 0 0 127.0.0.1:46471 :::* LISTEN 18764/java
tcp6 0 0 :::24042 :::* LISTEN 18764/java
tcp6 0 0 :::3306 :::* LISTEN 18060/mysqld
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 127.0.0.1:9393 :::* LISTEN 18764/java
tcp6 0 0 :::22 :::* LISTEN 9700/sshd
tcp6 0 0 :::7191 :::* LISTEN 21246/python2
tcp6 0 0 ::1:631 :::* LISTEN 9695/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 10260/master
tcp6 0 0 192.168.75.133:9092 :::* LISTEN 18764/java
tcp6 0 0 :::42468 :::* LISTEN 18764/java
You have new mail in /var/spool/mail/root
这篇关于CDH-CDH .InvalidConnectionAttributeException: The server time zone value 'EDT' is unrecognized的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!