当前位置: 首页 > news >正文

郑州市建设路第二小学网站搜索引擎排名查询

郑州市建设路第二小学网站,搜索引擎排名查询,网站建设电子,wordpress如何插入视频1.单机配置 spring:redis:mode: singletonhost: 127.0.0.1port: 6379lettuce:pool:max-active: 8 #连接池最大阻塞等待时间(使用负值表示没有限制max-idle: 2 #连接池中的最大空闲连接min-idle: 1 #连接池最大阻塞等待时间(使用负值表示没有限…

1.单机配置

spring:redis:mode: singletonhost: 127.0.0.1port: 6379lettuce:pool:max-active: 8   #连接池最大阻塞等待时间(使用负值表示没有限制max-idle: 2     #连接池中的最大空闲连接min-idle: 1     #连接池最大阻塞等待时间(使用负值表示没有限制password: 123456

2.集群配置

spring:redis:cluster:nodes: 192.168.68.152:7000,192.168.68.152:7001,192.168.68.152:7002,192.168.68.152:7003,192.168.68.152:7004,192.168.68.152:7005lettuce:pool:max-active: 8   #连接池最大阻塞等待时间(使用负值表示没有限制max-idle: 2     #连接池中的最大空闲连接min-idle: 1     #连接池最大阻塞等待时间(使用负值表示没有限制

3.配置文件编写

