`

mysql hadoop applier install and configure

 
阅读更多

1.install and configure hadoop-2.6.0 ($HADOOP_HOME must be set).


2. download mysql-5.6.22.tar.gz source code from http://dev.mysql.com/downloads/mysql/ 

#tar xf mysql-5.6.22.tar.gz

#cd mysql-5.6.22

#cmake .

#make

#export MYSQL_DIR=/path/to/mysql-5.6.22

 

3. download mysql-connector-c-6.1.5-src.tar.gz  from http://dev.mysql.com/downloads/connector/c/#downloads

#tar xf mysql-connector-c-6.1.5-src.tar.gz

#cd mysql-connector-c-6.1.5-src

#cmake .

#make

#make install

 

4.download mysql hadoop applier from  http://labs.mysql.com.

#tar xf mysql-hadoop-applier-0.1.0-alpha.tar.gz

#cd mysql-hadoop-applier-0.1.0-alpha

5. download FindHDFS.cmake from https://github.com/cloudera/impala/blob/master/cmake_modules/FindHDFS.cmake

#mv FindHDFS.cmake   /path/to/mysql-hadoop-applier-0.1.0-alpha/MyCMake

#cmake . -DENABLE_DOWNLOADS=1

#make

#make install

The library 'libreplication' which is to be used by Hadoop Applier is in lib dir 

An otherway is :

#mkdir build

#cd build

#cmake .. -DCMAKE_MODULE_PATH:String=../MyCMake -DENABLE_DOWNLOADS=1

#make

#make install

 

#export PATH=$HADOOP_HOME/bin:$PATH

#export CLASSPATH=$(hadoop classpath)
 

#cd build/examples/mysql2hdfs

#make

 

there is a error

[ 77%] Built target replication_static
Linking CXX executable happlier
/usr/bin/ld: warning: libmawt.so, needed by /opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so, not found (try using -rpath or -rpath-link)
/opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so: undefined reference to `awt_Unlock@SUNWprivate_1.1'
/opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so: undefined reference to `awt_GetComponent@SUNWprivate_1.1'
/opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so: undefined reference to `awt_Lock@SUNWprivate_1.1'
/opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so: undefined reference to `awt_GetDrawingSurface@SUNWprivate_1.1'
/opt/jdk1.7.0_51/jre/lib/amd64/libjawt.so: undefined reference to `awt_FreeDrawingSurface@SUNWprivate_1.1'
collect2: ld returned 1 exit status
make[2]: *** [examples/mysql2hdfs/happlier] Error 1
make[1]: *** [examples/mysql2hdfs/CMakeFiles/happlier.dir/all] Error 2
make: *** [all] Error 2

 the suggested solution is 

export LD_LIBRARY_DIR=${JAVA_HOME}/jre/lib/amd64/xawt:${LD_LIBRARY_DIR}

 but the error still exists.

 

(I found that the above env variable is error,the correct is

export LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/amd64/xawt:${LD_LIBRARY_PATH}

)

#./happlier

 

a error is

[root@dmining05 mysql2hdfs]# ./happlier 
The default data warehouse directory in HDFS will be set to /usr/hive/warehouse
Change the default data warehouse directory? (Y or N) n
Enter either Y or N:N
loadFileSystems error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsBuilderConnect(forceNewInstance=0, nn=default, port=0, kerbTicketCachePath=(NULL), userName=(NULL)) error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
Couldnot connect to HDFS file system

 

the error may be due to the following cause

http://stackoverflow.com/questions/21064140/hadoop-c-hdfs-test-running-exception

 

#echo $CLASSPATH

