quartz-redis-jobstore
quartz-redis-jobstore copied to clipboard
ERR This instance has cluster support disabled
Hi @jlinn
I am getting this exception when i set the redisCluster property to true:
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: ERR This instance has cluster support disabled
at redis.clients.jedis.Protocol.processError(Protocol.java:117)
at redis.clients.jedis.Protocol.process(Protocol.java:151)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:216)
at redis.clients.jedis.Connection.getBulkReply(Connection.java:205)
at redis.clients.jedis.Jedis.clusterNodes(Jedis.java:3166)
at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:48)
at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:36)
at redis.clients.jedis.JedisClusterConnectionHandler.
###### quartz, properties file
org.quartz.jobStore.class = net.joelinn.quartz.jobstore.RedisJobStore org.quartz.jobStore.host = localhost
org.quartz.jobStore.port =
org.quartz.jobStore.redisCluster = true
org.quartz.jobStore.redisSentinel =
org.quartz.jobStore.masterGroupName =
org.quartz.jobStore.database:
org.quartz.jobStore.keyPrefix = a_prefix_ org.quartz.jobStore.lockTimeout = 30000 org.quartz.threadPool.threadCount = 3
########### Example1 Class
package com.quartzsamples.fromdoc.schedulers;
import static org.quartz.JobBuilder.newJob; import static org.quartz.TriggerBuilder.newTrigger;
import java.util.Date;
import org.quartz.DateBuilder; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; import org.quartz.Trigger; import org.quartz.impl.StdSchedulerFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
import com.quartzsamples.fromdoc.jobs.HelloJob;
public class Example1 { public static void main(String[] args) throws SchedulerException {
Logger log = LoggerFactory.getLogger(Example1.class);
Date mydate = DateBuilder.evenHourDate(new Date());
JobDetail job = newJob(HelloJob.class).withIdentity("myJob").build();
Trigger trig = newTrigger().withIdentity("mytrigger").startAt(mydate).build();
SchedulerFactory sf = new StdSchedulerFactory(
"com/quartzsamples/fromdoc/properties/quartz.properties");
Scheduler sched = sf.getScheduler();
sched.scheduleJob(job, trig);
sched.start();
}
}
############## Job Class
package com.quartzsamples.fromdoc.jobs;
import java.util.Date;
import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException;
public class HelloJob implements Job{
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
System.out.println("From HelloJob Class "+new Date());
System.out.println(arg0.getFireInstanceId());
}
}
Please help me with this.
It looks like you're seeing that error because clustering is disabled on your target Redis instance. Is the cluster-enabled
setting turned on in your Redis config?
Thanks for pointing out. Once i did setup the cluster, the exception was gone. Can you help me with some guide which has this kind of information to use quartz with redis.
Thank you so much again.
related issue, but connecting to a redis pack enterprise cluster configured with the web console https://github.com/jlinn/quartz-redis-jobstore/issues/26