Last active
January 1, 2016 04:42
-
-
Save stefan-mees/8042413 to your computer and use it in GitHub Desktop.
riak ops cheatsheet
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
%% get config at runtime | |
rpc:call(node(), application, get_all_env, [bitcask]). | |
%% set config at runtime for a node | |
rpc:call(node(), application, set_env, [bitcask, merge_window, always]). | |
%% get config for all nodes in a cluster | |
rpc:multicall(application, get_all_env, [bitcask]). | |
%% set config for all nodes in a cluster | |
rpc:multicall(application, set_env, [bitcask, merge_window, always]). | |
%% workaround for scheduler going to sleep too aggressively (increasing response times, decreased cpu utilization) | |
erlang:system_flag(schedulers_online, 1). | |
erlang:system_flag(schedulers_online, 8). %% value from erlang:system_info(schedulers_online) | |
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
export CPU_COUNT=`cat /proc/cpuinfo | grep -ce '^processor[[:space:]]:'` | |
/usr/lib/riak/erts-5.9.1/bin/to_erl /tmp/riak/ <<EOF | |
erlang:system_flag(schedulers_online, 1). | |
timer:sleep(200). | |
erlang:system_flag(schedulers_online, $CPU_COUNT). | |
erlang:system_info(schedulers_online). | |
EOF |
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
sudo riak-admin vnode-status | grep key_count | awk 'match($0, /[0-9]+/) { x += substr($0, RSTART, RLENGTH) } END {print x}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment