1:hbase单机版安装:
1.1
安装hbase先要安装jdk,
tar zxvf jdk-7u51-linux-x64.tar.gz
mv jdk1.7.0_51 /usr/local
配置java路径
在/etc/my.cnf中加入:
export JAVA_HOME=/usr/local/jdk
export HBASE_HOME=/usr/local/hbase
export PATH=$JAVA_HOME/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/data/mysql/bin:$HBASE_HOME/bin:/usr/local/gnuplot/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
执行source /etc/profile使配置理解生效
下面就
1.2:安装hbase,
下载hbase-0.94.16.tar.gz
$ tar xfz hbase-0.94.16.tar.gz
$ mv hbase-0.94.16 /usr/local
ln -s hbase-0.94.16 hbase
cd /usr/local/hbase/conf
修改hbase-env.sh 中的JAVA_HOME值
export JAVA_HOME=/usr/local/jdk/
修改 hbase-site.xml
hbase.rootdir
/data/data0/hbase
启动hbase:
cd
/usr/local/hbase/bin
./bin/start-hbase.sh
2:
unzip opentsdb-master.zip
cd opentsdb-master
cat README
./build.sh
[root@szl opentsdb-master]# env COMPRESSION=NONE HBASE_HOME=path/to/hbase ./src/create_table.sh
No such directory: HBASE_HOME=path/to/hbase
[root@szl opentsdb-master]# env COMPRESSION=NONE HBASE_HOME=/usr/local/hbase ./src/create_table.sh
HBase Shell; enter 'help
' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 0.94.16, r1557241, Fri Jan 10 20:43:03 UTC 2014
create 'tsdb-uid',
{NAME => 'id', COMPRESSION => 'NONE'},
{NAME => 'name', COMPRESSION => 'NONE'}
0 row(s) in 2.4130 seconds
将:
tsdtmp=${TMPDIR-'/tmp'}/tsd # For best performance, make sure
mkdir -p "$tsdtmp" # your temporary directory uses tmpfs
./build/tsdb tsd --port=4242 --staticroot=build/staticroot --cachedir="$tsdtmp"
写入到一个shell脚本中执行就可以了!
3:下载tcollector
将其放到/usr/local/目录下
修改[root@db5 tcollector]# cat startstop
#!/bin/sh
# Semi Universal start-stop script
# Keep it sh compatible, test with bash, dash, ksh, and zsh.
# TSD_HOST=dns.name.of.tsd
修改为:
TSD_HOST=50.**.***.** ##监控服务器的ip地址
vi /usr/local/tcollector/collectors/etc
[root@db5 etc]# cat mysqlconf.py
#!/usr/bin/env python
def get_user_password(sockfile):
"""Given the path of a socket file, returns a tuple (user, password)."""
return ("root", "k*****") ###这里将root对应的密码填进去
启动tcollector,
cd /usr/local/tcollector
./startstop start
还需要修改mysql.py文件,在该文件中添加;
import sys
sys.path.append("/usr/local/tcollector")
然后执行mysql.py文件:
python /usr/local/tcollector/collectors/0/mysql.py > c.txt
我需要将相关项导入到
修改
cat c.txt | awk '{ print $1 }' | sort -u
在opentsdb上获取不到图片,在tsdb表里面没有记录
问题的原因;
opentsdb.sh 中应该修改localhost为opentsdb机器所在地地址!
留为记录,未完待续.....
阅读(3388) | 评论(0) | 转发(0) |