无法使用apachegeode-wan复制复制大值



我正在尝试使用apachegeode复制一个非常大的值。我基本上正在做的是使用redis的setbit函数。当我不断增加setbit函数的偏移量时,geode服务器崩溃了。我正在使用geode的redis适配器作为客户端。

import redis.clients.jedis.*;
import redis.clients.jedis.exceptions.JedisException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import redis.clients.jedis.exceptions.JedisException;
public class Test {
//address of your redis server
private static final String redisHost = "10.0.0.10";
private static final Integer redisPort = 11211;
//remember to increase sensder queue size 
public void addSets() {
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxIdle(50);
poolConfig.setMaxTotal(1000);
poolConfig.setTestOnBorrow(true);
poolConfig.setTestOnReturn(true);
JedisPool pool = new JedisPool(poolConfig,redisHost, redisPort,10000000);
Jedis jedis= null;
String key = "shivd";
long [] bits = {1464236631,12373513,1488983657,1329373495,147236649,1623846793,1194510359,282099785,1758709929,1059647223,416962921,1893573065,924784087,551826057,2028436201}; 
//get a jedis connection jedis connection pool
try {
jedis = pool.getResource();
Pipeline pipeline = jedis.pipelined();
for (long b : bits) {
pipeline.setbit(key, b, true);
}
pipeline.multi();
pipeline.exec();
} finally {
if (jedis != null) {
jedis.close();
}
}
pool.destroy();
}
public static void main(String[] args){
Test main = new Test();
main.addSets();
//main.cal();
//main.addHash();
}
}

如果我将偏移量减少到某个限度,它就会起作用。以下是使用redis适配器的两个缓存服务器的日志:

dc1.log(10.0.0.10)-我插入密钥的位置

dc1.log

dc2.log(复制发生的位置)

dc2.log

您的Geode服务器内存不足。您的最后一个值是2028436201,它需要大约253MB才能存储在内存中。

您可以通过以下方式为Geode服务器提供更多内存:

gfsh>start server --name=serv1 --max-heap=2G

如果你的偏移量那么大,你也可以尝试将你的比特集设置在最低偏移量。(即在存储之前从每个偏移中减去最低偏移,然后在外部保持最低偏移)。

最新更新