修改redis配置文件jdbc等配置文件为现场文件
This commit is contained in:
@@ -14,7 +14,7 @@ import com.nis.restful.ServiceRuntimeException;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.JedisSentinelPool;
|
||||
import redis.clients.jedis.exceptions.JedisException;
|
||||
|
||||
public class JedisUtils {
|
||||
@@ -263,8 +263,8 @@ public class JedisUtils {
|
||||
* @throws JedisException
|
||||
*/
|
||||
public static Jedis getResource(int redisDb) throws JedisException {
|
||||
// JedisSentinelPool jedisSentinelPool = SpringContextHolder.getBean(JedisSentinelPool.class);
|
||||
JedisPool jedisSentinelPool = SpringContextHolder.getBean(JedisPool.class);
|
||||
JedisSentinelPool jedisSentinelPool = SpringContextHolder.getBean(JedisSentinelPool.class);
|
||||
// JedisPool jedisSentinelPool = SpringContextHolder.getBean(JedisPool.class);
|
||||
|
||||
if (jedisSentinelPool == null) {
|
||||
throw new ServiceRuntimeException("redis连接池为空,请联系管理员检查程序",
|
||||
|
||||
@@ -17,24 +17,27 @@
|
||||
<!-- 加载配置文件,不知道为啥不能加载redis.properties的内容,先把redis.properties里面的内容放到jdbc.properties里面吧 -->
|
||||
<context:property-placeholder
|
||||
ignore-unresolvable="true" location="classpath:jdbc.properties" />
|
||||
|
||||
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
|
||||
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
|
||||
<property name="maxIdle" value="${redis.maxIdle}" />
|
||||
<property name="maxTotal" value="${redis.maxTotal}" />
|
||||
<property name="maxWaitMillis" value="${redis.maxWaitMillis}" />
|
||||
<property name="testOnBorrow" value="${redis.testOnBorrow}" />
|
||||
<property name="testOnReturn" value="${redis.testOnReturn}" />
|
||||
<!-- <property name="timeOut" value="${redis.timeout}" /> -->
|
||||
</bean>
|
||||
|
||||
<bean id="jedisPool" class="redis.clients.jedis.JedisPool">
|
||||
<bean id="jedisPool" class="redis.clients.jedis.JedisSentinelPool">
|
||||
<constructor-arg name="masterName" value="pzff_master" />
|
||||
<constructor-arg name="sentinels">
|
||||
<set>
|
||||
<value>${redis.hostAndPort1}</value>
|
||||
<value>${redis.hostAndPort2}</value>
|
||||
<value>${redis.hostAndPort3}</value>
|
||||
</set>
|
||||
</constructor-arg>
|
||||
<constructor-arg name="poolConfig" ref="poolConfig" />
|
||||
<constructor-arg name="host" value="${redis.host}" />
|
||||
<constructor-arg name="port" value="${redis.port}"
|
||||
type="int" />
|
||||
<constructor-arg name="timeout" value="${redis.timeout}"
|
||||
type="int" />
|
||||
<!-- <constructor-arg name="password" value="${redis.pass}"/> -->
|
||||
<constructor-arg name="timeout"
|
||||
value="${redis.timeout}" type="int" />
|
||||
<!-- <constructor-arg name="password" value="${redis.pass}"/> -->
|
||||
|
||||
</bean>
|
||||
|
||||
@@ -54,38 +57,137 @@
|
||||
<constructor-arg index="0">
|
||||
<set>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port1}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port1}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port2}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port2}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port3}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port3}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port1}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host1}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port4}"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port1}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port2}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port2}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0" value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.cluster.port3}"></constructor-arg>
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port3}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host2}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port4}"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host3}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port1}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host3}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port2}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host3}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port3}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host3}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port4}"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host4}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port1}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host4}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port2}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host4}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port3}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host4}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port4}"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host5}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port1}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host5}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port2}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host5}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port3}"></constructor-arg>
|
||||
</bean>
|
||||
<bean class="redis.clients.jedis.HostAndPort">
|
||||
<constructor-arg index="0"
|
||||
value="${redis.cluster.host5}"></constructor-arg>
|
||||
<constructor-arg index="1"
|
||||
value="${redis.cluster.port4}"></constructor-arg>
|
||||
</bean>
|
||||
</set>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="1" value="${redis.timeout}"></constructor-arg>
|
||||
<constructor-arg index="2" value="${redis.maxRedirects}"></constructor-arg>
|
||||
<constructor-arg index="2"
|
||||
value="${redis.maxRedirects}"></constructor-arg>
|
||||
<constructor-arg index="3" ref="poolConfig"></constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -46,7 +46,7 @@ jdbc.ckLocal.key=p8yBsnjQ2S4qT0XeSTi7lQ==
|
||||
jdbc.ckLocal.password=obYXo/qhb8fDaQbTpX9slA==
|
||||
|
||||
#本地的clickhouse新地址,
|
||||
jdbc.ckLocalNew.url=jdbc:clickhouse://10.4.35.4:2181/ntc_galaxy?socket_timeout=90000
|
||||
jdbc.ckLocalNew.url=jdbc:clickhouse://10.4.35.4:8123/ntc_galaxy?socket_timeout=90000
|
||||
jdbc.ckLocalNew.username=tsg
|
||||
#实际密码ceiec2018
|
||||
jdbc.ckLocalNew.key=pR3JFt5dsGCW0nZO3TLF7Q==
|
||||
|
||||
Reference in New Issue
Block a user