Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8S 启动apollo-configservice 报数据库错误 #4896

Closed
matrixfish opened this issue Jun 2, 2023 · 3 comments
Closed

K8S 启动apollo-configservice 报数据库错误 #4896

matrixfish opened this issue Jun 2, 2023 · 3 comments
Labels

Comments

@matrixfish
Copy link

matrixfish commented Jun 2, 2023

1、按照这个进行安装
https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide?id=_24-kubernetes%e9%83%a8%e7%bd%b2

2、检查数据库正常,账号密码登
mysql> select Id, Key, Value, Comment from ApolloConfigDB.ServerConfig limit 1;
+----+--------------------+-------------------------------+------------------+
| Id | Key | Value | Comment |
+----+--------------------+-------------------------------+------------------+
| 1 | eureka.service.url | http://localhost:8080/eureka/ | EurekaUrlservice |
+----+--------------------+-------------------------------+------------------+
1 row in set (0.00 sec)

mysql> select Id, Key, Value, Comment from ApolloPortalDB.ServerConfig limit 1;
+----+--------------------+-------+---------+
| Id | Key | Value | Comment |
+----+--------------------+-------+---------+
| 1 | apollo.portal.envs | dev | |
+----+--------------------+-------+---------+
1 row in set (0.00 sec)

3、value.yaml配置
`
configdb:
name: apollo-configdb
host: "10.43.23.47"
port: 3306
dbName: ApolloConfigDB
userName: "root"
password: "root"
connectionStringProperties: characterEncoding=utf8&useSSL=false
service:
enabled: true
fullNameOverride: ""
port: 3306
type: ClusterIP

`

4、IP地址是10.43.23.47,端口也正确
root@mounte:/work/xx/apollo# kubectl --namespace infrastructure-thirdpart get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
apollo-mysql ClusterIP 10.43.23.47 3306/TCP 88m
apollo-mysql-headless ClusterIP None 3306/TCP 88m

5、apollo-configservice报错:
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)
at com.mysql.cj.NativeSession.connect(NativeSession.java:120)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:948)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:818)
... 159 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:607)

@nobodyiam
Copy link
Member

Caused by: java.net.SocketTimeoutException: connect timed out

这个报错说明连不上数据库

@stale
Copy link

stale bot commented Jul 3, 2023

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 3, 2023
@stale
Copy link

stale bot commented Jul 12, 2023

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants