首页
关于
壁纸
直播
留言
友链
统计
Search
1
《三国志英杰传》攻略
6,034 阅读
2
白嫖Emby
5,771 阅读
3
Emby客户端IOS破解
5,769 阅读
4
《吞食天地1》金手指代码
4,696 阅读
5
破解emby-server
4,040 阅读
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
登录
Search
标签搜索
ubuntu
mysql
openwrt
zerotier
springboot
centos
openvpn
jdk
吞食天地2
synology
spring
idea
windows11
吞食天地1
transmission
google-play
Japanese
xcode
群晖
kiftd
MoonjerX
累计撰写
370
篇文章
累计收到
459
条评论
首页
栏目
moonjerx
game
age-of-empires
zx3
san-guo-zhi
尼尔:机械纪元
net
emby
learn-video
docker
torrent
photoshop
route
minio
git
ffmpeg
im
vue
gitlab
typecho
svn
alipay
nasm
srs
mail-server
tailscale
kkfileview
aria2
webdav
synology
redis
oray
chemical
mxsite
math
π
x-ui
digital-currency
server
nginx
baota
k8s
http
cloud
linux
shell
database
vpn
esxi
rancher
domain
k3s
ewomail
os
android
windows
ios
app-store
macos
develop
java
javascript
uniapp
nodejs
hbuildx
maven
android-studio
jetbrain
jenkins
css
mybatis
php
python
hardware
hard-disk
pc
RAM
software
pt
calibre
notion
office
language
literature
philosophy
travel
页面
关于
壁纸
直播
留言
友链
统计
搜索到
54
篇与
linux
的结果
2021-10-28
CentOS单网卡配置多个IP地址
原配置新增配置TYPE=EthernetTYPE=EthernetBOOTPROTO=dhcpBOOTPROTO=dhcpDEFROUTE=yesDEFROUTE=yesPEERDNS=yesPEERDNS=yesPEERROUTES=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33NAME=ens33:0 UUID=dd626172-0f19-400a-a6e7-4a99d70fdae2DEVICE=ens33:0ONBOOT=yesONBOOT=yes IPADDR=192.168.186.129 NETMASK=255.255.255.0 GATEWAY=192.168.186.1
2021年10月28日
188 阅读
0 评论
0 点赞
2021-10-28
虚拟机CentOS扩容虚拟磁盘
Last login: Tue Jun 29 22:08:12 2021 from 192.168.3.47 [root@localhost ~]# fdisk /dev/sda Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): ^C [root@localhost ~]#[root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/cl-root 17G 17G 3.3M 100% / devtmpfs 901M 0 901M 0% /dev tmpfs 912M 0 912M 0% /dev/shm tmpfs 912M 8.7M 904M 1% /run tmpfs 912M 0 912M 0% /sys/fs/cgroup /dev/sda1 1014M 185M 830M 19% /boot tmpfs 183M 0 183M 0% /run/user/1001 tmpfs 183M 0 183M 0% /run/user/0 [root@localhost ~]# ls /dev agpgart dm-1 loop-control pts tty tty21 tty35 tty49 tty62 vcs vga_arbiter autofs dmmidi mapper random tty0 tty22 tty36 tty5 tty63 vcs1 vhci block dri mcelog raw tty1 tty23 tty37 tty50 tty7 vcs2 vhost-net bsg fb0 mem rtc tty10 tty24 tty38 tty51 tty8 vcs3 vmci btrfs-control fd midi rtc0 tty11 tty25 tty39 tty52 tty9 vcs4 zero bus full mqueue sda tty12 tty26 tty4 tty53 ttyS0 vcs5 char fuse net sda1 tty13 tty27 tty40 tty54 ttyS1 vcs6 cl hidraw0 network_latency sda2 tty14 tty28 tty41 tty55 ttyS2 vcsa console hpet network_throughput sg0 tty15 tty29 tty42 tty56 ttyS3 vcsa1 core hugepages null shm tty16 tty3 tty43 tty57 uhid vcsa2 cpu hwrng nvram snapshot tty17 tty30 tty44 tty58 uinput vcsa3 cpu_dma_latency initctl oldmem snd tty18 tty31 tty45 tty59 urandom vcsa4 crash input port stderr tty19 tty32 tty46 tty6 usbmon0 vcsa5 disk kmsg ppp stdin tty2 tty33 tty47 tty60 usbmon1 vcsa6 dm-0 log ptmx stdout tty20 tty34 tty48 tty61 usbmon2 vfio [root@localhost ~]# [root@localhost ~]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0009dedb Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM Disk /dev/mapper/cl-root: 18.2 GB, 18249416704 bytes, 35643392 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2147 MB, 2147483648 bytes, 4194304 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes[root@localhost dev]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0009dedb Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM Disk /dev/mapper/cl-root: 18.2 GB, 18249416704 bytes, 35643392 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2147 MB, 2147483648 bytes, 4194304 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@localhost dev]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/cl-root 17G 17G 3.2M 100% / devtmpfs 901M 0 901M 0% /dev tmpfs 912M 0 912M 0% /dev/shm tmpfs 912M 8.7M 904M 1% /run tmpfs 912M 0 912M 0% /sys/fs/cgroup /dev/sda1 1014M 185M 830M 19% /boot tmpfs 183M 0 183M 0% /run/user/1001 tmpfs 183M 0 183M 0% /run/user/0 [root@localhost dev]# fdisk /dev/sda Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0009dedb Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM Command (m for help): n Partition type: p primary (2 primary, 0 extended, 2 free) e extended Select (default p): p Partition number (3,4, default 3): 3 First sector (41943040-83886079, default 41943040): Using default value 41943040 Last sector, +sectors or +size{K,M,G} (41943040-83886079, default 83886079): Using default value 83886079 Partition 3 of type Linux and of size 20 GiB is set Command (m for help): t Partition number (1-3, default 3): 3 Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM' Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@localhost dev]# partprobe [root@localhost dev]# ls agpgart dmmidi mcelog rtc tty10 tty25 tty4 tty54 ttyS2 vcsa1 autofs dri mem rtc0 tty11 tty26 tty40 tty55 ttyS3 vcsa2 block fb0 midi sda tty12 tty27 tty41 tty56 uhid vcsa3 bsg fd mqueue sda1 tty13 tty28 tty42 tty57 uinput vcsa4 btrfs-control full net sda2 tty14 tty29 tty43 tty58 urandom vcsa5 bus fuse network_latency sda3 tty15 tty3 tty44 tty59 usbmon0 vcsa6 char hidraw0 network_throughput sg0 tty16 tty30 tty45 tty6 usbmon1 vfio cl hpet null shm tty17 tty31 tty46 tty60 usbmon2 vga_arbiter console hugepages nvram snapshot tty18 tty32 tty47 tty61 vcs vhci core hwrng oldmem snd tty19 tty33 tty48 tty62 vcs1 vhost-net cpu initctl port stderr tty2 tty34 tty49 tty63 vcs2 vmci cpu_dma_latency input ppp stdin tty20 tty35 tty5 tty7 vcs3 zero crash kmsg ptmx stdout tty21 tty36 tty50 tty8 vcs4 disk log pts tty tty22 tty37 tty51 tty9 vcs5 dm-0 loop-control random tty0 tty23 tty38 tty52 ttyS0 vcs6 dm-1 mapper raw tty1 tty24 tty39 tty53 ttyS1 vcsa [root@localhost dev]# mkfs.ext3 /dev/sda3 mke2fs 1.42.9 (28-Dec-2013) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 1310720 inodes, 5242880 blocks 262144 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 160 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done [root@localhost dev]# lvm lvm> pvcreate /dev/sda3 WARNING: ext3 signature detected on /dev/sda3 at offset 1080. Wipe it? [y/n]: y Wiping ext3 signature on /dev/sda3. Physical volume "/dev/sda3" successfully created. lvm> vgextend centos /dev/sda3 Volume group "centos" not found Cannot process volume group centos lvm> vgdisplay --- Volume group --- VG Name cl System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size <19.00 GiB PE Size 4.00 MiB Total PE 4863 Alloc PE / Size 4863 / <19.00 GiB Free PE / Size 0 / 0 VG UUID T7a0MM-htee-aJAT-PcIi-VnAL-RGe7-V2ofrS lvm> ^C [root@localhost dev]# reboot Connection closed by foreign host. Disconnected from remote host(MXVPN) at 23:55:53. Type `help' to learn how to use Xshell prompt. [e:\~]$ Connecting to xxx.xxx.xxx.xxx:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. Last login: Tue Jun 29 23:13:50 2021 from 192.168.3.47 [root@localhost ~]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0009dedb Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM /dev/sda3 41943040 83886079 20971520 8e Linux LVM Disk /dev/mapper/cl-root: 18.2 GB, 18249416704 bytes, 35643392 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2147 MB, 2147483648 bytes, 4194304 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@localhost ~]# df -T /dev/sda1 Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sda1 xfs 1038336 189384 848952 19% /boot [root@localhost ~]# pvcreate /dev/sda3 Physical volume "/dev/sda3" successfully created. [root@localhost ~]# pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name cl PV Size <19.00 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 4863 Free PE 0 Allocated PE 4863 PV UUID 83M3hh-NBTu-dAUM-ohQ0-TPun-i8dK-np2pW5 "/dev/sda3" is a new physical volume of "20.00 GiB" --- NEW Physical volume --- PV Name /dev/sda3 VG Name PV Size 20.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID tNf51N-JJDs-sFQm-3PYT-sn62-8FMg-DosHQ3 [root@localhost ~]# vgdisplay --- Volume group --- VG Name cl System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size <19.00 GiB PE Size 4.00 MiB Total PE 4863 Alloc PE / Size 4863 / <19.00 GiB Free PE / Size 0 / 0 VG UUID T7a0MM-htee-aJAT-PcIi-VnAL-RGe7-V2ofrS [root@localhost ~]# vgextend cl /dev/sda3 Volume group "cl" successfully extended [root@localhost ~]# lvextend -l +2559 /dev/cl/root Size of logical volume cl/root changed from <17.00 GiB (4351 extents) to 26.99 GiB (6910 extents). Logical volume cl/root successfully resized. [root@localhost ~]# vgdisplay --- Volume group --- VG Name cl System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 38.99 GiB PE Size 4.00 MiB Total PE 9982 Alloc PE / Size 7422 / 28.99 GiB Free PE / Size 2560 / 10.00 GiB VG UUID T7a0MM-htee-aJAT-PcIi-VnAL-RGe7-V2ofrS [root@localhost ~]# lvdisplay --- Logical volume --- LV Path /dev/cl/swap LV Name swap VG Name cl LV UUID BxFDIE-Fqba-OdhL-63kB-RPLX-BBo2-wl6E87 LV Write Access read/write LV Creation host, time localhost.localdomain, 2017-10-17 22:17:07 +0800 LV Status available # open 2 LV Size 2.00 GiB Current LE 512 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:1 --- Logical volume --- LV Path /dev/cl/root LV Name root VG Name cl LV UUID PylgYk-IZQG-tf3R-DYzF-R71V-MCBf-7ct6oe LV Write Access read/write LV Creation host, time localhost.localdomain, 2017-10-17 22:17:07 +0800 LV Status available # open 1 LV Size 26.99 GiB Current LE 6910 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0 [root@localhost ~]# xfs_growfs /dev/cl/root meta-data=/dev/mapper/cl-root isize=512 agcount=4, agsize=1113856 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=4455424, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 4455424 to 7075840 [root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/cl-root 27G 17G 10G 63% / devtmpfs 901M 0 901M 0% /dev tmpfs 912M 0 912M 0% /dev/shm tmpfs 912M 8.7M 904M 1% /run tmpfs 912M 0 912M 0% /sys/fs/cgroup /dev/sda1 1014M 185M 830M 19% /boot tmpfs 183M 0 183M 0% /run/user/1001 tmpfs 183M 0 183M 0% /run/user/0 [root@localhost ~]# fdisk -l Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x0009dedb Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 41943039 19921920 8e Linux LVM /dev/sda3 41943040 83886079 20971520 8e Linux LVM Disk /dev/mapper/cl-root: 29.0 GB, 28982640640 bytes, 56606720 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/cl-swap: 2147 MB, 2147483648 bytes, 4194304 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes [root@localhost ~]# lvextend -l +2560 /dev/cl/root Size of logical volume cl/root changed from 26.99 GiB (6910 extents) to 36.99 GiB (9470 extents). Logical volume cl/root successfully resized. [root@localhost ~]# lvextend -l +2560 /dev/cl/root Insufficient free space: 2560 extents needed, but only 0 available [root@localhost ~]# xfs_growfs /dev/cl/root meta-data=/dev/mapper/cl-root isize=512 agcount=7, agsize=1113856 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=7075840, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 7075840 to 9697280 [root@localhost ~]#
2021年10月28日
111 阅读
0 评论
0 点赞
2021-09-02
CentOS中离线安装ffmpeg
1.下载安装包 ffmpeg-4.1.tar.xz 2.解压安装包:tar -xvJf ffmpeg-4.1.tar.xz3.编译安装: /programFiles/soft/ffmpeg 为自己指定的安装目录./configure --enable-shared --prefix=/programFiles/soft/ffmpeg提示错误:nasm/yasm not found or too old. Use --disable-x86asm for a crippled build. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem.安装gcc编译器centos 执行yum install gccubuntu 执行apt install gcc安装yasm编译器:centos 执行yum install -y yasmubuntu 执行apt install -y yasm离线安装yasm:{card-describe title="安装步骤"}离线包: yasm-1.3.0.tar.gzwget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gztar zxvf yasm-1.3.0.tar.gzcd yasm-1.3.0./configuremake && make install{/card-describe}4.编译(编译时间比较长)和安装:make && make install5.遇到问题 -bash: make: command not found 的解决办法 一般出现这个提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make、vim等常用命令,直接yum安装下即可。yum -y install gcc automake autoconf libtool make安装g++:yum install gcc gcc-c++6.修改文件/etc/ld.so.confvim /etc/ld.so.confinclude ld.so.conf.d/*.conf将安装目录的lib包路径 /{make install的目录}/ffmpeg/lib 加入最后/programFiles/soft/ffmpeg/lib/使修改生效:ldconfig7.查看版本/programFiles/soft/ffmpeg/bin/ffmpeg -version8.配置环境变量vim /etc/profile在最后PATH添加环境变量( /programFiles/soft/ffmpeg/bin 为安装目录):#set ffmpeg environment PATH=$PATH:/programFiles/soft/ffmpeg/bin export PATH或者这么写:#set ffmpeg env export FFMPEG_HOME=/usr/bin/ffmpeg export PATH=$PATH:${FFMPEG_HOME}/bin使配置生效:source /etc/profile 9.查看环境变量是否配置成功ffmpeg -version参考资料:https://www.cnblogs.com/wpjamer/p/ffmpeg.htmlhttps://www.cnblogs.com/wintercloud/p/11162962.html转码时候遇到问题 Unknown encoder 'libx264'即,缺少libx264解码库,需要安装该库:git clone http://git.videolan.org/git/x264.git && cd x264./configure --enable-static --enable-sharedmake && make installFFMPEG使用NVIDIA的GPU硬件转码(使用N卡加速解码)下载ffmpeg源码sudo apt-get install build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev正常编译配置(防止报错,根据提示加上--disable-x86asm)./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-yasm --enable-libx264 --enable-gpl --enable-pthreads --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib --disable-x86asmN卡加速编译配置./configure --enable-nonfree -–enable-cuda-sdk –enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64编译和安装make && make install同分辨率转码, gpu加速转码,ddr在线模式ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4变分辨率转码:ffmpeg -y -vsync 0 -hwaccel cuvid –resize 1280x720 -c:v h264_cuvid -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4corp转码 (-crop (top)x(bottom)x(left)x(right))ffmpeg -y -vsync 0 -hwaccel cuvid –crop 16x16x32x32 -c:v h264_cuvid -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4scale_cuda filter 转码ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -vf scale_cuda=1280:720 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4scale_npp filter 转码ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -vf scale_npp=1280:720 -c:a copy -c:v h264_nvenc -b:v 5M output.mp41:N 转码ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i input.mp4 -vf scale_npp=1920:1080 -c:a copy -c:v h264_nvenc -b:v 5M output1.mp4 -vf scale_npp=1280:720 -c:a copy -c:v h264_nvenc -b:v 8M output2.mp4yuv编码, 1:N 编码ffmpeg -y -vsync 0 -pix_fmt yuv420p -s 1920x1080 -i input.yuv -filter_complex "[0:v]hwupload_cuda,split=4[o1][o2][o3][o4]" -map "[o1]" -c:v h264_nvenc -b:v 8M output1.mp4 -map "[o2]" -c:v h264_nvenc -b:v 10M output2.mp4 -map "[o3]" -c:v h264_nvenc -b:v 12M output3.mp4 -map "[o4]" -c:v h264_nvenc -b:v 14M output4.mp4转码, 1:N 编码ffmpeg -y -hwaccel cuvid –c:v h264_cuvid -i input1.mp4 -hwaccel cuvid –c:v h264_cuvid -i input2.mp4 -map 0:0 -vf scale_npp=640:480 –c:v h264_nvenc -b:v 1M output11.mp4 -map 0:0 -vf scale_npp=320:240 –c:v h264_nvenc -b:v 500k output12.mp4 -map 1:0 -vf scale_npp=1280:720 –c:v h264_nvenc -b:v 3M output21.mp4 -map 1:0 -vf scale_npp=640:480 –c:v h264_nvenc -b:v 2M output22.mp4软解码,gpu resize,gpu编码ffmpeg -y -init_hw_device cuda=foo:bar -filter_hw_device foo -i input1.mp4 -i input2.mp4 -map 0:0 -vf hwupload,scale_npp=640:480 –c:v h264_nvenc -b:v 1M output11.mp4 -map 0:0 -vf hwupload,scale_npp=320:240 –c:v h264_nvenc -b:v 500k output12.mp4 -map 1:0 -vf hwupload,scale_npp=1280:720 –c:v h264_nvenc -b:v 2M output21.mp4 -map 1:0 -vf hwupload,scale_npp=640:480 –c:v h264_nvenc -b:v 1M output22.mp4更多配置通过ffmpeg查看NVIDIA编码器和解码器属性配置更多参考:https://developer.nvidia.com/ffmpegh264_nvenc 编码器配置参考Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration_v01.4.pdf
2021年09月02日
277 阅读
0 评论
0 点赞
2021-08-26
top命令详解
top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器top参数详解第一行,任务队列信息,同 uptime 命令的执行结果系统时间:07:27:05运行时间:up 1:57 min,当前登录用户: 3 user负载均衡(uptime) load average: 0.00, 0.00, 0.00 average后面的三个数分别是1分钟、5分钟、15分钟的负载情况。 load average数据是每隔5秒钟检查一次活跃的进程数,然后按特定算法计算出的数值。如果这个数除以逻辑CPU的数量,结果高于5的时候就表明系统在超负荷运转了第二行,Tasks — 任务(进程)总进程:150 total, 运行:1 running, 休眠:149 sleeping, 停止: 0 stopped, 僵尸进程: 0 zombie第三行,cpu状态信息0.0%us【user space】— 用户空间占用CPU的百分比。0.3%sy【sysctl】— 内核空间占用CPU的百分比。0.0%ni【】— 改变过优先级的进程占用CPU的百分比99.7%id【idolt】— 空闲CPU百分比0.0%wa【wait】— IO等待占用CPU的百分比0.0%hi【Hardware IRQ】— 硬中断占用CPU的百分比0.0%si【Software Interrupts】— 软中断占用CPU的百分比第四行,内存状态1003020k total, 234464k used, 777824k free, 24084k buffers【缓存的内存量】第五行,swap交换分区信息2031612k total, 536k used, 2031076k free, 505864k cached【缓冲的交换区总量】备注:可用内存=free + buffer + cached对于内存监控,在top里我们要时刻监控第五行swap交换分区的used,如果这个数值在不断的变化,说明内核在不断进行内存和swap的数据交换,这是真正的内存不够用了。第四行中使用中的内存总量(used)指的是现在系统内核控制的内存数,第四行中空闲内存总量(free)是内核还未纳入其管控范围的数量。纳入内核管理的内存不见得都在使用中,还包括过去使用过的现在可以被重复利用的内存,内核并不把这些可被重新使用的内存交还到free中去,因此在linux上free内存会越来越少,但不用为此担心。第六行,空行第七行以下:各进程(任务)的状态监控PID — 进程idUSER — 进程所有者PR — 进程优先级NI — nice值。负值表示高优先级,正值表示低优先级VIRT — 进程使用的虚拟内存总量,单位kb。VIRT=SWAP+RESRES — 进程使用的、未被换出的物理内存大小,单位kb。RES=CODE+DATASHR — 共享内存大小,单位kbS —进程状态。D=不可中断的睡眠状态 R=运行 S=睡眠 T=跟踪/停止 Z=僵尸进程%CPU — 上次更新到现在的CPU时间占用百分比%MEM — 进程使用的物理内存百分比TIME+ — 进程使用的CPU时间总计,单位1/100秒COMMAND — 进程名称(命令名/命令行)详解VIRT:virtual memory usage 虚拟内存1、进程“需要的”虚拟内存大小,包括进程使用的库、代码、数据等2、假如进程申请100m的内存,但实际只使用了10m,那么它会增长100m,而不是实际的使用量RES:resident memory usage 常驻内存1、进程当前使用的内存大小,但不包括swap out2、包含其他进程的共享3、如果申请100m的内存,实际使用10m,它只增长10m,与VIRT相反4、关于库占用内存的情况,它只统计加载的库文件所占内存大小SHR:shared memory 共享内存1、除了自身进程的共享内存,也包括其他进程的共享内存2、虽然进程只使用了几个共享库的函数,但它包含了整个共享库的大小3、计算某个进程所占的物理内存大小公式:RES – SHR4、swap out后,它将会降下来DATA1、数据占用的内存。如果top没有显示,按f键可以显示出来。2、真正的该程序要求的数据空间,是真正在运行中要使用的。top 运行中可以通过 top 的内部命令对进程的显示方式进行控制。内部命令如下:s – 改变画面更新频率l – 关闭或开启第一部分第一行 top 信息的表示t – 关闭或开启第一部分第二行 Tasks 和第三行 Cpus 信息的表示m – 关闭或开启第一部分第四行 Mem 和 第五行 Swap 信息的表示N – 以 PID 的大小的顺序排列表示进程列表P – 以 CPU 占用率大小的顺序排列进程列表M – 以内存占用率大小的顺序排列进程列表h – 显示帮助n – 设置在进程列表所显示进程的数量q – 退出 tops – 改变画面更新周期top使用方法使用格式:top [-] [d] [p] [q] [c] [C] [S] [s] [n]参数说明:d:指定每两次屏幕信息刷新之间的时间间隔。当然用户可以使用s交互命令来改变之。p:通过指定监控进程ID来仅仅监控某个进程的状态。q:该选项将使top没有任何延迟的进行刷新。如果调用程序有超级用户权限,那么top将以尽可能高的优先级运行。S:指定累计模式。s:使top命令在安全模式中运行。这将去除交互命令所带来的潜在危险。i:使top不显示任何闲置或者僵死进程。c:显示整个命令行而不只是显示命令名。常用命令说明Ctrl+L:擦除并且重写屏幕K:终止一个进程。系统将提示用户输入需要终止的进程PID,以及需要发送给该进程什么样的信号。一般的终止进程可以使用15信号;如果不能正常结束那就使用信号9强制结束该进程。默认值是信号15。在安全模式中此命令被屏蔽。i:忽略闲置和僵死进程。这是一个开关式命令。q:退出程序r:重新安排一个进程的优先级别。系统提示用户输入需要改变的进程PID以及需要设置的进程优先级值。输入一个正值将使优先级降低,反之则可以使该进程拥有更高的优先权。默认值是10。S:切换到累计模式。s:改变两次刷新之间的延迟时间。系统将提示用户输入新的时间,单位为s。如果有小数,就换算成m s。输入0值则系统将不断刷新,默认值是5 s。需要注意的是如果设置太小的时间,很可能会引起不断刷新,从而根本来不及看清显示的情况,而且系统负载也会大大增加。f或者F:从当前显示中添加或者删除项目。o或者O:改变显示项目的顺序l:切换显示平均负载和启动时间信息。m:切换显示内存信息。t:切换显示进程和CPU状态信息。c:切换显示命令名称和完整命令行。M:根据驻留内存大小进行排序。P:根据CPU使用百分比大小进行排序。T:根据时间/累计时间进行排序。W:将当前设置写入~/.toprc文件中。查看多核CPU命令mpstat -P ALL 和 sar -P ALL 说明:sar -P ALL > aaa.txt 重定向输出内容到文件 aaa.txt1 top 命令,然后按数字“1”可监控每个逻辑CPU的状况:观察上图,服务器有8个逻辑CPU,实际上是1个物理CPU。如果不按1,则在top视图里面显示的是所有cpu的平均值。2 命令:mpstat -P ALL 3 命令:sar -P ALL输出较多,可grep或者重定向至文件查看进程字段排序默认进入top时,各进程是按照CPU的占用量来排序的,在【top视图 01】中进程ID为14210的java进程排在第一(cpu占用100%),进程ID为14183的java进程排在第二(cpu占用12%)。可通过键盘指令来改变排序字段,比如想监控哪个进程占用MEM最多,我一般的使用方法如下:敲击键盘“b”(打开/关闭加亮效果),top的视图变化如下:我们发现进程id为12363的“top”进程被加亮了,top进程就是视图第二行显示的唯一的运行态(runing)的那个进程,可以通过敲击“y”键关闭或打开运行态进程的加亮效果。敲击键盘“x”(打开/关闭排序列的加亮效果),top的视图变化如下:可以看到,top默认的排序列是“%CPU”。通过”shift + >”或”shift + <”可以向右或左改变排序列,下图是按一次”shift + >”的效果图:视图现在已经按照%MEM来排序了。改变进程显示字段敲击“f”键,top进入另一个视图,在这里可以编排基本视图中的显示字段:这里列出了所有可在top基本视图中显示的进程字段,有””并且标注为大写字母的字段是可显示的,没有””并且是小写字母的字段是不显示的。如果要在基本视图中显示“CODE”和“DATA”两个字段,可以通过敲击“r”和“s”键:“回车”返回基本视图,可以看到多了“CODE”和“DATA”两个字段:Linux查看物理CPU个数、核数、逻辑CPU个数复制代码总核数 = 物理CPU个数 X 每颗物理CPU的核数总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数查看物理CPU个数cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l查看每个物理CPU中core的个数(即核数)cat /proc/cpuinfo| grep "cpu cores"| uniq查看逻辑CPU的个数cat /proc/cpuinfo| grep "processor"| wc -l复制代码查看CPU信息(型号)cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c查看内 存信息cat /proc/meminfo
2021年08月26日
143 阅读
0 评论
0 点赞
2021-08-12
ssh服务未启动,22端口启用
这里使用的容器是centos7环境,基本是个比较纯净的环境,几乎什么都没装根据自己需求,先安装一些基本的(容器,默认是root用户)yum install -y net-tools接着安装openssl,openssh-serveryum install -y openssl openssh-server然后启动ssh/usr/sbin/sshd -D这里会报错[root@68e7598797d7 /]# /usr/sbin/sshd -D Could not load host key: /etc/ssh/ssh_host_rsa_key Could not load host key: /etc/ssh/ssh_host_ecdsa_key Could not load host key: /etc/ssh/ssh_host_ed25519_key需要进行下面的设置[root@68e7598797d7 /]# ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N '' [root@68e7598797d7 /]# ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N '' [root@68e7598797d7 /]# ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ''接着修改sshd_config文件配置信息,路径为 /etc/ssh/sshd_config1.将 Port 22 前面的注释去掉(开启22号端口)2.将 PermitRootLogin 的 no 改为 yes (这里是设置是否允许root用户登录,可根据自己需求决定是否开启)重新启动ssh[root@68e7598797d7 /]# /usr/sbin/sshd -D &注意,如果设置都没问题的话,命令结尾加个‘&’,自动后台运行,启动成功会返回进程号[root@68e7598797d7 /]# /usr/sbin/sshd -D & [1] 16给root添加密码添加过的可跳过此步骤[root@68e7598797d7 /]# yum install passwd [root@68e7598797d7 /]# passwd
2021年08月12日
165 阅读
0 评论
0 点赞
1
...
9
10
11
您的IP: