hadoop數(shù)據(jù)怎么遷移

本篇內(nèi)容主要講解“hadoop數(shù)據(jù)怎么遷移”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“hadoop數(shù)據(jù)怎么遷移”吧!

成都創(chuàng)新互聯(lián)擁有十余年成都網(wǎng)站建設(shè)工作經(jīng)驗(yàn),為各大企業(yè)提供成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)服務(wù),對于網(wǎng)頁設(shè)計(jì)、PC網(wǎng)站建設(shè)(電腦版網(wǎng)站建設(shè))、成都App定制開發(fā)、wap網(wǎng)站建設(shè)(手機(jī)版網(wǎng)站建設(shè))、程序開發(fā)、網(wǎng)站優(yōu)化(SEO優(yōu)化)、微網(wǎng)站、申請域名等,憑借多年來在互聯(lián)網(wǎng)的打拼,我們在互聯(lián)網(wǎng)網(wǎng)站建設(shè)行業(yè)積累了很多網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、網(wǎng)絡(luò)營銷經(jīng)驗(yàn),集策劃、開發(fā)、設(shè)計(jì)、營銷、管理等網(wǎng)站化運(yùn)作于一體,具備承接各種規(guī)模類型的網(wǎng)站建設(shè)項(xiàng)目的能力。

tcp工具使用說明:

在表結(jié)構(gòu)/分區(qū)創(chuàng)建好的情況下,在hadoop2.0集群的任意一個(gè)節(jié)點(diǎn)上執(zhí)行:

hadoop distcp -Dmapreduce.job.queue.name=queue_name  -update -skipcrccheck [source_path...] <target_path>

1、    source_path參數(shù)為hadoop1.0上需要拷貝的表/分區(qū)數(shù)據(jù)目錄全路徑,必須采用hftp協(xié)議訪問,如test庫下的test表路徑為hftp://hadoop1:50070/user/hive/warehouse/test.db/test

2、    target_path參數(shù)為hadoop2.0上對應(yīng)表/分區(qū)數(shù)據(jù)目錄路徑,如/user/hive/warehouse/test.db/test

3、    跨版本集群拷貝時(shí)-update -skipcrccheck參數(shù)必須帶上。

4、    -Dmapreduce.job.queue.name參數(shù)用于指定任務(wù)在哪個(gè)資源池中運(yùn)行,如:-Dmapreduce.job.queue.name=queue_0401_01。

5、Distcp任務(wù)執(zhí)行時(shí)以MR任務(wù)運(yùn)行,會(huì)占用指定資源池中資源。

表數(shù)據(jù)拷貝示例:

hadoop distcp -Dmapreduce.job.queue.name=queue_0401_01 -update -skipcrccheck hftp://hadoop1:50070/user/hive/warehouse/social.db/sina_wb_timelines  /user/hive/warehouse/social.db/sina_wb_timelines

分區(qū)數(shù)據(jù)拷貝示例:

hadoop distcp -Dmapreduce.job.queue.name=queue_0401_01 -update -skipcrccheck hftp://hadoop1:50070/user/hive/warehouse/social.db/sina_wb_timelines/d=21  /user/hive/warehouse/social.db/sina_wb_timelines/d=21

1、建立表結(jié)構(gòu):

CREATE  TABLE `fin_fa_wide_asset`(

  `period_name` string,

  `set_of_books_id` string,

  `book_type_code` string,

  `segment1` string,

  `segment2` string,

  `segment3` string,

  `asset_id` string,

  `description` string,

  `asset_category_id` string,

  `asset_number` string,

  `use_department` string,

  `operating_status` string,

  `use_status` string,

  `use_people` string,

  `city` string,

  `location` string,

  `units_assigned` double,

  `date_placed_in_service` string,

  `deprn_run_date` string,

  `cost` double,

  `original_cost` double,

  `salvage_value` double,

  `recoverable_cost` double,

  `current_net_value` double,

  `ytd_deprn` double,

  `deprn_reserve` double,

  `salvage_cost_rate` double,

  `deprn_method_code` string,

  `deprn_in_months` double,

  `life_in_months` double,

  `deprn_amount` double,

  `deprn_adjustment_acct` string,

  `po_number` string,

  `asset_invoice_id` string,

  `invoice_number` string)

PARTITIONED BY (

  `y` string,

  `m` string)row format delimited fields terminated by '\001' stored as rcfile;

2、導(dǎo)數(shù):

hadoop distcp -Dmapreduce.job.queue.name=queue_0009_01 -update -skipcrccheck hftp://hadoop1:50070/user/hive/warehouse/jt_mas_safe.db/fin_fa_wide_asset  /user/hive/warehouse/jt_mas_safe.db/fin_fa_wide_asset

3、加載數(shù)據(jù)腳本,視不同表分區(qū)而定:

alter table jt_mas_safe.fin_fa_wide_asset add partition(y='2015',m='08');

load data inpath '/user/hive/warehouse/jt_mas_safe.db/fin_fa_wide_asset/y=2015/m=08' into table jt_mas_safe.fin_fa_wide_asset partition(y='2015',m='08’);

到此,相信大家對“hadoop數(shù)據(jù)怎么遷移”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

當(dāng)前名稱:hadoop數(shù)據(jù)怎么遷移
本文路徑:http://muchs.cn/article8/piedip.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營銷型網(wǎng)站建設(shè)微信公眾號、定制網(wǎng)站、建站公司、品牌網(wǎng)站設(shè)計(jì)、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)