Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sqoop-import-all-tables --verbose --connect jdbc:mysql://X.X.X.X/edgeowt --username root -P --hive-import --warehouse-dir /user/hive/warehouse --hive-database edgeowt.db --hive-overwrite
- INFO hive.HiveImport: FAILED: SemanticException [Error 10072]: Database does not exist: edgeowt.db
- 15/04/16 13:32:09 ERROR tool.ImportAllTablesTool: Encountered IOException running import job: java.io.IOException: Hive exited with status 88
- $HIVE_HOME/bin>beeline
- beeline> !connect jdbc:hive2://localhost:10000 scott tiger org.apache.hive.jdbc.HiveDriver
- 0: jdbc:hive2://localhost:10000> show databases;
- +----------------+--+
- | database_name |
- +----------------+--+
- | default |
- | edgeowt |
- +----------------+--+
- Permission Owner Group Size Replication Block Size Name
- drwxr-xr-x hduser supergroup 0 B 0 0 B candidate
- drwxr-xr-x scott supergroup 0 B 0 0 B edgeowt.db
- drwxr-xr-x scott supergroup 0 B 0 0 B hd_temperature
- 0: jdbc:hive2://localhost:10000>GRANT ALL ON DATABASE edgeowt TO USER hduser;
- 0: jdbc:hive2://localhost:10000> SHOW GRANT ON DATABASE edgeowt;
- +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+--+
- | database | table | partition | column | principal_name | principal_type | privilege | grant_option | grant_time | grantor |
- +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+--+
- | edgeowt | | | | admin | ROLE | ALL | false | 1429170366000 | scott |
- | edgeowt | | | | hduser | USER | ALL | false | 1429170906000 | scott |
- +-----------+--------+------------+---------+-----------------+-----------------+------------+---------------+----------------+----------+--+
- # Set JAVA_HOME (we will also configure JAVA_HOME directly for Hadoop later on)
- export JAVA_HOME=/usr/lib/jvm/java-7-oracle
- # Set Hadoop-related environment variables
- export HADOOP_INSTALL=/opt/hadoop
- export PATH=$PATH:$HADOOP_INSTALL/bin
- export PATH=$PATH:$HADOOP_INSTALL/sbin
- export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
- export HADOOP_COMMON_HOME=$HADOOP_INSTALL
- export HADOOP_HDFS_HOME=$HADOOP_INSTALL
- export YARN_HOME=$HADOOP_INSTALL
- export HADOOP_HOME=$HADOOP_INSTALL
- # Set hive home
- export HIVE_HOME=/opt/hive
- export PATH=$PATH:$HIVE_HOME/bin
- # Set HCatlog home
- export HCAT_HOME=$HIVE_HOME/hcatalog
- export PATH=$PATH:$HCAT_HOME/bin
- # Set Sqoop home
- export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native"
- export SQOOP_HOME=/opt/sqoop
- export SQOOP_CONF_DIR="$SQOOP_HOME/conf"
- export SQOOP_CLASSPATH="$SQOOP_CONF_DIR"
- export PATH=$PATH:$SQOOP_HOME/bin
- sqoop-import-all-tables --verbose --connect jdbc:mysql://X.X.X.X/edgeowt --username root -P --hive-import --warehouse-dir /user/hive/warehouse --hive-database edgeowt --hive-overwrite
- sqoop-import-all-tables --connect jdbc:mysql://X.X.X.X/edgeowt --username root -P --hive-import --hive-database edgeowt --hive-overwrite -m 4
- sqoop-import-all-tables --verbose --connect jdbc:mysql://X.X.X.X/edgeowt --username root -P --hive-import --warehouse-dir /user/hive/warehouse --hive-table edgeowt.db --hive-overwrite
- #!/bin/sh
- #tabfold="/usr/local/hivetables"
- #cd $tabfold
- mysql -u $1 -p$2 -N information_schema -e "select table_name from tables where table_schema = '$3'" > /usr/local/hivetables/tables.txt
- HOSTFILE="/usr/local/hivetables/tables.txt"
- for host in $(cat $HOSTFILE)
- do
- $SQOOP_HOME/bin/sqoop import --connect jdbc:mysql://localhost:3306/$3 --table $host --username $1 --password $2 --hive-import --hive-table $4.$host --warehouse-dir /user/hive/warehouse
- done
- sudo cp /etc/impala/conf.dist/hive-site.xml /etc/sqoop/conf/
- sudo cp /etc/impala/conf.dist/hive-site.xml /etc/sqoop/conf.cloudera.sqoop_client/
Add Comment
Please, Sign In to add comment