Riak is a complex system that includes many moving parts to monitor, such as the health of the hardware, the well-being of the software, and the responsiveness of the network. This document will discuss metrics, thresholds, and values that indicate when your monitoring system should be sending alarms.
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
Force_remove_s3_bucket = fun(UserID, Bucket) -> | |
Update_user_buckets = fun(User, Bucket) -> | |
Buckets = User#rcs_user_v2.buckets, | |
%% At this point any siblings from the read of the | |
%% user record have been resolved so the user bucket | |
%% list should have 0 or 1 buckets that share a name | |
%% with `Bucket'. | |
case [B || B <- Buckets, B#moss_bucket_v1.name =:= Bucket#moss_bucket_v1.name] of | |
[] -> | |
{ok, User#rcs_user_v2{buckets=[Bucket | Buckets]}}; |
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
%% Shell functions that can be run in `riak-cs attach` | |
%% Peek({S3Bucket, Key}) will fetch an object and display the sibling count and | |
%% the number of manifests in the object. | |
Peek = fun({Bucket, Key}) -> | |
io:format("Peeking at ~p/~p.~n", [Bucket, Key]), | |
{ok, RcPid} = riak_cs_riak_client:checkout(), | |
ManifestBucket = riak_cs_utils:to_bucket_name(objects, Bucket), | |
ok = riak_cs_riak_client:set_bucket_name(RcPid, Bucket), |
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
Preflist = fun(Bucket,Key) -> | |
BKey = {Bucket,Key}, | |
{ok, Ring} = riak_core_ring_manager:get_my_ring(), | |
DocIdx = riak_core_util:chash_key(BKey), | |
BucketProps = riak_core_bucket:get_bucket(Bucket, Ring), | |
[NValue] = [Y || {X1, Y} <- BucketProps, n_val == X1], | |
UpNodes = riak_core_node_watcher:nodes(riak_kv), | |
Preflist2 = riak_core_apl:get_apl_ann(DocIdx, NValue, Ring, UpNodes), | |
[IndexNode || {IndexNode, _Type} <- Preflist2] | |
end. |
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
%% These are shell functions that can be used to output a keylist from a bitcask file in terms of Riak {Bucket,Key} tuples | |
%% They should be run from `riak attach`. Paste in the contents and run ListAll("filename.txt"). Profit. | |
ListCask = fun(Vnode,OutFile) -> | |
Bk_to_tuple = | |
fun(<<1:7, HasType:1, Sz:16/integer, | |
TypeOrBucket:Sz/bytes, Rest/binary>>) -> | |
case HasType of | |
0 -> | |
%% no type, first field is bucket | |
{TypeOrBucket, Rest}; |
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
%% Copyright (c) 2015 Basho Technologies, Inc. All Rights Reserved. | |
%% | |
%% This file is provided to you under the Apache License, | |
%% Version 2.0 (the "License"); you may not use this file | |
%% except in compliance with the License. You may obtain | |
%% a copy of the License at | |
%% | |
%% http://www.apache.org/licenses/LICENSE-2.0 | |
%% | |
%% Unless required by applicable law or agreed to in writing, |
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
[ | |
{lager, | |
[ | |
{error_logger_hwm,100}, | |
{error_logger_redirect,true}, | |
{crash_log_date,"$D0"}, | |
{crash_log_size,10485760}, | |
{crash_log_msg_size,65536}, | |
{handlers, | |
[ |
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
GetInfoAndStatusByModule = fun (Module) -> | |
IsProcessInModule = fun (Module, ProcessInfo) -> | |
case proc_lib:translate_initial_call(ProcessInfo) of | |
{ICMod, _ICFun, _ICArity} when Module =:= ICMod -> true; | |
_ -> false | |
end | |
end, | |
ProcessTable = erlang:processes(), | |
CurriedPredicate = fun (P) -> IsProcessInModule(Module, P) end, | |
Pids = lists:filter(CurriedPredicate, ProcessTable), |
##Configure Postfix for Gmail SMTP## ###Edit file /etc/postfix/main.cf###
sudo vim /etc/postfix/main.cf
and add in the following to the bottom of the file:
relayhost = [smtp.gmail.com]:587
- Download and install Riak 2.0 and an appropriate JVM for your machine.
- Download the Erlang
load_data.erl
escript from https://raw.githubusercontent.com/basho/basho_docs/master/source/data/load_data.erl - Download the
goog.csv
test data from https://github.com/basho/basho_docs/raw/master/source/data/goog.csv