Running with hbase+opentsdb+tcollector+grafana

Getting grafana opentsdb hbase and tcollector

https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz

https://github.com/OpenTSDB/opentsdb/releases/download/2.1.1/opentsdb-2.1.1.tar.gz

https://www.eu.apache.org/dist/hbase/1.1.2/hbase-1.1.2-bin.tar.gz

git clone https://github.com/OpenTSDB/tcollector.git

Setup

REPLACE ~ in this guide with the actual path ! Not all params are expanded by the service.

CHANGE THE ~/hbase-1.1.2/conf/hbase-site.xml and add this in the section
<property>
<name>hbase.rootdir</name>
<value>file:///your/user/home/hbase-rootdir/hbase</value>
</property>

Otherwise you’ll probably loose your data at a reboot since the default is in /tmp and it will be cleaned.

env COMPRESSION=NONE HBASE_HOME=~/hbase-1.1.2 ~/opentsdb-2.1.1/create_table.sh
mkdir ~/opentsdb-tmp

Start Everything Up


# Run everything as a different user, NOT ROOT !!!!
~/hbase-1.1.2/bin/start-hbase.sh
~/opentsdb-2.1.1/build/tsdb tsd --port=4242 --staticroot=~/opentsdb-2.1.1/build/staticroot/ --cachedir=~/opentsdb-tmp --zkquorum=localhost:2181 --auto-metric --config=~/opentsdb-2.1.1/opentsdb.conf &
~/tcollector/startstop start --allowed-inactivity-time=3600 --backup-count=10 -v
~/grafana-2.6.0/bin/grafana-server -homepath=~/grafana-2.6.0/ -pidfile=~/grafana-2.6.0/grafana.pid &

My opentsdb.conf looks like this

tsd.http.request.cors_domains = *
tsd.network.port = 4242
tsd.network.bind = 127.0.0.1

My grafana’s defaults.ini looks like this. No need to tinker with the mysqldb. Just create the db and give privileges and it’ll take care of creating its tables.


app_mode = production

[paths]
data = data
logs = data/log

[server]
protocol = http
http_addr =
http_port = 3000
domain = serverstuff.info
enforce_domain = false
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
router_logging = false
static_root_path = public
enable_gzip = false
cert_file =
cert_key =

[database]
type = mysql
host = 127.0.0.1:3306
name = grafana
user = grafana
password = password
ssl_mode = disable
path = grafana.db

[session]
provider = file
provider_config = sessions
cookie_name = grafana_sess
cookie_secure = false
session_life_time = 86400
gc_interval_time = 86400

[analytics]
reporting_enabled = true
google_analytics_ua_id =
google_tag_manager_id =

[security]
admin_user = admin
admin_password = admin
secret_key = keyhere
login_remember_days = 7
cookie_username = grafana_user
cookie_remember_name = grafana_remember
disable_gravatar = false
data_source_proxy_whitelist =

[users]
allow_sign_up = false
allow_org_create = false
auto_assign_org = true
auto_assign_org_role = Viewer
verify_email_enabled = false

[auth.anonymous]
enabled = false
org_name = Main Org.
org_role = Viewer

[auth.github]
enabled = false
allow_sign_up = false
client_id = some_id
client_secret = some_secret
scopes = user:email
auth_url = https://github.com/login/oauth/authorize
token_url = https://github.com/login/oauth/access_token
api_url = https://api.github.com/user
team_ids =
allowed_organizations =

[auth.google]
enabled = false
allow_sign_up = false
client_id = some_client_id
client_secret = some_client_secret
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
api_url = https://www.googleapis.com/oauth2/v1/userinfo
allowed_domains =

[auth.basic]
enabled = true

[auth.proxy]
enabled = false
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true

[auth.ldap]
enabled = false
config_file = /etc/grafana/ldap.toml

[smtp]
enabled = false
host = localhost:25
user =
password =
cert_file =
key_file =
skip_verify = false
from_address = admin@grafana.localhost

[emails]
welcome_email_on_sign_up = false
templates_pattern = emails/*.html

[log]
mode = console, file
buffer_len = 10000
level = Info

[log.console]
level =
formatting = true

[log.file]
level =
log_rotate = true
max_lines = 1000000
max_lines_shift = 28
daily_rotate = true
max_days = 7

[event_publisher]
enabled = false
rabbitmq_url = amqp://localhost/
exchange = grafana_events

[dashboards.json]
enabled = false
path = /var/lib/grafana/dashboards

[quota]
enabled = false
org_user = 10
org_dashboard = 100
org_data_source = 10
org_api_key = 10
user_org = 10
global_user = -1
global_org = -1
global_dashboard = -1
global_api_key = -1
global_session = -1

Upgrading

For Grafana:


#wget new grafana
tar -xzf grafana-version.linux-x64.tar.gz
pkill -9 grafana-server
cp grafana-old/conf/defaults.ini grafana-new/conf/defaults.ini
~/grafana-new/bin/grafana-server -homepath=~/grafana-new/ -pidfile=~/grafana-new/grafana.pid &