- 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
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
#!/bin/bash | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
brew install asdf | |
ASDF_CONF=$( | |
cat <<EOF | |
export ASDF_DIR="$(brew --prefix asdf)" | |
. ${ASDF_DIR}/asdf.sh |
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
#! /usr/bin/env escript | |
%% -*- mode: erlang -*- | |
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | |
%% ex: ts=4 sw=4 ft=erlang et | |
%% | |
%% Copyright 2016 Operable, 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 |
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
// Build Test Data | |
IRiakObject cat = RiakObjectBuilder.newBuilder("Pets-Template", "Cat"). | |
withValue("{\"sound\":\"Meow\",\"legs\":4}"). | |
build(); | |
rc.store(cat); | |
// Build User Metadata Map | |
Map<String, String> usermeta = new HashMap<String, String>(); | |
usermeta.put("parentLinkBucket", "Pets-Template"); | |
usermeta.put("parentLinkKey", "Cat"); |
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
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -smp enable -sname graph_ring -mnesia debug verbose | |
main([RingFile, OutFile]) -> | |
{ok, Binary} = file:read_file(RingFile), | |
Ring = binary_to_term(Binary), | |
OwnerList = element(2,element(4,Ring)), | |
%io:format("~s~n", [lists:flatten(header(body(footer([]),OwnerList)))]); |
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
Compute_Next = fun(Ring1,Ring2) -> | |
Owners1 = riak_core_ring:all_owners(Ring1), | |
Owners2 = riak_core_ring:all_owners(Ring2), | |
Owners3 = lists:zip(Owners1, Owners2), | |
[{Idx, PrevOwner, NewOwner, [], awaiting} | |
|| {{Idx, PrevOwner}, {Idx, NewOwner}} <- Owners3, | |
PrevOwner /= NewOwner] | |
end. | |
N = app_helper:get_env(riak_core,target_n_val,4), |
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
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -smp enable -sname convert_binary_ring -mnesia debug verbose | |
main([RingFile, OutFile]) -> | |
try | |
{ok, Binary} = file:read_file(RingFile), | |
Ring = binary_to_term(Binary), | |
try | |
file:write_file(OutFile, io_lib:format("~p.~n", [Ring])), |
##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
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), |
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.
NewerOlder