Successful installation of MapR distribution, we need to add services like Hive, Sqoop, Spark, Impala, etc. Here we are adding Hive service with simple commands in MapR for Hadoop Environment.
Add Hive Service in MapR :
We must follow below commands for Hive services:
Step 1: yum install for Hive Mapr.
[root@master1 ~]# yum install mapr-hive mapr-hiveserver2 mapr-hivemetastore mapr-hivewebhcat
Here Loaded plugins like fastest mirrors, refresh-package kit, security yu
Setting up Install Process is done in this step
Installing below packages of MapR Hiver Services:
mapr – hive noarch
mapr -hivemetastore
mapr-hiveserver2
mapr-hivewebhcat
Step 2: To install MySQL server for external Database for multiple users.
[root@master1 ~]# yum install MySQL - server
Download below rpm files for MySQL servers:
mysql-5.1.73-8.el6_8.x86_64.rpm
mysql-server-5.1.73-8.el6_8.x86_64.rpm
perl-DBD-MySQL-4.013-3.el6.x86_64.rpm
perl-DBI-1.609-4.el6.x86_64.rpm
Step 3: Checking of MySQL Status
[root@master1 ~]# service mysqld status
Step 4: Start MySQL service by using below command:
[root@master1 ~]# service mysqld start
After start MySQL services set the password for mysql service
#mysql -u root -p
Step 5: Grant all privileges.
mysql>grant all privileges on *.* to 'your name '@'localhost' identified by 'your name ';
Step 6: Flush all privileges.
mysql>flush privileges;
Step 7: Exit from MySQL cli
mysql>exit
Step 8: Set the hive site .xml file for fully configurations
[root@master1 ~] # vi /opt/mapr/hive/hive-2.1/conf/hive-site.xml
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value> <description>JDBC connect string for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>Driver class name for a JDBC metastore</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>siva</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value> your name</value> <description>password to use against metastore database</description> </property> <property> <name>hive.metastore.uris</name> <value>thrift://localhost:9089</value> </property> </configuration>
Step 9: export the metastotr with port number.
[root @ master1 ~]# export METASTORE_PORT=9089
Step 10: For MySQL DB schema
[root @ master1 ~]# /opt/mapr/hive/hive-2.1/bin/schematool -dbType mysql -initSchema
Step 11: Login with MySQL CLI with your credentials
[root @ master 1 ~]# mysql -u name -p Enter password:
Step 12: To check databases
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | hive | | mysql | | test | +--------------------+
Step 13: Exit from MySQL CLI
mysql> exit Bye
Step 14: Install MySQL connector java file for connection
[root@master1 ~]# yum -y install mysql-connector-java
Step 15: Start Meta store services
[root@master1 ~]# /opt/mapr/hive/hive-2.1/bin/hive --service metastore --start
Step 16: Start Hive services:
[root@master1 ~]# hive Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.