Closed yingw closed 6 years ago
和现有 config-server 整合是否需要对现有 server 的 db 查询方式作出调整,spring 官方例子的 db 是 properties:
CREATE TABLE `properties` ( `id` int(11) NOT NULL, `key` varchar(50) NOT NULL, `value` varchar(500) NOT NULL, `application` varchar(50) NOT NULL, `profile` varchar(50) NOT NULL, `label` varchar(50) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
就一张表,查询语句:
spring.cloud.config.server.jdbc.sql=SELECT `KEY`, `VALUE` from `properties` where APPLICATION=? and PROFILE=? and LABEL=?
plugin-db 中配置为:
spring.cloud.config.server.jdbc.sql=select `p_key`, `p_value` from property where application=? and profile=? and label=?
但是这个 property 表没有创建。将现有config server改成这个表和字段,也查不出当前配置信息,从配置中心获取可以(Eureka)
对spring官方创建表的话,建议是把key和value两个列名改成p_key和p_value,不然管理部分的orm框架映射不上
谢谢,那我就改两个字段名吧。
和现有 config-server 整合是否需要对现有 server 的 db 查询方式作出调整,spring 官方例子的 db 是 properties:
就一张表,查询语句:
plugin-db 中配置为:
但是这个 property 表没有创建。将现有config server改成这个表和字段,也查不出当前配置信息,从配置中心获取可以(Eureka)