尝试在 3 个 centos7 节点上安装 HDP 集群(用于测试/评估目的),当被要求为 Ranger 和 Ranger KMS 配置数据库时,我遇到了错误。
在运行 Ambari 自动数据库和数据库用户设置的连接测试时,看到错误表明节点无法连接。
2019-07-18 16:22:02,448 - Check db_connection_check was unsuccessful. Exit code: 1. Message: ERROR: Unable to connect to the DB. Please check DB connection properties. java.sql.SQLException: null, message from server: "Host 'HW02.co.local' is not allowed to connect to this MySQL server"
Traceback (most recent call last): File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 546, in <module> CheckHost().execute() File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute method(env) File "/var/lib/ambari-agent/cache/custom_actions/scripts/check_host.py", line 207, in actionexecute raise Fail(error_message) resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: ERROR: Unable to connect to the DB. Please check DB connection properties. java.sql.SQLException: null, message from server: "Host 'HW02.co.local' is not allowed to connect to this MySQL server"
我在数据节点上有一个新安装的 MySQL 服务器并且可以运行
mysql -u root -p -h localhost`
但得到错误
mysql -u root -p -h <some remote cluster node>`
投掷
错误 2003 (HY000): 无法连接到 MySQL 服务器上的 '' (111)
mysql 配置文件看起来绑定到所有接口......
[root@HW03 ~]# cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
bind-address=0.0.0.0
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
所以不确定问题可能是什么。
对 MySQL 或 DBA 不是很有经验。对此有任何调试建议或修复吗?