Build and setup a Sqoop2 installation steps are documented at https://cwiki.apache.org/SQOOP/sqoop2-manual-setup.html
If you want to use one click shell script to do above then you can copy the following code
Just save the code below in some shell script file say
sqoop2_setup.sh
chmod 777 sqoop2_setup.sh
Change the workspace_dir path below depending on where you want sqoop setup to take place.
#!/bin/sh
# Change the path for workspace directory below
# And run the script
# After its complete you can start sqoop2 by going to http://localhost:8080/sqoop/
# For more details see https://cwiki.apache.org/confluence/display/SQOOP/Sqoop2+Manual+Setup
workspace_dir=/home/hadoop/sqoop
cd $workspace_dir
svn co https://svn.apache.org/repos/asf/sqoop/branches/sqoop2
cd sqoop2
mvn install
cd ..
mkdir s2test
cd s2test
mkdir bin conf logs repository
cd ..
wget http://apache.mirrors.hoobly.com/tomcat/tomcat-7/v7.0.27/bin/apache-tomcat-7.0.27.tar.gz
tar zxvf apache-tomcat-7.0.27.tar.gz
rm apache-tomcat-7.0.27.tar.gz
mv apache-tomcat-7.0.27 s2test/server
# Working directory is s2test created earlier
echo "export JAVA_OPTS=-Dsqoop.config.dir=$workspace_dir/s2test/conf" >> s2test/server/bin/setenv.sh
chmod +x s2test/server/bin/setenv.sh
echo "# File s2test/conf/sqoop_bootstrap.properties
sqoop.config.provider=org.apache.sqoop.core.PropertiesConfigurationProvider" >> s2test/conf/sqoop_bootstrap.properties
echo "
# File s2test/conf/sqoop.properties
# Log4J system
org.apache.sqoop.log4j.appender.file=org.apache.log4j.RollingFileAppender
org.apache.sqoop.log4j.appender.file.File=$workspace_dir/s2test/logs/sqoop.log
org.apache.sqoop.log4j.appender.file.MaxFileSize=25MB
org.apache.sqoop.log4j.appender.file.MaxBackupIndex=5
org.apache.sqoop.log4j.appender.file.layout=org.apache.log4j.PatternLayout
org.apache.sqoop.log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} [%l] %m%n
org.apache.sqoop.log4j.debug=true
org.apache.sqoop.log4j.rootCategory=WARN, file
org.apache.sqoop.log4j.category.org.apache.sqoop=DEBUG
org.apache.sqoop.log4j.category.org.apache.derby=INFO
# Repository
org.apache.sqoop.repository.provider=org.apache.sqoop.repository.JdbcRepositoryProvider
org.apache.sqoop.repository.jdbc.handler=org.apache.sqoop.repository.derby.DerbyRepositoryHandler
org.apache.sqoop.repository.jdbc.transaction.isolation=READ_COMMITTED
org.apache.sqoop.repository.jdbc.maximum.connections=10
org.apache.sqoop.repository.jdbc.url=jdbc:derby:$workspace_dir/s2test/repository/db;create=true
org.apache.sqoop.repository.jdbc.create.schema=true
org.apache.sqoop.repository.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
org.apache.sqoop.repository.jdbc.user=sa
org.apache.sqoop.repository.jdbc.password=
org.apache.sqoop.repository.sysprop.derby.stream.error.file=$workspace_dir/s2test/logs/derbyrepo.log" >> s2test/conf/sqoop.properties
cp $workspace_dir/sqoop2/server/target/sqoop.war $workspace_dir/s2test/server/webapps/
rm -rf $workspace_dir/s2test/server/webapps/sqoop2/
No comments:
Post a Comment
Please share your views and comments below.
Thank You.