热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Movingdatafrommysqltocassandra_MySQL

Movingdatafrommysqltocassandra
I had a relational database, that I wanted to migrate to cassandra. Cassandra's sstableloader provides option to load the existing data from flat files to a cassandra ring . Hence this can be used as a way to migrate data in relational databases to cassandra, as most relational databases let us export the data into flat files.

sqoop gives the option to do this effectively. Interestingly, DataStax Enterprise provides everything we want in the big data space as a package. This includes, cassandra, hadoop, hive , pig, sqoop, and mahout, which comes handy in this case.

Under the resources directory, you may find the cassandra, dse, hadoop, hive, log4j-appender, mahout, pig, solr, sqoop, and tomcat specific configurations.

For example, from resources/hadoop/bin, you may format the hadoop name node using

./hadoop namenode -format

as usual.

* Download and extract DataStax Enterprise binary archive (dse-2.1-bin.tar.gz).

* Follow the documentation , which is also available as a PDF .

* Migrating a relational database to cassandra is documented and is also blogged .

* Before starting DataStax, make sure that the JAVA_HOME is set. This also can be set directly on conf/hadoop-env.sh.

* Include the connector to the relational database into a location reachable by sqoop.

I put mysql-connector-java-5.1.12-bin.jar under resources/sqoop.

* Set the environment

$ bin/dse-env.sh

* Start DataStax Enterprise, as an Analytics node.

$ sudo bin/dse cassandra -t

where cassandra starts the Cassandra process plus CassandraFS and the -t option starts the Hadoop JobTracker and TaskTracker processes.

if you start without the -t flag, the below exception will be thrown during the further operations that are discussed below.

No jobtracker found

Unable to run : jobtracker not found

Hence do not miss the -t flag.

* Start cassandra cli to view the cassandra keyrings and you will be able to view the data in cassandra, once you migrate using sqoop as given below.

$ bin/cassandra-cli -host localhost -port 9160

Confirm that it is connected to the test cluster that is created on the port 9160, by the below from the CLI.

[default@unknown] describe cluster;

Cluster Information:

Snitch: com.datastax.bdp.snitch.DseDelegateSnitch

Partitioner: org.apache.cassandra.dht.RandomPartitioner

Schema versions:

f5a19a50-b616-11e1-0000-45b29245ddff: [127.0.1.1]

If you have missed mentioning the host/port (starting the cli by just bin/cassandra-cli ) or given it wrong, you will get the response as "Not connected to a cassandra instance."

$ bin/dse sqoop import --connect jdbc:mysql://127.0.0.1:3306/shopping_cart_db --username root --password root --table Category --split-by categoryName --cassandra-keyspace shopping_cart_db --cassandra-column-family Category_cf --cassandra-row-key categoryName --cassandra-thrift-host localhost --cassandra-create-schema

Above command will now migrate the table "Category" in the shopping_cart_db with the primary key categoryName, into a cassandra keyspace named shopping_cart, with the cassandra row key categoryName. You may use the --direct mysql specific option, which is faster. In my above command, I have everything runs on localhost.

+--------------+-------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |

+--------------+-------------+------+-----+---------+-------+

| categoryName | varchar(50) | NO | PRI | NULL | |

| description | text | YES | | NULL | |

| image | blob | YES | | NULL | |

+--------------+-------------+------+-----+---------+-------+

This also creates the respective java class (Category.java), inside the working directory.

To import all the tables in the database, instead of a single table.

$ bin/dse sqoop import-all-tables -m 1 --connect jdbc:mysql://127.0.0.1:3306/shopping_cart_db --username root --password root --cassandra-thrift-host localhost --cassandra-create-schema --direct

Here "-m 1" tag ensures a sequential import. If not specified, the below exception will be thrown.

ERROR tool.ImportAllTablesTool: Error during import: No primary key could be found for table Category. Please specify one with --split-by or perform a sequential import with '-m 1'.

To check whether the keyspace is created,

[default@unknown] show keyspaces;

................

Keyspace: shopping_cart_db:

Replication Strategy: org.apache.cassandra.locator.SimpleStrategy

Durable Writes: true

Options: [replication_factor:1]

Column Families:

ColumnFamily: Category_cf

Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type

Default column value validator: org.apache.cassandra.db.marshal.UTF8Type

Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type

Row cache size / save period in seconds / keys to save : 0.0/0/all

Row Cache Provider: org.apache.cassandra.cache.SerializingCacheProvider

Key cache size / save period in seconds: 200000.0/14400

GC grace seconds: 864000

Compaction min/max thresholds: 4/32

Read repair chance: 1.0

Replicate on write: true

Bloom Filter FP chance: default

Built indexes: []

Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy

.............

[default@unknown] describe shopping_cart_db;

Keyspace: shopping_cart_db:

Replication Strategy: org.apache.cassandra.locator.SimpleStrategy

Durable Writes: true

Options: [replication_factor:1]

Column Families:

ColumnFamily: Category_cf

Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type

Default column value validator: org.apache.cassandra.db.marshal.UTF8Type

Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type

Row cache size / save period in seconds / keys to save : 0.0/0/all

Row Cache Provider: org.apache.cassandra.cache.SerializingCacheProvider

Key cache size / save period in seconds: 200000.0/14400

GC grace seconds: 864000

Compaction min/max thresholds: 4/32

Read repair chance: 1.0

Replicate on write: true

Bloom Filter FP chance: default

Built indexes: []

Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy

You may also use hive to view the databases created in cassandra, in an sql-like manner.

* Start Hive

$ bin/dse hive

hive> show databases;

OK

default

shopping_cart_db

When the entire database is imported as above, separate java classes will be created for each of the tables.

$ bin/dse sqoop import-all-tables -m 1 --connect jdbc:mysql://127.0.0.1:3306/shopping_cart_db --username root --password root --cassandra-thrift-host localhost --cassandra-create-schema --direct

12/06/15 15:42:11 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.

12/06/15 15:42:11 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

12/06/15 15:42:11 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:42:11 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `Category` AS t LIMIT 1

12/06/15 15:42:11 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Category.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:42:13 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Category.jar

12/06/15 15:42:13 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:42:13 INFO mapreduce.ImportJobBase: Beginning import of Category

12/06/15 15:42:14 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

12/06/15 15:42:15 INFO mapred.JobClient: Running job: job_201206151241_0007

12/06/15 15:42:16 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:42:25 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:42:25 INFO mapred.JobClient: Job complete: job_201206151241_0007

12/06/15 15:42:25 INFO mapred.JobClient: Counters: 18

12/06/15 15:42:25 INFO mapred.JobClient: Job Counters

12/06/15 15:42:25 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=6480

12/06/15 15:42:25 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:42:25 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:42:25 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:42:25 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:42:25 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:42:25 INFO mapred.JobClient: Bytes Written=2848

12/06/15 15:42:25 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:42:25 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21419

12/06/15 15:42:25 INFO mapred.JobClient: CFS_BYTES_WRITTEN=2848

12/06/15 15:42:25 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:42:25 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:42:25 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:42:25 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:42:25 INFO mapred.JobClient: Map input records=1

12/06/15 15:42:25 INFO mapred.JobClient: Physical memory (bytes) snapshot=119435264

12/06/15 15:42:25 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:42:25 INFO mapred.JobClient: CPU time spent (ms)=630

12/06/15 15:42:25 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:42:25 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2085318656

12/06/15 15:42:25 INFO mapred.JobClient: Map output records=36

12/06/15 15:42:25 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:42:25 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 11.4492 seconds (0 bytes/sec)

12/06/15 15:42:25 INFO mapreduce.ImportJobBase: Retrieved 36 records.

12/06/15 15:42:25 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:42:25 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `Customer` AS t LIMIT 1

12/06/15 15:42:25 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Customer.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:42:25 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Customer.jar

12/06/15 15:42:26 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:42:26 INFO mapreduce.ImportJobBase: Beginning import of Customer

12/06/15 15:42:26 INFO mapred.JobClient: Running job: job_201206151241_0008

12/06/15 15:42:27 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:42:35 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:42:35 INFO mapred.JobClient: Job complete: job_201206151241_0008

12/06/15 15:42:35 INFO mapred.JobClient: Counters: 17

12/06/15 15:42:35 INFO mapred.JobClient: Job Counters

12/06/15 15:42:35 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=6009

12/06/15 15:42:35 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:42:35 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:42:35 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:42:35 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:42:35 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:42:35 INFO mapred.JobClient: Bytes Written=0

12/06/15 15:42:35 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:42:35 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21489

12/06/15 15:42:35 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:42:35 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:42:35 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:42:35 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:42:35 INFO mapred.JobClient: Map input records=1

12/06/15 15:42:35 INFO mapred.JobClient: Physical memory (bytes) snapshot=164855808

12/06/15 15:42:35 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:42:35 INFO mapred.JobClient: CPU time spent (ms)=510

12/06/15 15:42:35 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:42:35 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2082869248

12/06/15 15:42:35 INFO mapred.JobClient: Map output records=0

12/06/15 15:42:35 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:42:35 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 9.3143 seconds (0 bytes/sec)

12/06/15 15:42:35 INFO mapreduce.ImportJobBase: Retrieved 0 records.

12/06/15 15:42:35 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:42:35 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `OrderEntry` AS t LIMIT 1

12/06/15 15:42:35 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/OrderEntry.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:42:35 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/OrderEntry.jar

12/06/15 15:42:36 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:42:36 INFO mapreduce.ImportJobBase: Beginning import of OrderEntry

12/06/15 15:42:36 INFO mapred.JobClient: Running job: job_201206151241_0009

12/06/15 15:42:37 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:42:45 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:42:45 INFO mapred.JobClient: Job complete: job_201206151241_0009

12/06/15 15:42:45 INFO mapred.JobClient: Counters: 17

12/06/15 15:42:45 INFO mapred.JobClient: Job Counters

12/06/15 15:42:45 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=6381

12/06/15 15:42:45 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:42:45 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:42:45 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:42:45 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:42:45 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:42:45 INFO mapred.JobClient: Bytes Written=0

12/06/15 15:42:45 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:42:45 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21569

12/06/15 15:42:45 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:42:45 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:42:45 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:42:45 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:42:45 INFO mapred.JobClient: Map input records=1

12/06/15 15:42:45 INFO mapred.JobClient: Physical memory (bytes) snapshot=137252864

12/06/15 15:42:45 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:42:45 INFO mapred.JobClient: CPU time spent (ms)=520

12/06/15 15:42:45 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:42:45 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2014703616

12/06/15 15:42:45 INFO mapred.JobClient: Map output records=0

12/06/15 15:42:45 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:42:45 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 9.2859 seconds (0 bytes/sec)

12/06/15 15:42:45 INFO mapreduce.ImportJobBase: Retrieved 0 records.

12/06/15 15:42:45 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:42:45 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `OrderItem` AS t LIMIT 1

12/06/15 15:42:45 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/OrderItem.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:42:45 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/OrderItem.jar

12/06/15 15:42:46 WARN manager.CatalogQueryManager: The table OrderItem contains a multi-column primary key. Sqoop will default to the column orderNumber only for this job.

12/06/15 15:42:46 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:42:46 INFO mapreduce.ImportJobBase: Beginning import of OrderItem

12/06/15 15:42:46 INFO mapred.JobClient: Running job: job_201206151241_0010

12/06/15 15:42:47 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:42:55 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:42:55 INFO mapred.JobClient: Job complete: job_201206151241_0010

12/06/15 15:42:55 INFO mapred.JobClient: Counters: 17

12/06/15 15:42:55 INFO mapred.JobClient: Job Counters

12/06/15 15:42:55 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=5949

12/06/15 15:42:55 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:42:55 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:42:55 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:42:55 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:42:55 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:42:55 INFO mapred.JobClient: Bytes Written=0

12/06/15 15:42:55 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:42:55 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21524

12/06/15 15:42:55 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:42:55 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:42:55 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:42:55 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:42:55 INFO mapred.JobClient: Map input records=1

12/06/15 15:42:55 INFO mapred.JobClient: Physical memory (bytes) snapshot=116674560

12/06/15 15:42:55 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:42:55 INFO mapred.JobClient: CPU time spent (ms)=590

12/06/15 15:42:55 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:42:55 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2014703616

12/06/15 15:42:55 INFO mapred.JobClient: Map output records=0

12/06/15 15:42:55 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:42:55 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 9.2539 seconds (0 bytes/sec)

12/06/15 15:42:55 INFO mapreduce.ImportJobBase: Retrieved 0 records.

12/06/15 15:42:55 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:42:55 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `Payment` AS t LIMIT 1

12/06/15 15:42:55 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Payment.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:42:55 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Payment.jar

12/06/15 15:42:56 WARN manager.CatalogQueryManager: The table Payment contains a multi-column primary key. Sqoop will default to the column orderNumber only for this job.

12/06/15 15:42:56 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:42:56 INFO mapreduce.ImportJobBase: Beginning import of Payment

12/06/15 15:42:56 INFO mapred.JobClient: Running job: job_201206151241_0011

12/06/15 15:42:57 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:43:05 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:43:05 INFO mapred.JobClient: Job complete: job_201206151241_0011

12/06/15 15:43:05 INFO mapred.JobClient: Counters: 17

12/06/15 15:43:05 INFO mapred.JobClient: Job Counters

12/06/15 15:43:05 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=5914

12/06/15 15:43:05 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:43:05 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:43:05 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:43:05 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:43:05 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:43:05 INFO mapred.JobClient: Bytes Written=0

12/06/15 15:43:05 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:43:05 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21518

12/06/15 15:43:05 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:43:05 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:43:05 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:43:05 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:43:05 INFO mapred.JobClient: Map input records=1

12/06/15 15:43:05 INFO mapred.JobClient: Physical memory (bytes) snapshot=137998336

12/06/15 15:43:05 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:43:05 INFO mapred.JobClient: CPU time spent (ms)=520

12/06/15 15:43:05 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:43:05 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2082865152

12/06/15 15:43:05 INFO mapred.JobClient: Map output records=0

12/06/15 15:43:05 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:43:05 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 9.2642 seconds (0 bytes/sec)

12/06/15 15:43:05 INFO mapreduce.ImportJobBase: Retrieved 0 records.

12/06/15 15:43:05 INFO tool.CodeGenTool: Beginning code generation

12/06/15 15:43:05 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `Product` AS t LIMIT 1

12/06/15 15:43:06 INFO orm.CompilationManager: HADOOP_HOME is /home/pradeeban/programs/dse-2.1/resources/hadoop/bin/..

Note: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/Product.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

12/06/15 15:43:06 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-pradeeban/compile/926ddf787c73be06c4e2ad1f8fc522f1/ Product.jar

12/06/15 15:43:06 INFO manager.DirectMySQLManager: Beginning mysqldump fast path import

12/06/15 15:43:06 INFO mapreduce.ImportJobBase: Beginning import of Product

12/06/15 15:43:07 INFO mapred.JobClient: Running job: job_201206151241_0012

12/06/15 15:43:08 INFO mapred.JobClient: map 0% reduce 0%

12/06/15 15:43:16 INFO mapred.JobClient: map 100% reduce 0%

12/06/15 15:43:16 INFO mapred.JobClient: Job complete: job_201206151241_0012

12/06/15 15:43:16 INFO mapred.JobClient: Counters: 18

12/06/15 15:43:16 INFO mapred.JobClient: Job Counters

12/06/15 15:43:16 INFO mapred.JobClient: SLOTS_MILLIS_MAPS=5961

12/06/15 15:43:16 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0

12/06/15 15:43:16 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0

12/06/15 15:43:16 INFO mapred.JobClient: Launched map tasks=1

12/06/15 15:43:16 INFO mapred.JobClient: SLOTS_MILLIS_REDUCES=0

12/06/15 15:43:16 INFO mapred.JobClient: File Output Format Counters

12/06/15 15:43:16 INFO mapred.JobClient: Bytes Written=248262

12/06/15 15:43:16 INFO mapred.JobClient: FileSystemCounters

12/06/15 15:43:16 INFO mapred.JobClient: FILE_BYTES_WRITTEN=21527

12/06/15 15:43:16 INFO mapred.JobClient: CFS_BYTES_WRITTEN=248262

12/06/15 15:43:16 INFO mapred.JobClient: CFS_BYTES_READ=87

12/06/15 15:43:16 INFO mapred.JobClient: File Input Format Counters

12/06/15 15:43:16 INFO mapred.JobClient: Bytes Read=0

12/06/15 15:43:16 INFO mapred.JobClient: Map-Reduce Framework

12/06/15 15:43:16 INFO mapred.JobClient: Map input records=1

12/06/15 15:43:16 INFO mapred.JobClient: Physical memory (bytes) snapshot=144871424

12/06/15 15:43:16 INFO mapred.JobClient: Spilled Records=0

12/06/15 15:43:16 INFO mapred.JobClient: CPU time spent (ms)=1030

12/06/15 15:43:16 INFO mapred.JobClient: Total committed heap usage (bytes)=121241600

12/06/15 15:43:16 INFO mapred.JobClient: Virtual memory (bytes) snapshot=2085318656

12/06/15 15:43:16 INFO mapred.JobClient: Map output records=300

12/06/15 15:43:16 INFO mapred.JobClient: SPLIT_RAW_BYTES=87

12/06/15 15:43:16 INFO mapreduce.ImportJobBase: Transferred 0 bytes in 9.2613 seconds (0 bytes/sec)

12/06/15 15:43:16 INFO mapreduce.ImportJobBase: Retrieved 300 records.

I found DataStax an interesting project to explore more. I have blogged on the issues that I faced on this as a learner, and how easily can they be fixed - Issues that you may encounter during the migration to Cassandra using DataStax/Sqoop and the fixes

.

推荐阅读
  • 一、Hadoop来历Hadoop的思想来源于Google在做搜索引擎的时候出现一个很大的问题就是这么多网页我如何才能以最快的速度来搜索到,由于这个问题Google发明 ... [详细]
  • 大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记
    本文介绍了大数据Hadoop生态(20)MapReduce框架原理OutputFormat的开发笔记,包括outputFormat接口实现类、自定义outputFormat步骤和案例。案例中将包含nty的日志输出到nty.log文件,其他日志输出到other.log文件。同时提供了一些相关网址供参考。 ... [详细]
  • 我们在之前的文章中已经初步介绍了Cloudera。hadoop基础----hadoop实战(零)-----hadoop的平台版本选择从版本选择这篇文章中我们了解到除了hadoop官方版本外很多 ... [详细]
  • 前言本文隶属于专栏《1000个问题搞定大数据技术体系》,该专栏为笔者原创,引用请注明来源,不足和错误之处请在评论区帮忙指出, ... [详细]
  • 大数据开发笔记(一):HDFS介绍
    ✨大数据开发笔记推荐:大数据开发面试知识点总结_GoAI的博客-CSDN博客_大数据开发面试​本文详细介绍大数据hadoop生态圈各部分知识,包括不限 ... [详细]
  • 阅读目录一、Hadoop简介二、Hadoop的特性三、hadoop组成与体系结构四、Hadoop安装方式五、Hadoop集群中的节点类型一、Hadoop简介Hadoop是Apac ... [详细]
  • 本文目录一览:1、大数据培训课程大纲要学什么课程? ... [详细]
  • 本文介绍了在sqoop1.4.*版本中,如何实现自定义分隔符的方法及步骤。通过修改sqoop生成的java文件,并重新编译,可以满足实际开发中对分隔符的需求。具体步骤包括修改java文件中的一行代码,重新编译所需的hadoop包等。详细步骤和编译方法在本文中都有详细说明。 ... [详细]
  • Maven构建Hadoop,
    Maven构建Hadoop工程阅读目录序Maven安装构建示例下载系列索引 序  上一篇,我们编写了第一个MapReduce,并且成功的运行了Job,Hadoop1.x是通过ant ... [详细]
  • Hadoop源码解析1Hadoop工程包架构解析
    1 Hadoop中各工程包依赖简述   Google的核心竞争技术是它的计算平台。Google的大牛们用了下面5篇文章,介绍了它们的计算设施。   GoogleCluster:ht ... [详细]
  • 开发笔记:Hadoop Mapreduce
    代码如下: ... [详细]
  • Hadoop——Hive简介和环境配置
    一、Hive的简介和配置1.简介Hive是构建在Hadoop之上的数据操作平台lHive是一个SQL解析引擎,它将SQL转译成MapReduce作业,并 ... [详细]
  • 【数据结构与算法】——快速排序
    Sqoop是一款开源的工具,主要用于在Hadoop(Hive)与传统的数据库(mysql、postgresql)间进行数据的传递,可以将一个关系型数据库(例如:MySQL,O ... [详细]
  • hadoop常用操作命令https:www.cnblogs.comcerofangp10460494.htmlday3_day6https:www.cnblogs.comcerof ... [详细]
  • 从接触DataX起就有一个疑问,它和Sqoop到底有什么区别,昨天部署好了DataX和Sqoop,就可以对两者进行更深入的了解了。两者从原理上看有点相似,都是解决异构环境的数据交换 ... [详细]
author-avatar
qm38dal
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有