1. Install JDK.
Can be installed directly with Yum, if you have been casually installed JAVA,OPENTSDB and hbase have requirements for JDK version.
a.hbase requirements for JDK:
B.OPENTSDB Requirements for the environment:
The Java environment can use Oracle's JDK or OPENJDK, and I choose openJDK1.7. Now start installing opeJDK1.7:
c. Check your installed Java version:
Java-version
If not 1.7 and above, uninstall:
Yum-y Remove java-1.7.0-openjdk*
yum-y Remove Tzdata-java.noarch
d. If it is not installed or uninstalled, install the new:
To view available versions:
Yum-y List java*
Choose a reasonable installation:
Yum-y Install java-1.7.0-openjdk*
E. Configure Environment variables:
Vi/etc/profile
At the end of profile file add:
JAVA_HOME=/USR/LIB/JVM/JAVA-1.7.0-OPENJDK
path= $JAVA _home/bin
classpath=.: $JAVA _home/lib/dt.jar: $JAVA _ Home/lib/tools.jar
export java_home
export PATH
export CLASSPATH
Java_home is the Java installed path, path is the Java bin file, Linux is used: to separate the path, Windows is used;
Then look at the Java version number:
Java-version
2. Install zookeeper.
f. Download Zookeeper
Download Zookeeper here, this article downloads is zookeeper-3.4.10.tar.gz.
G. Installation of Zookeeper
Extract to a directory after downloading (extract to/usr/local):
sudo tar zxvf zookeeper-3.4.10.tar.gz-c/usr/local
Change the name of the file (under the local file):
sudo mv./zookeeper-3.4.10/./zookeeper
Change the ownership of the file (this system is under the User: Wangmeng):
sudo chown-r Wangmeng:wangmeng./zookeeper
H. Modifying a configuration file
Enter the Conf subdirectory under the Zookeeper directory to create the ZOO.CFG:
CD zookeeper/conf/
VI zoo.cfg
Write to the following content;
ticktime=2000
datadir=/usr/local/zookeeper/data
datalogdir=/usr/local/zookeeper/logs
clientPort= 4180
I. Parameter description:
The base unit of time used in Ticktime:zookeeper, the millisecond value.
DataDir: Data directory. can be any directory.
Datalogdir:log directory, which can also be any directory. If this parameter is not set, the same settings are used and DataDir.
ClientPort: Listens to the port number of the client connection.
So far, zookeeper's stand-alone mode has been configured.
J. Start Zookeeper, enter bin directory, execute command:
./zkserver.sh Start
3. Install HBase.
k. Download HBase:
Download HBase Here, this article uses the hbase-1.2.6-bin.tar.gz.
L. Installation of HBase:
Extract to a directory after downloading (extract to/usr/local):
sudo tar zxvf hbase-1.2.6-bin.tar.gz-c/usr/local
Change the name of the file (under the local file):
sudo mv./hbase-1.2.6/./hbase
Change the ownership of the file (this system is under the User: Wangmeng):
sudo chown-r Wangmeng:wangmeng./hbase
m. Modify the configuration file:
Execute the command under/usr/local/:
VI Hbase/conf/hbase-site.xml
The revised contents are as follows:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:// /usr/local/hbase</value>
</property>
<property>
<name> hbase.zookeeper.property.datadir</name>
<value>/usr/local/zookeeper</value>
</ Property>
</configuration>
Save, start HBase, execute the command under/USR/LOCAL/HABSE:
./bin/start-hbase.sh
Normally it will appear: Starting master, logging to hbase/bin/. /logs/hbase-master.out
Check to see if the startup condition is successful:
JPs
will appear: 15076 Jps
At this point, the HBase installation is complete. 4. Install gnuplot.
OPENTSDB relies on gnuplot, which is an interactive drawing tool on the command line. By entering commands, the user can gradually set or modify the drawing environment and graphically describe the data or function so that we can make a further analysis by drawing.
Yum Install Gnuplot
5. Install OPENTSDB.
N. Download Opentsdb:
Download HBase Here, this article uses the opentsdb-2.2.0.tar.gz.
O. Installation of Opentsdb:
Extract to a directory after downloading (extract to/usr/local):
sudo tar zxvf opentsdb-2.2.0.tar.gz-c/usr/local
Change the name of the file (under the local file):
sudo mv./opentsdb-2.2.0/./hbase
Change the ownership of the file (this system is under the User: Wangmeng):
sudo chown-r Wangmeng:wangmeng./opentsdb
CD opentsdb/
After the above command is executed, a tsdb-2.2.0.jar is generated under the Build folder, followed by the installation:
CD build/make
Install
At this point, I encountered this problem:CentOS can not use Make,make install
Installation:
Yum-y install gcc automake autoconf libtool make
Install g++:
Yum Install gcc gcc-c++
Once you have solved this problem, execute make install again and succeed.
To create a table (executed under the Opentsdb directory):
sudo env compression=none hbase_home=/usr/local/hbase./src/create_table.sh
The last command may have an error after execution: can ' t get connection to Zookeeper:keepererrorcode = Connectionloss for/hbase, Workaround: Shutdown firewall: sudo systemctl St Op firewalld.service just fine.
p. Configure OPENTSDB:
VI opentsdb/src/opentsdb.conf
The changes are as follows:
Specifically as follows:
Tsd.network.port = 4242
tsd.http.staticroot =build/staticroot
tsd.http.cachedir =/TMP/TSD
Tsd.core.auto_create_metrics = True
6. Test installation.
Q. Start (execute in opentsdb directory):
An error may occur when the previous command is entered: [Main-sendthread (localhost:2181)] clientcnxn:session 0x0 for server null, unexpected error, closing Socket connection and attempting reconnect ... Solution: Debugging a Half-day originally is to start zookeeper in the start HBase.
Enter URL in browser: http://localhost:4242/
You can see: