共计 9346 个字符,预计需要花费 24 分钟才能阅读完成。
OpenTSDB+Grafana 监控环境搭建
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
一、配置 hosts 文件
二、建立 hadoop 运行帐号(也可直接用 root 账号)
三、配置 ssh 免密码连入
四、下载并解压 hadoop 安装包
五、配置各种配置文件
六、向各节点复制 hadoop
七、格式化 namenode
八、启动 hadoop
九、用 jps 检验各后台进程是否成功启动
十、通过网站查看集群情况
(2)编辑 /etc/sysconfig/network 文件
5.2 建立 hadoop
sudo groupadd hadoop
// 添加一个 hadoop 用户,此用户属于 hadoop 用户组
sudo useradd -s /bin/bash -d /home/user/hadoop -m hadoop -g hadoop
# 设置 hadoop 权限./home 目录的读写执性权限
// 设置用户 hadoop 登录密码
sudo passwd hadoop
// 切换到 hadoop 用户中
su hadoop
【注】不一定要新建账号。例如我用 root 账号登录的,直接用 root 账号也可以,为了方便下面就直接用 root 账号操作。
5.3 配置 ssh 免密码连接
# 单点回环免密码登录
cd /root
ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
# 验证免密码。welcome 则表示成功
ssh localhost
# 退出用 exit
#master 连接 slave 免密码登录
#sms-test-002 服务器
cd /root/.ssh
scp root@sms-test-001:~/.ssh/id_dsa.pub ./master_dsa.pub




export JAVA_HOME=/usr/lib/jvm/java-1.7.0


#Opentsdb 依赖 Gnuplot,它 是一个命令行的交互式绘图工具。用户通过输入命令,可以逐步设置或修改绘图环境,并以图形描述数据或函数,使我们可以借由图形做更进一步的分析
# 如果报‘aclocal-1.14’ is missing on your system 则执行 sudo autoreconf -ivf
Usage: tsd –port=PORT –staticroot=PATH –cachedir=PATH
Starts the TSD, the Time Series Daemon
–async-io=true|false Use async NIO (default true) or traditionalblocking io
–auto-metric Automatically add metrics to tsdb as they are inserted. Warning:this may cause unexpected metrics to be tracked
–cachedir=PATH Directory underwhich to cache result of requests.
–flush-interval=MSEC Maximum time for which a new data point canbe buffered (default: 1000).
–port=NUM TCPport to listen on.
–staticroot=PATH Web root from which toserve static files (/s URLs).
–table=TABLE Nameof the HBase table where to store the time series (default: tsdb).
–uidtable=TABLE Name of theHBase table to use for Unique IDs (default: tsdb-uid).
–worker-threads=NUM Number for async io workers(default: cpu * 2).
–zkbasedir=PATH Path underwhich is the znode for the -ROOT- region (default: /hbase).
–zkquorum=SPEC Specificationof the ZooKeeper quorum to use (default: localhost).
./tsdb mkmetric sms.user.submit
附录:
1. 磁盘挂载
fdisk -l // 先查询未挂载的硬盘名如:sdb1 等
mkfs.ext4 /dev/xvdb 开始格式化
df -h
mount /dev/xvdb /home/hdfs_data 开始挂载
vi /etc/fstab 设置自动开启启动
按格式添加
/dev/xvdb /home/hdfs_data ext4 defaults 0 0
硬盘名 需要挂载的位置 格式
卸载挂载点:
umount /home/hdfs_data
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-11/137237.htm
