Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After the first failure, there will be no further attempts to pursue it. #190

Closed
dyrnq opened this issue Dec 29, 2023 · 7 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@dyrnq
Copy link
Contributor

dyrnq commented Dec 29, 2023

Module: [e.g. camellia-redis-proxy、camellia-delay-queue]

camellia-redis-proxy

Content: [e.g. need xxxx]

when redis not ok then start camellia-redis-proxy failure, there will be no further attempts to pursue upstream.

Even redis there OK ! camellia-redis-proxy will not brave pursuit!

Log

error.log

Dec 29 09:48:01 ubuntu55 bash[22936]: Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netease.nim.camellia.redis.proxy.springboot.CamelliaRedisProxyBoot]: Factory method 'redisProxyBoot' threw exception; nested exception is com.netease.nim.camellia.redis.base.exception.CamelliaRedisException: RedisClusterSlotInfo init fail, resource = redis-cluster://@192.168.5.12:10001,192.168.5.12:10002,192.168.5.12:10003,192.168.5.12:10004,192.168.5.12:10005,192.168.5.12:10006
Dec 29 09:48:01 ubuntu55 bash[22936]:         at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)
Dec 29 09:48:01 ubuntu55 bash[22936]:         ... 23 common frames omitted
Dec 29 09:48:01 ubuntu55 bash[22936]: Caused by: com.netease.nim.camellia.redis.base.exception.CamelliaRedisException: RedisClusterSlotInfo init fail, resource = redis-cluster://@192.168.5.12:10001,192.168.5.12:10002,192.168.5.12:10003,192.168.5.12:10004,192.168.5.12:10005,192.168.5.12:10006
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.cluster.RedisClusterClient.start(RedisClusterClient.java:97)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientFactory$Default.lambda$get$3(UpstreamRedisClientFactory.java:91)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientFactory$Default.get(UpstreamRedisClientFactory.java:88)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientFactory$Default.get(UpstreamRedisClientFactory.java:254)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplate.update(UpstreamRedisClientTemplate.java:718)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplate.<init>(UpstreamRedisClientTemplate.java:128)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplate.<init>(UpstreamRedisClientTemplate.java:94)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplateFactory.initLocal(UpstreamRedisClientTemplateFactory.java:238)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplateFactory.init(UpstreamRedisClientTemplateFactory.java:210)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.upstream.UpstreamRedisClientTemplateFactory.<init>(UpstreamRedisClientTemplateFactory.java:60)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.util.ConfigInitUtil.initUpstreamClientTemplateFactory(ConfigInitUtil.java:47)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.command.CommandInvoker.<init>(CommandInvoker.java:43)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.springboot.CamelliaRedisProxyConfiguration.redisProxyBoot(CamelliaRedisProxyConfiguration.java:67)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.springboot.CamelliaRedisProxyConfiguration$$EnhancerBySpringCGLIB$$922d6859.CGLIB$redisProxyBoot$3(<generated>)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.springboot.CamelliaRedisProxyConfiguration$$EnhancerBySpringCGLIB$$922d6859$$FastClassBySpringCGLIB$$71e9febd.invoke(<generated>)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at com.netease.nim.camellia.redis.proxy.springboot.CamelliaRedisProxyConfiguration$$EnhancerBySpringCGLIB$$922d6859.redisProxyBoot(<generated>)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Dec 29 09:48:01 ubuntu55 bash[22936]:         at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
Dec 29 09:48:01 ubuntu55 bash[22936]:         ... 24 common frames omitted
@dyrnq dyrnq added the enhancement New feature or request label Dec 29, 2023
@caojiajun
Copy link
Collaborator

server:
  port: 6380
spring:
  application:
    name: camellia-redis-proxy-server

camellia-redis-proxy:
  console-port: 16379
  password: pass123
  monitor-enable: false
  monitor-interval-seconds: 60
  plugins:
    - monitorPlugin
    - bigKeyPlugin
    - hotKeyPlugin
  transpond:
    type: local
    local:
      type: simple
      resource: redis://@127.0.0.1:6379
    redis-conf:
      preheat: false

you can sett config preheat to false

@dyrnq
Copy link
Contributor Author

dyrnq commented Dec 29, 2023

OK! thanks for the reply I will give it a try.

@caojiajun
Copy link
Collaborator

image

welcome to join wechat-group

@dyrnq
Copy link
Contributor Author

dyrnq commented Dec 29, 2023

It seems not working :(

cat  /opt/redis-proxy/BOOT-INF/classes/application.yml|grep -v ^#
server:
  port: 6380
spring:
  application:
    name: camellia-redis-proxy-server

camellia-redis-proxy:
  #port: 6380 #priority greater than server.port, if missing, use server.port; if setting -6379, proxy will choose a random port
  #application-name: camellia-redis-proxy-server  #priority greater than spring.application.name, if missing, use spring.application.name
  console-port: 26379 #console port, default 16379, if setting -16379, proxy will choose a random port, if setting 0, will disable console
  password: password   #password of proxy, priority less than custom client-auth-provider-class-name
  monitor-enable: false  #monitor enable/disable configure
  monitor-interval-seconds: 60 #monitor data refresh interval seconds
  plugins: #plugin list
    - monitorPlugin
    - bigKeyPlugin
    - hotKeyPlugin
  transpond:
    type: local #local、remote、custom
    local:
      type: simple #simple、complex
      resource: redis-cluster://@192.168.5.102:10001,192.168.5.102:10002,192.168.5.102:10003,192.168.5.102:10004,192.168.5.102:10005,192.168.5.102:10006
    redis-conf:
      preheat: false #preheat upstream redis-connection, default true

@caojiajun
Copy link
Collaborator

caojiajun commented Dec 29, 2023

@dyrnq
Copy link
Contributor Author

dyrnq commented Dec 29, 2023

in my test case the redis-cluster where boot up after the redis-proxy.service (systemd unit file)

why custom?

redis-cluster://@192.168.5.102:10001,192.168.5.102:10002,192.168.5.102:10003,192.168.5.102:10004,192.168.5.102:10005,192.168.5.102:10006

is JUST a redis HA ,aka 6 instance (1 replicas) with --cluster create --cluster-replicas 1

is it Is there any difference with resource: redis-cluster://@127.0.0.1:6379,127.0.0.1:6378,127.0.0.1:6377

配置application.yml, 如下:
server:
  port: 6380
spring:
  application:
    name: camellia-redis-proxy-server

camellia-redis-proxy:
  password: pass123
  transpond:
    type: local
    local:
      type: simple
      resource: redis-cluster://@127.0.0.1:6379,127.0.0.1:6378,127.0.0.1:6377

@caojiajun
Copy link
Collaborator

in custom mode proxy will not to verify availability of upstream redis-cluster

@caojiajun caojiajun added this to the v1.2.23 milestone Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants