安裝jdk:html
source ~/.bash_profile [推薦在當前用戶的環境變量配置]
java
安裝hadoopnode
依據hadoop2.6的配置文件。建立/user/hive/warehouse 目錄,並賦予寫的權限。
mysql
安裝mysql: linux
http://blog.csdn.net/mecho/article/details/38414155sql
一、查看系統是否安裝了MySQL數據庫
使用命令:bash
#rpm -qa | grep mysql ide
二、卸載已安裝的MySQLoop
卸載mysql命令以下:
#rpm -e --nodeps mysql-libs-5.1.61-4.el6.x86_64
要將 /var/lib/mysql文件夾下的全部文件都刪除乾淨
三、安裝新的MySQL
命令以下:
#rpm -ivh MySQL-server-5.5.30-1.el6.x86_64.rpm
#rpm -ivh MySQL-client-5.5.30-1.el6.x86_64.rpm
#rpm -ivh MySQL-devel-5.5.30-1.el6.x86_64.rpm
四、啓動MySQL服務
方法一:從新啓動系統
方法二:#service mysql start
查看MySQL運行狀態的方法:
使用命令:# /etc/rc.d/init.d/mysql status
結果: 顯示 「SUCCESS」 則已經運行
顯示 「FAILED」 則沒有運行
MySQL服務一些其餘命令
a、察看mysql是否在自動啓動列表: # /sbin/chkconfig –list
b、添加mysql到系統自啓動服務組: # /sbin/chkconfig – add mysql
c、把mysql從啓動服務組中刪除: # /sbin/chkconfig – del mysql
d、中止mysql服務: # service mysql stop
e、腳本啓動mysql服務: # /etc/rc.d/init.d/mysqld start
f、腳本中止mysql服務: # /etc/rc.d/init.d/mysqld stop
五、安裝完成以後爲MySQL設置root密碼。
命令以下:
# mysql -u root -p
會提示輸入密碼,初始root密碼保存在'/root/.mysql_secret'文件中
接着輸入mysql>SET PASSWORD = PASSWORD('123456');
六、mysql安裝目錄說明
/var/lib/mysql 數據庫文件
/usr/share/mysql 命令及配置文件
/usr/bin(mysqladmin、mysqldump等命令)
七、linux 下安裝的mysql表名是區分大小寫的,若是要不區分大小寫,能夠採用如下方式
一、拷貝 /usr/share/mysql/my-huge.cnf 到 /etc/my.cnf(若是已有該文件能夠直接修改)
命令以下:# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
二、修改my.cnf 文件
在 [mysqld]下增長
lower_case_table_names=1 #表名所有爲小寫,避免出現大小寫敏感
三、重啓mysql
# service mysql restart
http://f.dataguru.cn/thread-498990-1-1.html
8(可選)、爲鏈接MySQL的主機分配權限:
命令以下:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'hdfs-spark-1'IDENTIFIED BY '123456' WITH GRANT OPTION;
>mysql GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO root@xxx.xxx.x.xx identified by '123456'; //xxx.xxx.x.xx是你的IP
/usr/bin/mysqladmin -u root password 'mysql' // 爲root帳號設置密碼mysql -u root –p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'mysql' WITH GRANT OPTION;
FLUSH PRIVILEGES;
create user hive identified by 'hive';
GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%' IDENTIFIEDBY 'hive' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'localhost'IDENTIFIED BY 'hive' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'node1'IDENTIFIED BY 'hive' WITH GRANT OPTION;
FLUSH PRIVILEGES;
九、開機啓動MySQL
用root用戶登陸終端
查看是否已經有MySQL的服務
#chkconfig --list
若是沒有MySQL(若是有請忽略這個步驟)
#chkconfig --add mysql
設置開機啓動mysql服務
#chkconfig mysql on
10(可選)、更改MySQL默認字符集 (默認字符集和操做系統字符集同樣,因此不須要設置)
查看mysql字符集:mysql> show variables like 'character_set_%';
http://czhwin.iteye.com/blog/1855549
解壓hive
複製MySQL-devel-5.6.20-1.el6.x86_64.rpm到$HIVE_HOME/lib
更改hive-site.xml的配置文件
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://hdfs-hive: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>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
<description>show database db name</description>
</property>
<property>
<name>hive.cli.print.current.header</name>
<value>true</value>
<description>show database table head name</description>
</property>
<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>show database table head name</description>
</property>
<!--
<property>
<name>hive.metastore.uris</name>
<value>thrift://bingclouds:9083</value>
<property>
<property>
<name>hive.fetch.task.conversion</name>
<value>more</value>
<property>
-->
</configuration>
啓動hive
建議使用beeline的方式啓動