1、lzo文件解压办法
介绍:lzo为hadoop文件格式,csv的压缩比约为30%
linux环境解压方法:
lzop -d xxx.lzo
2、Linux服务器分区设置
[root@host-47-49-36-42 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 253:0 0 500G 0 disk
├─vda1 253:1 0 1G 0 part /boot
├─vda2 253:2 0 100G 0 part /
└─vda3 253:3 0 32G 0 part [SWAP]
[root@host-47-49-36-42 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda2 100G 2.0G 98G 2% /
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 32G 8.7M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/vda1 1014M 162M 853M 16% /boot
tmpfs 6.3G 0 6.3G 0% /run/user/0
[root@host-47-49-36-42 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 1024M 0 rom
vda 253:0 0 500G 0 disk
├─vda1 253:1 0 1G 0 part /boot
├─vda2 253:2 0 100G 0 part /
└─vda3 253:3 0 32G 0 part [SWAP]
[root@host-47-49-36-42 ~]# parted /dev/vda
GNU Parted 3.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 537GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1075MB 1074MB primary xfs boot
2 1075MB 108GB 107GB primary xfs
3 108GB 143GB 34.4GB primary linux-swap(v1)
(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? xfs
Start? 144G
End? 537G
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 537GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1075MB 1074MB primary xfs boot
2 1075MB 108GB 107GB primary xfs
3 108GB 143GB 34.4GB primary linux-swap(v1)
4 144GB 537GB 393GB primary
(parted) q
Information: You may need to update /etc/fstab.
[root@host-47-49-36-42 ~]# mkdir /APP
[root@host-47-49-36-42 ~]# mkfs.xfs -f /dev/vda4
meta-data=/dev/vda4 isize=512 agcount=4, agsize=23978944 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=95915776, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=46833, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@host-47-49-36-42 ~]# mount /dev/vda4 /APP
[root@host-47-49-36-42 ~]# vi /etc/fstab
[root@host-47-49-36-42 ~]# blkid
/dev/vda2: UUID="51e5b936-d1c7-4b72-a60a-726d9a136c0e" TYPE="xfs"
/dev/vda1: UUID="799f8e3e-1f16-4f64-8556-bdebe22eae81" TYPE="xfs"
/dev/vda3: UUID="4dfa261e-9aed-4d79-ac26-766138fc3f15" TYPE="swap"
/dev/vda4: UUID="c28b7d8d-9eba-4616-af9d-561f826563e6" TYPE="xfs"
[root@host-47-49-36-42 ~]# vi /etc/fstab