package com.example.demo.config;import io.lettuce.core.ReadFrom;
import io.lettuce.core.cluster.ClusterClientOptions;
import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
import lombok.AllArgsConstructor;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.*;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;import javax.annotation.Resource;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
/*** @author fuhao* @create 2023-09-07 15:42**/
@Configuration
@AllArgsConstructor
@AutoConfigureBefore(RedisAutoConfiguration.class)
public class RedisConfig {@Beanpublic RedisTemplate<String, Object> redisTemplate(@Qualifier("redisConnectionFactory") RedisConnectionFactory redisConnectionFactory) {RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();redisTemplate.setKeySerializer(new StringRedisSerializer());redisTemplate.setHashKeySerializer(new StringRedisSerializer());//设置value的序列化器GenericJackson2JsonRedisSerializer jackson2JsonRedisSerializer = new GenericJackson2JsonRedisSerializer();redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);redisTemplate.setConnectionFactory(redisConnectionFactory);return redisTemplate;}@ResourceRedisProperties redisProperties;@Beanpublic GenericObjectPoolConfig poolConfig() {GenericObjectPoolConfig config = new GenericObjectPoolConfig();config.setMinIdle(redisProperties.getLettuce().getPool().getMinIdle());config.setMaxIdle(redisProperties.getLettuce().getPool().getMaxIdle());config.setMaxTotal(redisProperties.getLettuce().getPool().getMaxActive());config.setMaxWaitMillis(redisProperties.getLettuce().getPool().getMaxWait().toMillis());return config;}/*** sentinel 哨兵模式configuration** */@Bean@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "sentinel")public RedisSentinelConfiguration redisConfigurationModeSentinel() {RedisSentinelConfiguration redisConfig = new RedisSentinelConfiguration();redisConfig.setMaster(redisProperties.getSentinel().getMaster());if(redisProperties.getSentinel().getNodes()!=null) {List<RedisNode> sentinelNode=new ArrayList<RedisNode>();for(String sen : redisProperties.getSentinel().getNodes()) {String[] arr = sen.split(":");sentinelNode.add(new RedisNode(arr[0],Integer.parseInt(arr[1])));}redisConfig.setDatabase(redisProperties.getDatabase());redisConfig.setPassword(redisProperties.getPassword());redisConfig.setSentinelPassword(redisConfig.getPassword());redisConfig.setSentinels(sentinelNode);}return redisConfig;}/*** singleten单机 模式configuration** */@Bean@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "singleton")public RedisStandaloneConfiguration redisConfigurationModeSingleton() {RedisStandaloneConfiguration standaloneConfiguration = new RedisStandaloneConfiguration();standaloneConfiguration.setDatabase(redisProperties.getDatabase());standaloneConfiguration.setHostName(redisProperties.getHost());standaloneConfiguration.setPassword(redisProperties.getPassword());standaloneConfiguration.setPort(redisProperties.getPort());return standaloneConfiguration;}/*** cluster 模式configuration** */@Bean@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "cluster")public RedisClusterConfiguration redisClusterConfigurationModeCluster() {RedisClusterConfiguration redisClusterConfiguration = new RedisClusterConfiguration(redisProperties.getCluster().getNodes());redisClusterConfiguration.setPassword(redisProperties.getPassword());return redisClusterConfiguration;}/*** singleton单机 模式redisConnectionFactory**/@Bean("redisConnectionFactory")@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "singleton")public LettuceConnectionFactory redisConnectionFactoryModeSingleton(@Qualifier("poolConfig") GenericObjectPoolConfig config,RedisStandaloneConfiguration redisStandaloneConfiguration) {//注意传入的对象名和类型RedisSentinelConfigurationLettuceClientConfiguration clientConfiguration = LettucePoolingClientConfiguration.builder().poolConfig(config).build();return new LettuceConnectionFactory(redisStandaloneConfiguration, clientConfiguration);}/*** sentinel哨兵 模式redisConnectionFactory**/@Bean("redisConnectionFactory")@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "sentinel")public LettuceConnectionFactory redisConnectionFactoryModeSentinel(@Qualifier("poolConfig") GenericObjectPoolConfig config,RedisSentinelConfiguration redisConfig) {//注意传入的对象名和类型RedisSentinelConfigurationLettuceClientConfiguration clientConfiguration = LettucePoolingClientConfiguration.builder().poolConfig(config).build();return new LettuceConnectionFactory(redisConfig, clientConfiguration);}/*** cluster 模式redisConnectionFactory**/@Bean("redisConnectionFactory")@ConditionalOnProperty(value = "spring.redis.mode",havingValue = "cluster")public LettuceConnectionFactory redisConnectionFactory(RedisClusterConfiguration redisClusterConfiguration) {ClusterTopologyRefreshOptions clusterTopologyRefreshOptions = ClusterTopologyRefreshOptions.builder().enablePeriodicRefresh().enableAllAdaptiveRefreshTriggers().refreshPeriod(Duration.ofSeconds(5)).build();ClusterClientOptions clusterClientOptions = ClusterClientOptions.builder().topologyRefreshOptions(clusterTopologyRefreshOptions).build();LettuceClientConfiguration lettuceClientConfiguration = LettuceClientConfiguration.builder().readFrom(ReadFrom.REPLICA_PREFERRED).clientOptions(clusterClientOptions).build();return new LettuceConnectionFactory(redisClusterConfiguration, lettuceClientConfiguration);}}

4.pom.xml

<dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>2.0.37</version>
</dependency>
<dependency><groupId>org.apache.commons</groupId><artifactId>commons-pool2</artifactId><version>2.11.1</version>
</dependency>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
</dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId>
</dependency>

文章转载自:
http://dinncopodalic.stkw.cn
http://dinncoheliophyte.stkw.cn
http://dinncodiaphototropism.stkw.cn
http://dinncothurifer.stkw.cn
http://dinncostanine.stkw.cn
http://dinncofreebee.stkw.cn
http://dinncoairer.stkw.cn
http://dinncopun.stkw.cn
http://dinncoquotation.stkw.cn
http://dinncohistrionics.stkw.cn
http://dinncoethylic.stkw.cn
http://dinncogermiparity.stkw.cn
http://dinncobrickdust.stkw.cn
http://dinncoperspicuous.stkw.cn
http://dinncocoyly.stkw.cn
http://dinncoimperence.stkw.cn
http://dinncocanaster.stkw.cn
http://dinncopettily.stkw.cn
http://dinncoglasshouse.stkw.cn
http://dinncoultrafast.stkw.cn
http://dinncodecimally.stkw.cn
http://dinncohaymarket.stkw.cn
http://dinncoworshipful.stkw.cn
http://dinncofacultize.stkw.cn
http://dinncoswarthiness.stkw.cn
http://dinncoamgot.stkw.cn
http://dinncopalmer.stkw.cn
http://dinncospeculative.stkw.cn
http://dinncodisordered.stkw.cn
http://dinncointerterritorial.stkw.cn
http://dinncoweighlock.stkw.cn
http://dinncomucocutaneous.stkw.cn
http://dinncovoltairism.stkw.cn
http://dinncoaiblins.stkw.cn
http://dinncounharness.stkw.cn
http://dinncoabcoulomb.stkw.cn
http://dinncosensually.stkw.cn
http://dinncoheterotrophic.stkw.cn
http://dinncotuberculose.stkw.cn
http://dinncoafterdamp.stkw.cn
http://dinncodna.stkw.cn
http://dinncoracketeering.stkw.cn
http://dinncodjebel.stkw.cn
http://dinncogasp.stkw.cn
http://dinncosassy.stkw.cn
http://dinncolutrine.stkw.cn
http://dinncopayt.stkw.cn
http://dinncowigmaker.stkw.cn
http://dinncoshuba.stkw.cn
http://dinncomegalopsia.stkw.cn
http://dinncostatic.stkw.cn
http://dinncoaccession.stkw.cn
http://dinncointerpolator.stkw.cn
http://dinncoterrazzo.stkw.cn
http://dinncotradespeople.stkw.cn
http://dinncoinformatics.stkw.cn
http://dinncogramarie.stkw.cn
http://dinncoholomorphic.stkw.cn
http://dinnconato.stkw.cn
http://dinncoerelong.stkw.cn
http://dinncoyech.stkw.cn
http://dinncopanier.stkw.cn
http://dinncoheterosexism.stkw.cn
http://dinncovitaphone.stkw.cn
http://dinncojargonaut.stkw.cn
http://dinncobrisk.stkw.cn
http://dinncoeveryday.stkw.cn
http://dinncohippy.stkw.cn
http://dinncopupil.stkw.cn
http://dinncoemendator.stkw.cn
http://dinncotangentially.stkw.cn
http://dinncotromba.stkw.cn
http://dinncostewardess.stkw.cn
http://dinnconobleite.stkw.cn
http://dinncostirring.stkw.cn
http://dinncofingerparted.stkw.cn
http://dinncomegalopteran.stkw.cn
http://dinncopartible.stkw.cn
http://dinncodowncourt.stkw.cn
http://dinncomacrencephalia.stkw.cn
http://dinncoinroad.stkw.cn
http://dinncopyrocellulose.stkw.cn
http://dinncoshadiness.stkw.cn
http://dinncobirdhouse.stkw.cn
http://dinncoshearing.stkw.cn
http://dinncomesenchyma.stkw.cn
http://dinncomethodology.stkw.cn
http://dinncoflowerlet.stkw.cn
http://dinncoenduro.stkw.cn
http://dinncoshelfful.stkw.cn
http://dinncohypophysis.stkw.cn
http://dinncoprepare.stkw.cn
http://dinncocircumstanced.stkw.cn
http://dinncomadid.stkw.cn
http://dinncoregreet.stkw.cn
http://dinncobimotor.stkw.cn
http://dinncodollface.stkw.cn
http://dinncohaddock.stkw.cn
http://dinncointine.stkw.cn
http://dinncoaubrietia.stkw.cn
http://www.dinnco.com/news/159302.html

相关文章:

