2016-07-18 29 views
0

編輯: 接受的答案是由於原始問題是針對C * 2.2。從那以後,我轉向使用主幹版本的代碼,並且我已經能夠使用Intellij IDEA進行調試,沒有任何問題。commons-logging在Cassandra中調試

原題:

望着從卡桑德拉的維基頁面HowToDebug,4.2點說的共享記錄jar添加到用於調試的新項目。但是,我沒有在Cassandra項目的build文件夾中找到它。我猜這篇文章寫完後,這個jar已經被另一個版本所取代。現在要調試,哪個罐子需要添加?

對於build/lib/jar/pig - *。jar,同樣的問題,因爲我在相應的文件夾中也沒有看到這個jar。

我正在處理Cassandra 2.2的代碼。

編輯: 使用下面的解決方案,我得到了下面的輸出啓動調試之後:

WARN 16:53:19 Only 40913 MB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots 
WARN 16:53:19 Only 40913 MB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots 
WARN 16:53:19 jemalloc shared library could not be preloaded to speed up memory allocations 
WARN 16:53:19 jemalloc shared library could not be preloaded to speed up memory allocations 
WARN 16:53:19 JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info. 
WARN 16:53:19 JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info. 
ERROR 16:53:19 cassandra.jmx.local.port missing from cassandra-env.sh, unable to start local JMX service. 
ERROR 16:53:19 cassandra.jmx.local.port missing from cassandra-env.sh, unable to start local JMX service. 
WARN 16:53:20 Directory build/test/cassandra/data doesn't exist 
WARN 16:53:20 Directory build/test/cassandra/data doesn't exist 
WARN 16:53:20 Directory build/test/cassandra/commitlog doesn't exist 
WARN 16:53:20 Directory build/test/cassandra/commitlog doesn't exist 
WARN 16:53:20 Directory build/test/cassandra/saved_caches doesn't exist 
WARN 16:53:20 Directory build/test/cassandra/saved_caches doesn't exist 
WARN 16:53:22 No host ID found, created d47c6743-a52c-4298-9f6d-3588a7765888 (Note: This should happen exactly once per node). 
WARN 16:53:22 No host ID found, created d47c6743-a52c-4298-9f6d-3588a7765888 (Note: This should happen exactly once per node). 
WARN 16:53:22 Generated random token [cd5af2b96149d21ba54a6b35d8d4a05d]. Random tokens will result in an unbalanced ring; see http://wiki.apache.org/cassandra/Operations 
WARN 16:53:22 Generated random token [cd5af2b96149d21ba54a6b35d8d4a05d]. Random tokens will result in an unbalanced ring; see http://wiki.apache.org/cassandra/Operations 

這個預期?我想我可以忽略關於可用光盤空間的第一條消息,但其他光盤空間呢?重複的信息也是正常的事情嗎?

回答

2

通過連接Cassandra作爲外部進程而不是從Eclipse啓動Cassandra,您可能會更成功。我建議使用ccm來設置啓用調試端口的本地羣集。之後,您可以從Eclipse連接到任何已啓動的節點並開始調試。

  1. 克隆卡桑德拉到工作目錄,並建立jar文件如果尚未
  2. 使用CCM來創建基於源從Git的新的空集羣:ccm create 2.2-1n --install-dir=/path/to/build/sources/cassandra-2.2
  3. 添加節點集羣:ccm add -s -r 9881 -j 8001 -i 127.0.0.1 node1(-r將指定遠程調試端口,-j JMX端口)
  4. 開始簇:ccm start
  5. 從蝕連接:Run -> Debug configurations -> Remote Java Application -> Right click and select "Add" -> Enter -r port value in connection settings
+0

感謝您的輸入。我已經嘗試了你的方法,但我認爲我沒有完全正確...你可以在我的問題中檢查編輯嗎? –

+0

你從哪裏找到日誌輸出? –