gpt4 book ai didi

caching - 无法使用 apache geode wan 复制复制大值

转载 作者:可可西里 更新时间:2023-11-01 11:25:03 25 4
gpt4 key购买 nike

我正在尝试使用 apache geode 复制一个非常大的值。我基本上做的是使用 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) - 我插入 key 的地方

dc1.log

dc2.log(复制发生的地方)

dc2.log

最佳答案

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

你可以给 Geode 服务器更多的内存,比如:

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

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

关于caching - 无法使用 apache geode wan 复制复制大值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46897990/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com