1 mariaDB安装
[
root@localhost
local]# cp /usr/local/mariadb-10.1.14-linux-x86_64/support-files/my-medium.cnf /etc/my.cnf
[client]
#password = your_password
port = 3306
socket = /usr/local/mysql.sock
[mysqld]
user=mysql
port = 3306
socket = /usr/local/mysql.sock
basedir =/usr/local/mariadb-10.1.14-linux-x86_64/
datadir =/usr/local/mariadb-10.1.14-linux-x86_64/
pid-file =/usr/local/mariadb-10.1.14-linux-x86_64/mysql.pid
log-error =/usr/local/mariadb-10.1.14-linux-x86_64/err.log
[
root@localhost
local]#
/usr/local/mariadb-10.1.14-linux-x86_64/scripts/mysql_install_db –user=mysql –basedir=/usr/local/mariadb-10.1.14-linux-x86_64/ –datadir=/usr/local/mariadb-10.1.14-linux-x86_64/& —
初始化数据库
[
root@localhost
support-files]# cp /usr/local/mariadb-10.1.14-linux-x86_64/support-files/mysql.server /etc/init.d/mysql
basedir=/usr/local/mariadb-10.1.14-linux-x86_64
datadir=/usr/local/mariadb-10.1.14-linux-x86_64
mysqld_pid_file_path=/usr/local/mariadb-10.1.14-linux-x86_64/mysql.pid
MariaDB [(none)]> create database hive;
2 hive的安装
将
mysql-connector-java-x.x.x.jar复制到hive的lib目录下
mysql-connector-java-x.x.x.jar复制到hive的lib目录下
HADOOP_HOME=/usr/local/hadoop-2.7.1/
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</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>root</value>
<description>Username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>root</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/usr/local/hive</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/usr/local/hive</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
[
root@localhost
conf]# cp hive-log4j2.properties.template hive-log4j2.properties
export JAVA_HOME=/usr/local/jdk1.7.0_79/
export HIVE_HOME=/usr/local/apache-hive-2.1.0-bin/
export HADOOP_HOME=/usr/local/hadoop-2.7.1/
HIVE_HOME=/usr/local/apache-hive-2.1.0-bin/
PATH=:$PATH
VE_HOME=/usr/local/apache-hive-2.1.0-bin/
export HIVE_HOME
启动hive