/root/hadoop-2.6.0/etc/hadoop:
/root/hadoop-2.6.0/share/hadoop/common/lib/*:
/root/hadoop-2.6.0/share/hadoop/common/*:
/root/hadoop-2.6.0/share/hadoop/hdfs:
/root/hadoop-2.6.0/share/hadoop/hdfs/lib/*:
/root/hadoop-2.6.0/share/hadoop/hdfs/*:
/root/hadoop-2.6.0/share/hadoop/yarn/lib/*:
/root/hadoop-2.6.0/share/hadoop/yarn/*:
/root/hadoop-2.6.0/share/hadoop/mapreduce/lib/*:
/root/hadoop-2.6.0/share/hadoop/mapreduce/*:
/root/hadoop-2.6.0/contrib/capacity-scheduler/*.jar

 

For hadoop versions 2.0.0 and above, the classpath doesn't support wild characters. If you add the jars explicitly to the CLASSPATH, your app will work.

 

Can JNI be made to honour wildcard expansion in the classpath?

One way is to build a file name setclass.sh  

#!/bin/bash

hcp=$(hadoop classpath)
#echo $hcp
arr=(${hcp//:/ })

len=${#arr[@]}
let len-=1
echo $len
j=0
export CLASSPATH=/etc/hadoop/conf
for i in ${arr[@]}
do
#    echo $i
     if [ $j -eq 0 ]; then
     export CLASSPATH=$i
     elif [ $j -eq $len ]; then
     echo $i
     else
     export CLASSPATH=$CLASSPATH:$i
     fi
     let j+=1
done

 then source it, not to execute it

#source setclass.sh

#echo $CLASSPATH

This work well in current session, if want to make it work gloably,

#$echo $CLASSPATH >> ~/.bashrc

#source  ~/.bashrc

 

open another consele to check it .

 

mysql configuration in /etc/my.cnf likes

[mysqld]

basedir = /usr/local/mysql
datadir = /var/lib/mysql
port = 3306
#socket = /var/lib/mysql/mysql.sock
user=mysql
bind_address = ::

#bin log conf
log_bin = masterbin_log
binlog_checksum = NONE
binlog_format = ROW
server-id = 2

 

 

#./happlier mysql://root@127.0.0.1:3306 hdfs://localhost:9000

the msg is

 

 

 the right way is

#./happlier mysql://root:123456@127.0.0.1:3306 hdfs://localhost:9000

(you should provide password to access mysql)

 but this warning still exists

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

 

 

 

 

 

Refrences

http://innovating-technology.blogspot.com/2013/04/mysql-hadoop-applier-part-1.html

http://innovating-technology.blogspot.com/2013/04/mysql-hadoop-applier-part-2.html

http://paddy-w.iteye.com/blog/2023656

http://www.tuicool.com/articles/NfArA3i

  • 大小: 33.2 KB
分享到:
评论

相关推荐

    Hadoop_Data Processing and Modelling-Packt Publishing(2016).pdf

    Its simple programming model, "code once and deploy at any scale" paradigm, and an ever-growing ecosystem make Hadoop an inclusive platform for programmers with different levels of expertise and ...

    CDH_Hadoop_单机安装_集群安装_CDH-Hadoop-Install.zip

    CDH_Hadoop_单机安装_集群安装_CDH-Hadoop-Install

    Introduction to SAS and Hadoop

    This course is included in the Expert Exchange on Hadoop: Using SAS/ACCESS service offering to configure SAS/ACCESS Interface to Hadoop or SAS/ACCESS Interface to Impala to work with your Hadoop ...

    Hadoop Data Processing and Modelling azw3

    Hadoop Data Processing and Modelling 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    hadoop2.6 centos6.5 伪分布式环境部署 实例

    export HADOOP_OPTS="-Djava.library.path=${HADOOP_INSTALL}/lib:${HADOOP_INSTALL}/lib/native" ``` 配置 Hadoop-env.sh 使用以下命令配置 Hadoop-env.sh 文件: ``` cd /opt/modules/hadoop vim ./etc/hadoop/...

    hadoop_mysql-libs.rar 在linux用

    标题 "hadoop_mysql-libs.rar 在linux用" 暗示了这个压缩包包含的是与在Linux环境下使用Hadoop和MySQL相关的库文件。Hadoop是一个开源的分布式计算框架,而MySQL是一个广泛使用的开源关系型数据库管理系统。它们经常...

    Scaling Big Data with Hadoop and Solr

    Starting with the basics of Apache Hadoop and Solr, this book then dives into advanced topics of optimizing search with some interesting real-world use cases and sample Java code.

    hadoop.dll-and-winutils.exe-for-hadoop2.7

    标题中的"hadoop.dll-and-winutils.exe-for-hadoop2.7"正指向了这个问题的解决方案。 "winutils.exe"是Hadoop项目的一部分,它在Linux系统中对应的是"bin/hadoop"命令,用于执行各种系统级操作,如设置HDFS的权限、...

    hadoop_install-sqoop数据导入

    sqoop数据导入 sqoop数据导入 sqoop数据导入 sqoop数据导入 sqoop数据导入

    Hadoop汇总整理.doc

    2. 下载 Hadoop,并上传到 Linux 上并解压文件,配置环境变量 HADOOP_INSTALL,在 PATH 中追加内容:HADOOP_INSTALL/bin 和 HADOOP_INSTALL/sbin。 3. 按照配置文件中的信息,配置 core-site.xml、hdfs-site.xml、...

    Big Data, MapReduce, Hadoop, and Spark with Python

    Big Data, MapReduce, Hadoop, and Spark with Python: Master Big Data Analytics and Data Wrangling with MapReduce Fundamentals using Hadoop, Spark, and Python by LazyProgrammer English | 15 Aug 2016 | ...

    疫情大数据分析Python爬取数据+MySQL+hadoop+Vue+ElementUI大屏展示(源码+说明).zip

    【资源说明】 1、该资源内项目代码都是经过测试运行成功,功能正常的情况下才上传的,请放心下载使用。...疫情大数据分析Python爬取数据+Springboot+MySQL+hadoop(存取)+Vue+ElementUI大屏展示(源码+项目说明).zip

    Professional Hadoop

    This book covers the process from beginning to end, providing a crash course for professionals needing to learn and apply Hadoop quickly., Configure storage, UE, and in-memory computing Integrate ...

    win10下搭建Hadoop环境(jdk+mysql+hadoop+scala+hive+spark) 3.docx

    在Windows 10环境下搭建Hadoop生态系统,包括JDK、MySQL、Hadoop、Scala、Hive和Spark等组件,是一项繁琐但重要的任务,这将为你提供一个基础的大数据处理平台。下面将详细介绍每个组件的安装与配置过程。 **1. JDK...

    hadoop backup and recovery solutions

    从所给内容中提到的书名《Hadoop Backup and Recovery Solutions》来看,书中深入探讨了如何从Hadoop备份集群中恢复数据以及如何排查问题。这包括了对Hadoop集群备份过程中可能遇到的问题,及其解决方案的介绍,也...

    Hadoop、hive 、MySQL

    Hadoop、hive 、MySQL

    Ubuntu下创建hadoop组和hadoop用户.pdf

    export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib" ``` 使修改生效: ```bash source ~/.bashrc ``` b. 编辑`/usr/local/...

    hadoop 单机安装

    export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib" # HADOOP VARIABLES END ``` 然后,更新环境变量: ```bash source ~/.bashrc `...

Global site tag (gtag.js) - Google Analytics