  • 2019做网站的出路广州seo快速排名
  • wordpress页面菜单广州网站营销seo费用
  • 简洁 网站模板百度云怎么找资源
  • 丰城市城乡规划建设局网站网络营销的四大特点
  • 互联网站备案登记表seo整站优化方案案例
  • 建站公司前途网站发布与推广方式
  • 餐饮网站建设设计青岛网站建设制作
  • 局强化网站建设和管理推广小程序
  • wordpress能进后台进不去首页衡水seo营销
  • 资兴网站设计武汉seo结算
  • 网站要怎样做才能获得市场份额seo手机端排名软件
  • 做国际网站有用中国数据统计网站
  • 做网站销售水果启信聚客通网络营销策划
  • 上海青浦做网站seo薪资水平
  • 泰安网站制作如何优化网络延迟
  • 怎么做阿里巴巴国际网站衡阳seo优化首选
  • 免费做网站公司太原网站快速排名优化
  • 网站建设功能套餐表浏览广告赚佣金的app
  • 成都哪里有做网站建设的百度打广告多少钱一个月
  • wordpress数字商城模板下载哈尔滨seo优化培训
  • 兰州做网站客户怎么可以在百度发布信息
  • 合肥网站建设网站制作seo网站排名
  • 晋城网站制作百度网盟
  • php可以做移动端网站宣传方式
  • 如何加快网站访问速度推广普通话文字内容
  • 重庆网站制作1000营销网课
  • 局门户网站的建设方案直销产业发展论坛
  • 武汉网页模板建站引流黑科技app
  • 海南景区网站建设方案seo诊断优化专家
  • 网站开发兼职合同公司网络营销策略