当我运行在Spirng Tools Suite中准备的项目时,我没有遇到任何问题。然而,当我从同一个项目将其转换为docker映像[mvn spring boot:build image]并运行映像[docker run“projectname”]时,我得到了“com.mysql.cj.jdbc.exceptions.CommunicationsException:Communications link failure最后一个成功发送到服务器的数据包是0毫秒前。驱动程序没有从服务器收到任何数据包。在com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)~[mysql-connector-java-8.0.29.jar:8.0.29]在com.mysql。cj。jdbc。例外情况。SQLExceptionsMapping。translateException(SQLExceptionsMapping.java:64)~[mysql-connector-java-8.0.29.jar:8.0.29]位于com。mysql。cj。jdbc。连接示例。createNewIO(ConnectionImpl.java:828)~[mysql-connector-java-8.0.29.jar:8.0.29]”
应用程序。项目性质;
spring.datasource.url=jdbc:mysql://localhost:3306/innova?useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=Turkey
spring.datasource.username=root
spring.datasource.password=367432
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.datasource.driver-class-name =com.mysql.cj.jdbc.Driver
server.port=8090
spring.application.name=product
spring.profiles.active=properties
spring.config.import=optional:configserver:http://localhost:8071/
management.endpoints.web.exposure.include=*
eureka.instance.preferIpAddress = true
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = true
eureka.client.serviceUrl.defaultZone = http://localhost:8070/eureka/
## Configuring info endpoint
info.app.name=Innova Master
info.app.description=Innova Master Application
info.app.version=1.0.0
spring.zipkin.baseUrl=http://localhost:9411/
项目的pom.xml;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.innova</groupId>
<artifactId>product</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>product</name>
<description>Microservice for Product</description>
<properties>
<java.version>17</java.version>
<spring-cloud.version>2021.0.3</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<name>innova/${project.artifactId}</name>
</image>
</configuration>
</plugin>
</plugins>
</build>
</project>
在运行项目之前,我运行config、eurekaserver和zipkin。DNS正常。Mysql正在运行。是什么导致了这个问题?
问题内容: 我有一个带有Jhipster版本5v的微服务,以及在无业游民的centos 7v中运行的ElasticSearch映像2.4.1。这两个映像正在运行,但是保存和搜索操作无法到达Elasticsearch映像。 码头工人组成: application_dev.yml: application_prod: 域: 问题答案: 问题是群集中的ES节点之一正在磁盘空间不足的情况下运行,因此您遇到
我有发现服务:https://github.com/Naresh-Chaurasia/API-MicroServices-Kafka/tree/master/Microservices-CQRS-SAGA-Kafka/DiscoveryService 我有产品服务:https://github.com/Naresh-Chaurasia/API-MicroServices-Kafka/tree/ma
我正在尝试使用PHPMyAdmin登录MySQL服务器,但它不起作用, 我插入了true和,但它仍然不起作用,我不知道原因是什么 错误: mysql_real_connect():(HY000/1045):配置中定义的控制用户“root”@“localhost”(使用密码“是”)连接的访问被拒绝失败 无法进入PHPMyAdmin
application.properties:这是spring mvc应用程序,应用程序使用带有两个数据库的MySQL db 我阅读了创建dockerfile和docker-compose文件的文章https://medium.com/@asce4s/dockerize-spring-mvc-application-a9ffbd11eadb https://github.com/abagayev/
我正在使用Spring Cloud Config Server和一个简单的Spring Boot项目。所以我有一个Spring Cloud Config Service服务和另一个连接到Spring Cloud Config Service以获取数据库凭据和其他属性等一些属性的简单服务。如果我在本地测试它一切正常,但如果我尝试将这2个服务作为docker容器启动,它就不起作用了。Spring Cl
问题内容: 我有MySQL的Laravel应用程序,我正在尝试使用docker-compose在Docker中运行它。但是,当应用尝试连接数据库时,它会抛出: Connector.php 55行中的PDOException:SQLSTATE [HY000] [2002]无法通过套接字’/var/run/mysqld/mysqld.sock’连接到本地MySQL服务器(2) 我的docker-com