技术交流QQ群 729987144
nacos docker集群 发布失败。请检查参数是否正确。
caused: PreparedStatementCallback; bad SQL grammar [SELECT id,data_id,group_id,tenant_id,app_name,content,md5,gmt_create,gmt_modified,src_user,src_ip,c_desc,c_use,effect,type,c_schema,encrypted_data_key FROM config_info WHERE data_id=? AND group_id=? AND tenant_id=?]; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘encrypted_data_key’ in ‘field list’;caused: Unknown column ‘encrypted_data_key’ in ‘field list’;

解决问题

  • 1.在config_info表中增加 config_info.encrypted_data_key字段
  • 2.在his_config_info 表中增加 his_config_info .encrypted_data_key字段

1.按照官方文档docker-nacos集群部署

官网链接 https://nacos.io/zh-cn/docs/quick-start-docker.html
1.下载

git clone https://github.com/nacos-group/nacos-docker.git
cd nacos-docker

2.部署

  • 单机部署
docker-compose -f example/standalone-derby.yaml up
  • 单机mysql5.7
docker-compose -f example/standalone-mysql-5.7.yaml up
  • 单机mysql8
docker-compose -f example/standalone-mysql-8.yaml up
  • 集群部署
docker-compose -f example/cluster-hostname.yaml up 

执行集群部署后会发现一直卡在mysql这里,访问浏览器也是报错
在这里插入图片描述
再次停止 继续执行
在这里插入图片描述

看似执行成功了 但是更改配置会报错
在这里插入图片描述
caused: PreparedStatementCallback; bad SQL grammar [SELECT id,data_id,group_id,tenant_id,app_name,content,md5,gmt_create,gmt_modified,src_user,src_ip,c_desc,c_use,effect,type,c_schema,encrypted_data_key FROM config_info WHERE data_id=? AND group_id=? AND tenant_id=?]; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘encrypted_data_key’ in ‘field list’;caused: Unknown column ‘encrypted_data_key’ in ‘field list’;
caused: PreparedStatementCallback; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘encrypted_data_key’ in ‘field list’;caused: Unknown column ‘encrypted_data_key’ in ‘field list’;

解决错误 因为config_info查找的时候有 encrypted_data_key 实际上表里面没有,就会导致增加配置报错的问题
解决办法 连接数据库 增加这个字段 config_info.encrypted_data_key

在这里插入图片描述

但是再次添加配置的时候还是报错

在这里插入图片描述

错误原因 caused: PreparedStatementCallback; bad SQL grammar [INSERT INTO his_config_info (id,data_id,group_id,tenant_id,app_name,content,md5,src_ip,src_user,gmt_modified,op_type,encrypted_data_key) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)]; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘encrypted_data_key’ in ‘field list’;caused: Unknown column ‘encrypted_data_key’ in ‘field list’;
这次是 his_config_info 缺少 encrypted_data_key
在这个表中增加这个字段 完美解决

在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