这几天在看Cassandra的源代码,Cassandra是通过org.apache.cassandra.service.CassandraDaemon来启动的。在-D的参数中(storage-config)指定了的Cassandra配置文件storage-conf.xml的路径。系统通过下面的code来获取值:
configFileName_ = System.getProperty("storage-config") + File.separator + "storage-conf.xml";
而我在eclipse中直接运行CassandraDaemon时,怎么来设置storage-config参数呢?请看下图:

在VM arguments:中直接录入-Dstorage-config=bin\\conf就可以了。如果是下面的code
System.getenv("storage-config")
则需要在Environment Tab项中设置。
本文介绍如何在Eclipse环境中正确设置Cassandra的启动参数,特别是如何指定storage-config参数以加载配置文件storage-conf.xml。
585

被折叠的 条评论
为什么被折叠?



