Skip to content

Commit

Permalink
:fix change redis with RedisClusterConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
sunwupark committed Feb 15, 2024
1 parent 5efc872 commit 0db3aca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/umc/meme/auth/global/config/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
Expand All @@ -23,7 +24,9 @@ public class RedisConfig {

@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(host, port);
RedisClusterConfiguration clusterConfiguration = new RedisClusterConfiguration();
clusterConfiguration.clusterNode("host", port);
return new LettuceConnectionFactory(clusterConfiguration);
}

@Bean
Expand Down

0 comments on commit 0db3aca

Please sign in to comment.