您好,登錄后才能下訂單哦!
[DISK]/hadoop/hdfs/data,[SSD]/hadoop/hdfs/ssd
在所有的數據節點上掛載ssd盤到路徑/hadoop/hdfs/ssd下
并保證/hadoop/hdfs/ssd路徑的owner為hdfs:hadoop
drwxr-x--- 3 hdfs hadoop 4096 Oct 17 19:10 /hadoop/hdfs/ssd
重啟數據節點
hdfs dfs -mkdir /ssd
hdfs storagepolicies -setStoragePolicy -path /ssd-policy ALL_SSD
$hawq filespace -o tpc_h_config
filespace:fs_tpc_h
fsreplica:3
dfs_url::mycluster/ssd/fs_tpc_h
$hdfs dfs -mkdir /ssd
$hdfs dfs -chown gpadmin:gpadmin /ssd
$hdfs dfs -ls /
$hawq filespace -c tpc_h_config
psql
create tablespace ts_tpc_h filespace fs_tpc_h;
SELECT spcname AS tblspc, fsname AS filespc,
fsedbid AS seg_dbid, fselocation AS datadir
FROM pg_tablespace pgts, pg_filespace pgfs,
pg_filespace_entry pgfse
WHERE pgts.spcfsoid=pgfse.fsefsoid
AND pgfse.fsefsoid=pgfs.oid
ORDER BY tblspc, seg_dbid;
create table region(
r_regionkey integer,
r_name char(25),
r_comment varchar(152),
r_extra char(1)
)with(appendonly=true,orientation=parquet,compresstype=snappy)
tablespace ts_tpc_h
distributed by(r_regionkey) ;
select c.relname, d.dat2tablespace tablespace_id, d.oid database_id, c.relfilenode table_id
from pg_database d, pg_class c, pg_namespace n
where c.relnamespace = n.oid
and d.datname = current_database()
and n.nspname = 'qbyps'
and c.relname = 'p';
SELECT pgfs.oid fs_id,pgts.oid ts_id, spcname AS tblspc, fsname AS filespc,
fsedbid AS seg_dbid, fselocation AS datadir
FROM pg_tablespace pgts, pg_filespace pgfs,
pg_filespace_entry pgfse
WHERE pgts.spcfsoid=pgfse.fsefsoid
AND pgfse.fsefsoid=pgfs.oid
ORDER BY tblspc, seg_dbid;
HAWQ使用libhdfs3.so的API訪問HDFS,目前不支持存儲策略。因此,需要對寫入后的數據進行維護。
hdfs mover -p /ssd/fs_tpc_h
存儲策略命令
列出所有存儲策略
hdfs storagepolicies -listPolicies
設置存儲策略
hdfs storagepolicies -setStoragePolicy -path <path> -policy <policy>
例如
hdfs storagepolicies -setStoragePolicy -path /tmp -policy ALL_SSD
取消存儲策略
hdfs storagepolicies -unsetStoragePolicy -path <path>
之后該目錄或者文件,以其上級的目錄為準,如果是根目錄,那么就是HOT
獲取存取策略
hdfs storagepolicies -getStoragePolicy -path <path>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。