[huiyunltd@hadoop-senior ~]$ tar xf /opt/softwares/apache-hive-0.13.1-bin.tar.gz -C /opt/app/ [huiyunltd@hadoop-senior ~]$ /opt/app/hadoop-2.5.0/sbin/start-dfs.sh hadoop-senior.huiyunltd.com:50070 [huiyunltd@hadoop-senior02 ~]$ /opt/app/hadoop-2.5.0/sbin/start-yarn.sh http://hadoop-senior02.huiyunltd.com:8088 [huiyunltd@hadoop-senior03 ~]$ /opt/app/hadoop-2.5.0/bin/hdfs dfs -mkdir /tmp [huiyunltd@hadoop-senior03 ~]$ /opt/app/hadoop-2.5.0/bin/hdfs dfs -chmod g+x /tmp [huiyunltd@hadoop-senior03 ~]$ /opt/app/hadoop-2.5.0/bin/hdfs dfs -mkdir -p /user/hive/warehouse [huiyunltd@hadoop-senior03 ~]$ /opt/app/hadoop-2.5.0/bin/hdfs dfs -chmod g+x /user/hive/warehouse [huiyunltd@hadoop-senior ~]$ /opt/app/hadoop-2.5.0/sbin/mr-jobhistory-daemon.sh start historyserver /opt/app/apache-hive-0.13.1-bin/conf/hive-env.sh HADOOP_HOME=/opt/app/hadoop-2.5.0 export HIVE_CONF_DIR=/opt/app/apache-hive-0.13.1-bin/conf [huiyunltd@hadoop-senior ~]$ /opt/app/apache-hive-0.13.1-bin/bin/hive hive> show databases; hive> use default; hive> create table kms_log(ip string,user string,requesturl string); hive> show tables; hive> desc kms_log; hive> select count(*) from kms_log; hive> create table student(id int,name string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'; [huiyunltd@hadoop-senior ~]$ touch /opt/datas/student.txt student.txt --------------- 1001 jack 1002 mary 1003 thomas 1004 tom hive> load data local inpath '/opt/datas/student.txt' into table student; hive> select * from student; hive> select * from student; hive> select id from student; [huiyunltd@hadoop-senior ~]$ unzip -o -d /opt/softwares/ /opt/softwares/mysql-libs.zip [huiyunltd@hadoop-senior ~]$ rpm -qa|grep mysql [huiyunltd@hadoop-senior ~]$ sudo rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64 [huiyunltd@hadoop-senior ~]$ rpm -qa|grep mysql [huiyunltd@hadoop-senior ~]$ sudo rpm -ivh /opt/softwares/mysql-libs/MySQL-server-5.6.24-1.el6.x86_64.rpm [huiyunltd@hadoop-senior ~]$ sudo rpm -ivh /opt/softwares/mysql-libs/MySQL-client-5.6.24-1.el6.x86_64.rpm [huiyunltd@hadoop-senior ~]$ sudo cat /root/.mysql_secret [huiyunltd@hadoop-senior ~]$ service mysql status [huiyunltd@hadoop-senior ~]$ rpm -qa|grep MySQL [huiyunltd@hadoop-senior ~]$ sudo service mysql start mysql> SET PASSWORD=PASSWORD('123456') mysql> select User,Host,Password from user; mysql> update user set Host='%' where User='root' and Host='localhost'; mysql> delete from user where User='root' and Host='hadoop-senior.huiyunltd.com'; mysql> delete from user where User='root' and Host='127.0.0.1'; mysql> delete from user where User='root' and Host='::1'; [huiyunltd@hadoop-senior ~]$ sudo service mysql restart [huiyunltd@hadoop-senior ~]$ cp /opt/app/apache-hive-0.13.1-bin/conf/hive-default.xml.template /opt/app/apache-hive-0.13.1-bin/conf/hive-site.xml [huiyunltd@hadoop-senior ~]$ tar xf /opt/softwares/mysql-libs/mysql-connector-java-5.1.27.tar.gz -C /opt/softwares/mysql-libs/ [huiyunltd@hadoop-senior ~]$ cp /opt/softwares/mysql-libs/mysql-connector-java-5.1.27/mysql-connector-java-5.1.27-bin.jar /opt/app/apache-hive-0.13.1-bin/lib/成都创新互联是一家网站设计公司,集创意、互联网应用、软件技术为一体的创意网站建设服务商,主营产品:成都响应式网站建设、品牌网站设计、成都营销网站建设。我们专注企业品牌在网站中的整体树立,网络互动的体验,以及在手机等移动端的优质呈现。网站制作、网站设计、移动互联产品、网络运营、VI设计、云产品.运维为核心业务。为用户提供一站式解决方案,我们深知市场的竞争激烈,认真对待每位客户,为客户提供赏析悦目的作品,网站的价值服务。
--------------hive-site.xml-------------------
javax.jdo.option.ConnectionURL jdbc:mysql://hadoop-senior.huiyunltd.com:3306/metastore?createDatabaseIfNotExist=true JDBC connect string for a JDBC metastore javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver Driver class name for a JDBC metastore javax.jdo.option.ConnectionUserName root username to use against metastore database javax.jdo.option.ConnectionPassword 123456 password to use against metastore database
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。