这个问题已经解决了,但是部署的时候又出现了新的问题
日志详情如下
### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘todo_service.mgmt_service’ doesn’t exist
### The error may exist in io/choerodon/config/mapper/ServiceMapper.java (best guess)
### The error may involve io.choerodon.config.mapper.ServiceMapper.selectOne-Inline
### The error occurred while setting parameters
### SQL: SELECT creation_date,created_by,last_update_date,last_updated_by,object_version_number,id,name FROM mgmt_service WHERE name = ? limit 1
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘todo_service.mgmt_service’ doesn’t exist
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘todo_service.mgmt_service’ doesn’t exist
2019-02-26 16:52:29.247 INFO [-,] 8 — [ Thread-4] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@15327b79: startup date [Tue Feb 26 16:52:19 CST 2019]; root of context hierarchy
2019-02-26 16:52:29.249 INFO [-,] 8 — [ Thread-4] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
我这个应用中没有用到 mgmt_service这个表,为什么会有这种提示呢?
部署的配置信息如下:
replicaCount: 1
image:
repository: registry.example.choerodon.io/operation-test/choerodon-todo-service
pullPolicy: Always
preJob:
preConfig:
configFile: application.yml
mysql:
host: 192.168.1.151
port: 3306
database: todo_service
username: huateng
password: 123456
preInitDB:
mysql:
host: 192.168.1.151
port: 3306
database: todo_service
username: huateng
password: 123456
deployment:
managementPort: 18081
env:
open:
## register-server
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://register-server.io-choerodon:8000/eureka/
## config-server
SPRING_CLOUD_CONFIG_ENABLED: true
SPRING_CLOUD_CONFIG_URI: http://config-server.framework:8010/
## mysql
SPRING_DATASOURCE_URL: jdbc:mysql://192.168.1.151/todo_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
SPRING_DATASOURCE_USERNAME: huateng
SPRING_DATASOURCE_PASSWORD: 123456
## kafka
CHOERODON_EVENT_CONSUMER_KAFKA_BOOTSTRAP_SERVERS: kafka-0.kafka-headless.kafka.svc.cluster.local:9092,kafka-1.kafka-headless.kafka.svc.cluster.local:9092,kafka-2.kafka-headless.kafka.svc.cluster.local:9092
SPRING_CLOUD_STREAM_KAFKA_BINDER_BROKERS: kafka-0.kafka-headless.kafka.svc.cluster.local:9092,kafka-1.kafka-headless.kafka.svc.cluster.local:9092,kafka-2.kafka-headless.kafka.svc.cluster.local:9092
SPRING_CLOUD_STREAM_KAFKA_BINDER_ZK_NODES: zookeeper-0.zookeeper-headless.zookeeper.svc.cluster.local:2181,zookeeper-1.zookeeper-headless.zookeeper.svc.cluster.local:2181,zookeeper-2.zookeeper-headless.zookeeper.svc.cluster.local:2181
SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER: org.apache.kafka.common.serialization.ByteArraySerializer
metrics:
path: /prometheus
group: spring-boot
logs:
parser: spring-boot
persistence:
enabled: false
service:
enabled: false
type: ClusterIP
port: 18080
ingress:
enabled: false
resources:
limits:
memory: 1Gi
requests:
memory: 0.5Gi