Install and configure dr elephant

# cd /downloads
# wget https://github.com/linkedin/dr-elephant/archive/master.zip
# unzip master.zip
# mv dr-elephant-master /usr/local/
# cd /usr/local
# wget https://downloads.typesafe.com/typesafe-activator/1.3.12/typesafe-activator-1.3.12.zip
# unzip typesafe-activator-1.3.12.zip
# rm -rf typesafe-activator-1.3.12.zip
# cd activator-dist-1.3.12/bin/
# pwd
/usr/local/activator-dist-1.3.12/bin

# vi /etc/profile
export PATH=$PATH:/usr/local/activator-dist-1.3.12/bin
export HADOOP_HOME=/usr/hdp/2.6.3.0-235/hadoop
export HADOOP_CONF_DIR=/usr/hdp/current/hadoop-client/etc/hadoop
export SPARK_HOME=/usr/hdp/current/spark2-client
export SPARK_CONF_DIR=/etc/spark2/conf
export ELEPHANT_CONF_DIR=/usr/local/dr-elephant-master/target/universal/dr-elephant-2.0.13/app-conf
export PATH=$PATH:$HADOOP_HOME:$HADOOP_CONF_DIR:$SPARK_HOME/bin:$SPARK_CONF_DIR:$ELEPHANT_CONF_DIR

# source /etc/profile

# cd /usr/local/dr-elephant-master/
# sh compile.sh
Install mysql:
Forr el7:
# cd /downloads
# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-server
# yum install mysql-connector-java
# systemctl start mysqld
# mysql_secure_installation
<blank password>
************
# mysql -u root -p
Enter password:
For el6:
# yum localinstall https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm
# yum install mysql-community-server
# service mysqld restart
if error:
[ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of 
a different size 640 pages (rounded down to MB) than specified in the .cnf file: 
initial 768 pages, max 0 (relevant if non-zero) pages!
Then,
# vi /etc/my.cnf
innodb_data_file_path = ibdata1:10M:autoextend
# mysqld_safe --skip-grant-tables &
in other terminal
# service mysqld start
Starting mysqld:                                           [  OK  ]
# mysql_upgrade
# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

mysql_secure_installation

mysql> create database drelephant;
Query OK, 1 row affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Add the DB details into dr elephant:
# cd /usr/local/dr-elephant-master/target/universal/dr-elephant-2.0.13
# vi app-conf/elephant.conf
port=8989
db_url=localhost
db_name=drelephant
db_user=root
db_password="*********"
Now start the service:
# bin/start.sh

Reading from config file...
db_url:  localhost
db_name:  drelephant
db_user:  root
http port:  8989
This is hadoop2.x grid. Adding Java library to path: /usr/hdp/2.6.3.0-235/hadoop/lib/native
Starting Dr. Elephant ....
Dr. Elephant started.
If we get any error and not starting then check the log file:
# vi logs/application.log

2017-12-08 12:18:19,155 - [INFO] - from play in main
database [default] connected at jdbc:mysql://localhost/drelephant?characterEncoding=UTF-8

2017-12-08 12:18:19,635 - [ERROR] - from play in main
Specified key was too long; max key length is 767 bytes [ERROR:1071, SQLSTATE:42000]
If error related to SQLSTATE then:
# mysql -u root -p
Enter password:
mysql> DROP DATABASE drelephant;
mysql> CREATE DATABASE drelephant;
Changing the length of varchars in sql file:
# vi /usr/local/dr-elephant-master/target/universal/dr-elephant-2.0.13/conf/evolutions/default/1.sql
change all varchars to 128
:%s/WORD-To-Find-HERE/Replace-Word-Here/g
%s/800/128/g
%s/255/128/g
Now start and check the logs:
# chown -R hdfs:hadoop /usr/local/dr-elephant-master

# su - hdfs

# cd /usr/local/dr-elephant-master/target/universal/dr-elephant-2.0.13

# bin/start.sh

Reading from config file...
db_url:  localhost
db_name:  drelephant
db_user:  root
http port:  8989
This is hadoop2.x grid. Adding Java library to path: /usr/hdp/2.6.3.0-235/hadoop/lib/native
Starting Dr. Elephant ....
Dr. Elephant started.

# netstat -plant | grep 8989
tcp        0      0 0.0.0.0:8989            0.0.0.0:*               LISTEN      11352/java

# vi logs/application.log

2017-12-08 13:02:35,075 - [INFO] - from play in main
database [default] connected at jdbc:mysql://localhost/drelephant?characterEncoding=UTF-8

2017-12-08 13:02:36,050 - [INFO] - from application in main
Starting Application...

2017-12-08 13:02:36,094 - [INFO] - from play in main
Application started (Prod)

2017-12-08 13:02:36,174 - [INFO] - from play in main
Listening for HTTP on /0.0.0.0:8989
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *