change mysql
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -149,6 +149,12 @@
|
|||||||
<version>8.1.1.49</version>
|
<version>8.1.1.49</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
<artifactId>druid-spring-boot-starter</artifactId>
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.newyetai.common.util;
|
package com.newyetai.common.util;
|
||||||
|
|
||||||
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
import java.net.NetworkInterface;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
import java.util.Enumeration;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -168,12 +171,24 @@ public class RequestUtils {
|
|||||||
String hostname = System.getenv("HOSTNAME");
|
String hostname = System.getenv("HOSTNAME");
|
||||||
String hostIp = InetAddress.getByName(hostname).getHostAddress();
|
String hostIp = InetAddress.getByName(hostname).getHostAddress();
|
||||||
if ("127.0.0.1".equals(hostIp) || "0:0:0:0:0:0:0:1".equals(hostIp)) {
|
if ("127.0.0.1".equals(hostIp) || "0:0:0:0:0:0:0:1".equals(hostIp)) {
|
||||||
return InetAddress.getLocalHost().getHostAddress();
|
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
|
||||||
|
while (interfaces.hasMoreElements()) {
|
||||||
|
NetworkInterface iface = interfaces.nextElement();
|
||||||
|
if (iface.isUp() && !iface.isLoopback()) {
|
||||||
|
Enumeration<InetAddress> addresses = iface.getInetAddresses();
|
||||||
|
while (addresses.hasMoreElements()) {
|
||||||
|
InetAddress addr = addresses.nextElement();
|
||||||
|
if (addr instanceof Inet4Address) {
|
||||||
|
return addr.getHostAddress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return hostIp;
|
return hostIp;
|
||||||
} catch (UnknownHostException e) {
|
} catch (Exception e) {
|
||||||
|
return "127.0.0.1";
|
||||||
}
|
}
|
||||||
return "127.0.0.1";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ spring.application.name=alita-bjy-uygur
|
|||||||
spring.profiles.active=uat-uygur
|
spring.profiles.active=uat-uygur
|
||||||
|
|
||||||
##数据源
|
##数据源
|
||||||
spring.datasource.url=jdbc:dm://139.159.237.199:5236?schema=BJY_UYGUR_JOB&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false
|
spring.datasource.url=jdbc:mysql://121.37.2.171:3306/uygur-job?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true&useSSL=false
|
||||||
#&useAffectedRows=true
|
#&useAffectedRows=true
|
||||||
spring.datasource.username=SYSDBA
|
spring.datasource.username=root
|
||||||
spring.datasource.password=SYSDBA001
|
spring.datasource.password=xinshan888
|
||||||
spring.datasource.driverClassName=dm.jdbc.driver.DmDriver
|
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||||
|
|
||||||
# 初始化时建立物理连接的个数
|
# 初始化时建立物理连接的个数
|
||||||
@@ -25,7 +25,7 @@ spring.cloud.config.overrideNone=true
|
|||||||
# mybatis
|
# mybatis
|
||||||
mybatis.mapperLocations=classpath*:com/newyetai/**/mapper/*Mapper.xml
|
mybatis.mapperLocations=classpath*:com/newyetai/**/mapper/*Mapper.xml
|
||||||
mybatis.configuration.map-underscore-to-camel-case=true
|
mybatis.configuration.map-underscore-to-camel-case=true
|
||||||
pagehelper.helperDialect=oracle
|
pagehelper.helperDialect=mysql
|
||||||
pagehelper.reasonable=true
|
pagehelper.reasonable=true
|
||||||
|
|
||||||
#mybatis plus
|
#mybatis plus
|
||||||
@@ -68,16 +68,6 @@ spring.redis.lettuce.pool.max-active=10
|
|||||||
spring.redis.lettuce.pool.max-wait=-1ms
|
spring.redis.lettuce.pool.max-wait=-1ms
|
||||||
spring.redis.database=13
|
spring.redis.database=13
|
||||||
|
|
||||||
##mongodb
|
|
||||||
spring.datasource.mongodb.custom.database=alita
|
|
||||||
spring.datasource.mongodb.custom.host=121.37.2.171
|
|
||||||
spring.datasource.mongodb.custom.port=27017
|
|
||||||
spring.datasource.mongodb.custom.username=root
|
|
||||||
spring.datasource.mongodb.custom.password=xinshan888
|
|
||||||
spring.datasource.mongodb.custom.authentication-database=admin
|
|
||||||
spring.datasource.mongodb.custom.connections-per-host=10
|
|
||||||
spring.datasource.mongodb.custom.min-connections-per-host=10
|
|
||||||
|
|
||||||
##mq
|
##mq
|
||||||
spring.rabbitmq.host=121.37.2.171
|
spring.rabbitmq.host=121.37.2.171
|
||||||
spring.rabbitmq.port=5672
|
spring.rabbitmq.port=5672
|
||||||
|
|||||||
Reference in New Issue
Block a user