我正在与zookeeper(http://zookeeper.apache.org/)合作.下载3.3.5并创建zoo.cfg并放在$ ZOOKEEPER/conf中,启动zookeeper使用zkServer启动.但以下是错误
可以请任何帮助我..
nfig or no quorum defined in config, running in standalone mode
2012-08-01 23:20:32,175 [myid:] - ERROR [main:ZooKeeperServerMain@54] - Invalid
arguments, exiting abnormally
java.lang.NumberFormatException: For input string: "C:\Development\apps\zookeeper\zookeeper3.4.1\bin\..\conf\zoo.cfg"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)
at org.apache.zookeeper.server.ServerConfig.parse(ServerConfig.java:60)
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:83)
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
2012-08-01 23:20:32,177 [myid:] - INFO [main:ZooKeeperServerMain@55] - Usage: Z
ooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Usage: ZooKeeperServerMain configfile | port datadir [ticktime] [maxcnxns]
Run Code Online (Sandbox Code Playgroud) 这个问题提出了几个问题.赏金将回答整体上的问题.
这是我一直在玩的问题.
注意我对不在欧几里得空间的解决方案特别感兴趣.
有一组Actors形成一个大小为K的人群.d(ActorA,ActorB)对于任何两个演员来说,距离很容易计算(解决方案应该适用于'距离'的各种定义)并且我们可以找到任何给定Actor使用的N个最近邻居的集合任何一种已建立的算法.
这个邻居集在第一瞬间是正确的,但是Actors总是在移动,我想维护每个Actor的N个最近邻居的进化列表.我感兴趣的是近似解决方案,它比完美解决方案更有效.
到目前为止,我一直在使用一个朋友的朋友算法:
recompute_nearest (Actor A)
{
Actor f_o_f [N*N];
for each Actor n in A.neighbours
append n to f_o_f if n != A and n not in f_o_f
Distance distances [N*N];
for 0 <= i < f_o_f.size
distances [i] = distance (A, f_o_f [i])
sort (f_o_f, distances)
A .neighbours = first N from f_o_f
}
Run Code Online (Sandbox Code Playgroud)
当人群缓慢移动且N适当大时,这表现得相当好.它在小错误之后收敛,满足第一个标准,但是
我安装了Cassandra集群和Zookeeper服务器.现在我想使用zookeeper支持cassandra中的事务.我怎么做.
Zookeeper创建znode以执行读取和写入操作,数据来回通过Zookeeper中的znode.我想知道如何使用Zookeeper支持cassandra中的回滚和提交功能.有没有什么办法可以在cassandra中的zookeeper或zookeeper配置中指定cassandra配置.
我个人知道cassandra和zookeeper如何读取和写入数据,但我不知道如何使用Java集成它们.
我们如何使用Zookeeper在Cassandra进行交易.
谢谢.
我目前正在测试bigcouch的大量数据(每天1500万条记录).
当我需要生成数据视图时,我遇到了一些平衡问题,因为我的两台机器中的一台比另一台机器弱得多.结果是,更好的机器完成并且没有任何关系,而较弱的机器还有很多工作要做.(单核与双核)
我的想法是将一些碎片从较弱的机器移动到另一台碎片,这样它们几乎可以在同一时间完成.
因此,我的问题是,如何将碎片从周末bigcouch服务器移动到更好的?
感谢您的帮助+最好的问候!
安迪
我们正在使用Cassandra数据库,该数据库将存储PB级数据.我们正在考虑使用ElasticSearch或Solandra,但我们正在享受一个有趣的时间来决定使用哪个.我想知道我们的数据库是否会变得太大.我知道ElasticSearch是可扩展的,但在多大程度上 - 特别是对于Cassandra数据库.
另一方面,Solandra是为Cassandra制作的,具有很高的可扩展性,但又在多大程度上?
两者都是可扩展的,但使用Cassandra的可扩展性如何?
我正在使用芹菜和动物园管理员(kazoo锁)来锁定我的工人.当我在释放锁之前杀死(-9)其中一个工人然后锁永远锁定时,我遇到了问题.
所以我的问题是:杀死进程释放锁定在该进程中还是在zookeeper中有一些错误?
我读了这个:http: //spyced.blogspot.com/2009/01/all-you-ever-wanted-to-know-about.html
我的问题:
1.)是否正确,Cassandra只使用布隆过滤器,找出最有可能包含密钥的SST(排序字符串表)?由于可能存在多个SST并且Cassandra不知道哪个SST可能是密钥?因此,为了加速查看所有SST,使用bloomfilters.它是否正确?(我想了解卡桑德拉是如何工作的......)
2.)为什么(如上面的链接中所解释)键经过几次哈希?是否正确需要多次使用不同的Hash函数进行哈希处理才能获得更好的"随机分布"位?如果这是错误的,为什么需要多次对密钥进行哈希处理?这会耗费CPU周期吗?如果我有几个Hash函数的输出,那么对结果做了什么,它们是ANDed还是XORded.这有什么不同吗?
3.)使用MD5与SHA1(根据文章是随机分布的)相比,"使用Bloomfilter来衡量积极因素"的差异有多大?为什么MD5不是随机分布的?
非常感谢!!延
在 jni 中,我们有GetPrimitiveArrayElements函数来获取指向堆上数组元素的指针并ReleasePrimitiveArrayElements删除数组的本地副本。
但是我将 java 对象数组传递给 JNI。这些数组元素使用GetObjectArrayElement函数迭代到本地 jobject。
但是如何在处理数组元素后删除 jobject 的本地引用。
谢谢
我已经阅读了Stackoverflow上的许多问题和答案,其中许多只是强调.cancel()了特殊的唯一ID.但是,现在无论我尝试多少次,我都无法取消它.
我唯一的身份证
final static int RQS_1 = 1337;
我的setAlarm函数.pickTime是当前的Activity,timesUp是另一个Service在时间到了时显示toast的类.
Intent intent = new Intent(pickTime.this, timesUp.class);
PendingIntent timesUpIntent = PendingIntent.getService(pickTime.this, RQS_1, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(),
timesUpIntent);
alarmManager.set(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(), timesUpIntent);
Run Code Online (Sandbox Code Playgroud)
我的cancelAlarm功能
Intent intent = new Intent(this, pickTime.class);
PendingIntent timesUpIntent = PendingIntent.getBroadcast(this, RQS_1, intent, 0);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
if (timesUpIntent != null) {
alarmManager.cancel(timesUpIntent);
timesUpIntent.cancel();
Toast.makeText(getApplicationContext(), "Alarm is cancelled",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), "Unable to stop timer",
Toast.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud)
我的时间服务 …
如何彻底关闭ApplicationContextInitializer实施中使用的资源?
我创建了一个ApplicationContextInitializer使用 Curator 项目连接到 Zookeeper 并获取属性文件的实现。然后它创建一个Properties实例 aPropertiesPropertySource并将其添加到上下文中。
当应用程序关闭时,我希望能够调用属于我的初始化程序成员的实例close()。CuratorFramework如何最好地做到这一点?
我是否也可以将CuratorFramework实例传递到上下文中,以便我可以将其用作 bean?