簡體   English   中英

Commons-Logging在Cassandra中進行調試

[英]commons-logging to debug in Cassandra

編輯:可接受的答案是由於原始問題是對於C * 2.2。 從那時起,我開始使用代碼的主干版本,並且可以使用Intellij IDEA對其進行調試,沒有任何問題。

原始問題:

從Cassandra Wiki看HowToDebug頁面,第4.2點說將commons-logging jar添加到用於調試的新項目中。 但是,我在Cassandra項目的build文件夾中找不到此文件。 我猜這篇文章寫完之后,這個jar已被另一個版本替換。 現在進行調試,我需要添加哪些jar?

對於build / lib / jars / 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

這是預期的嗎? 我想我可以忽略有關可用磁盤空間的第一條消息,但是其他消息呢? 重復的消息也是正常現象嗎?

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

  1. 將Cassandra克隆到工作目錄並構建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. 從eclipse連接: Run -> Debug configurations -> Remote Java Application -> Right click and select "Add" -> Enter -r port value in connection settings

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM