-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cpu_info, describecluster and Sstable cluster #3
Open
shawark
wants to merge
4
commits into
instaclustr:main
Choose a base branch
from
shawark:shaw_patch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ LOG_PATH=/var/log/cassandra | |
|
||
#List of data directories; if more than one list all with delimiter ',' | ||
#e.g. DATA_PATHS=path/to/dir1,path/to/dir2 | ||
DATA_PATHS=/var/lib/cassandra/data/data | ||
DATA_PATHS=/var/lib/cassandra/data | ||
GC_LOGGING_ENABLED=yes | ||
CASSANDRA_HOME=/var/lib/cassandra | ||
GC_LOG_PATH=${CASSANDRA_HOME}/logs | ||
|
@@ -17,6 +17,15 @@ ip=$(hostname --ip-address | tr -d [:blank:]) | |
data_dir=/tmp/DataCollection_${ip} | ||
data_file=$data_dir/disk.info | ||
io_stats_file=$data_dir/io_stat.info | ||
cpu_info_file=$data_dir/cpu.info | ||
mem_info_file=$data_dir/mem.info | ||
sstable_count_file=$data_dir/sstable_count.info | ||
block_info_file=$data_dir/block.info | ||
|
||
#Managing Instacollector version | ||
ic_version=2 | ||
echo "Instacollector version = ${ic_version}" > $data_dir/ic_version.info | ||
|
||
|
||
copy_config_files() | ||
{ | ||
|
@@ -25,7 +34,7 @@ local config_files=("$CONFIG_PATH/cassandra.yaml" "$CONFIG_PATH/cassandra-env.sh | |
|
||
if [ "$GC_LOGGING_ENABLED" == "yes" ] | ||
then | ||
config_files+=( "$GC_LOG_PATH/gc.log*" ) | ||
config_files+=( "$GC_LOG_PATH/gc.log*" ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace tab with 4 spaces |
||
fi | ||
|
||
for i in "${config_files[@]}" | ||
|
@@ -44,14 +53,43 @@ for i in "${commands[@]}" | |
do | ||
for j in "${paths[@]}" | ||
do | ||
echo "" >> $data_file | ||
k=$(echo $i $j) | ||
echo "$k" >> $data_file | ||
eval $k >> $data_file | ||
echo "" >> $data_file | ||
k=$(echo $i $j) | ||
echo "$k" >> $data_file | ||
eval $k >> $data_file | ||
done | ||
done | ||
} | ||
|
||
|
||
get_sstable_count() { | ||
echo "$ip : Executing sstables count command" | ||
local paths=($(echo "$DATA_PATHS" | tr ',' '\n')) | ||
for j in "${paths[@]}" | ||
do | ||
find ${j} -maxdepth 3 -type f | wc -l | xargs -n1 echo "Total sstable count : " >> $sstable_count_file | ||
for i in `ls -1 ${j}`; | ||
do | ||
find ${j}/${i} -maxdepth 2 -type f | wc -l | xargs -n1 echo "Keyspace ${i}, Total number of sstables : " >> $sstable_count_file | ||
done | ||
done | ||
} | ||
|
||
get_block_info() { | ||
echo "$ip : Executing lsblk command" | ||
lsblk > $block_info_file | ||
} | ||
|
||
get_cpu_info() { | ||
echo "$ip : Executing /proc/cpuinfo command" | ||
cat /proc/cpuinfo > $cpu_info_file | ||
} | ||
|
||
get_mem_info() { | ||
echo "$ip : Executing /proc/meminfo command" | ||
cat /proc/meminfo > $mem_info_file | ||
} | ||
|
||
get_io_stats() | ||
{ | ||
echo "$ip : Executing iostat command" | ||
|
@@ -65,12 +103,12 @@ get_node_tool_info() | |
#The nodetool commands and their respective filenames are on the same index in the arrays | ||
#the total number of entries in the arrays is used in the for loop. | ||
|
||
local commands=("nodetool info" "nodetool version" "nodetool status" "nodetool tpstats" "nodetool compactionstats -H" "nodetool gossipinfo" "nodetool cfstats -H" "nodetool ring") | ||
local filenames=("nodetool_info" "nodetool_version" "nodetool_status" "nodetool_tpstats" "nodetool_compactionstats" "nodetool_gossipinfo" "nodetool_cfstats" "nodetool_ring") | ||
local commands=("nodetool info" "nodetool version" "nodetool status" "nodetool tpstats" "nodetool compactionstats -H" "nodetool gossipinfo" "nodetool cfstats -H" "nodetool ring" "nodetool describecluster") | ||
local filenames=("nodetool_info" "nodetool_version" "nodetool_status" "nodetool_tpstats" "nodetool_compactionstats" "nodetool_gossipinfo" "nodetool_cfstats" "nodetool_ring" "nodetool_describecluster") | ||
|
||
echo "$ip : Executing nodetool commands " | ||
|
||
for i in {1..8} | ||
for i in {0..8} | ||
do | ||
local cmd_file=$data_dir/${filenames[i]}.info | ||
echo "" >> $cmd_file | ||
|
@@ -85,11 +123,14 @@ mv $data_dir $data_dir_`date +%Y%m%d%H%M` 2>/dev/null | |
mkdir $data_dir | ||
|
||
#start execution | ||
get_sstable_count & | ||
get_cpu_info & | ||
get_mem_info & | ||
get_io_stats & | ||
copy_config_files & | ||
get_size_info & | ||
get_node_tool_info & | ||
|
||
get_block_info & | ||
|
||
echo "$ip : Waiting for background functions to complete" | ||
wait | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix default path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems default for DSE, apache cassandra, Ubuntu distro all use
/var/lib/cassandra/data
rather than/var/lib/cassandra/data/data