CentOS6和CentOS7更高的内核 一键安装[lotServer] 锐速 Vicer

1.支持更高的Linux内核一键安装[lotServer] 锐速.
2.支持一键完全卸载[lotServer] 锐速 (此脚本安装的无残留).
3.不支持自动更换内核. CentOS6和CentOS7 一键更换内核,一键安装锐速[lotServer]
4.不支持OpenVZ.
所有内容均来自互联网.本人不负任何法律责任,仅供学习使用.
Update:2019.04.15

一键安装[lotServer] 锐速:
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) install

一键卸载[lotServer] 锐速:
bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) uninstall

使用方法:
启动命令 /appex/bin/lotServer.sh start
停止加速 /appex/bin/lotServer.sh stop
状态查询 /appex/bin/lotServer.sh status
重新启动 /appex/bin/lotServer.sh restart

1.更新许可证(有效期为6个月)
wget -qO '/appex/etc/apx.lic' "https://api.moeclub.org/lotServer?ver=1&mac=00:00:00:00:00:00"
使用 ifconfig 查看网卡 mac 地址,替换 00:00:00:00:00:00 (当内核版本号小于等于 3.11.20.10 时, 请设置 ver=0)

2.使用KeyGen, 更新许可证(lic文件)(有效期到2099年)
git clone https://github.com/Tai7sy/LotServer_KeyGen
cd LotServer_KeyGen
php keygen.php 00:00:00:00:00:00 (使用 ifconfig 查看网卡 mac 地址,替换 00:00:00:00:00:00)
cp out.lic /appex/etc/apx.lic
状态查询 /appex/bin/lotServer.sh status

3.CentOS7启动自动运行lotServer
chmod +x /etc/rc.local
vi /etc/rc.local
添加su - root -c "/appex/bin/lotServer.sh start"

图为CentOS Linux release 7.5.1804 安装[lotServer] 锐速

CentOS 7.8使用devtoolset-9使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)编译安装Redis 6.0.5

CentOS 7.8 编译安装Redis 6.0.5报错
In file included from server.c:30:0:
server.h:1045:5: error: expected specifier-qualifier-list before ‘_Atomic’
_Atomic unsigned int lruclock; /* Clock for LRU eviction */
^
server.c: In function ‘serverLogRaw’:
server.c:1028:31: error: ‘struct redisServer’ has no member named ‘logfile’
int log_to_stdout = server.logfile[0] == '\0';
^
server.c:1031:23: error: ‘struct redisServer’ has no member named ‘verbosity’
if (level < server.verbosity) return;
^
server.c:1033:47: error: ‘struct redisServer’ has no member named ‘logfile’
fp = log_to_stdout ? stdout : fopen(server.logfile,"a");
^
server.c:1046:47: error: ‘struct redisServer’ has no member named ‘timezone’
nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active);
^
server.c:1046:63: error: ‘struct redisServer’ has no member named ‘daylight_active’
nolocks_localtime(&tm,tv.tv_sec,server.timezone,server.daylight_active);
......
......

问题原因
CentOS 7的gcc版本为4.8.5,Redis 6.0.5最低需要gcc4.9,因此需要升级gcc版本
from redis 6.0.5, building redis from source code needs C11 support.The version of gcc in CentOS 7 is 4.8.5, but C11 was introduced in 4.9.

解决办法
1、手动编译gcc大于4.9的版本
2、安装 devtoolset-9(使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC))编译安装Redis 6.0.5
yum install centos-release-scl -y
yum install devtoolset-9 -y

临时使用高版本gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) (推荐使用这个方法)
export CC=/opt/rh/devtoolset-9/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-9/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-9/root/usr/bin/c++

wget http://download.redis.io/releases/redis-stable.tar.gz
tar zxf redis-stable.tar.gz && cd redis-stable
make -j2 && make install
if [ -f "/root/redis-stable/src/redis-server" ]; then
mkdir -p /usr/local/redis/{bin,etc,var}
/bin/cp /root/redis-stable/src/{redis-benchmark,redis-check-aof,redis-check-rdb,redis-cli,redis-sentinel,redis-server} /usr/local/redis/bin/
/bin/cp /root/redis-stable/redis.conf /usr/local/redis/etc/

cd /root/redis-stable/src
id -u redis >/dev/null 2>&1
[ $? -ne 0 ] && useradd -M -s /sbin/nologin redis

chown -R redis:redis /usr/local/redis/{var,etc}
#
if [ -e /bin/systemctl ]; then
cat > /lib/systemd/system/redis-server.service << "EOF"
[Unit]
Description=Redis In-Memory Data Store
After=network.target

[Service]
Type=forking
PIDFile=/var/run/redis/redis.pid
User=redis
Group=redis

Environment=statedir=/var/run/redis
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p ${statedir}
ExecStartPre=/bin/chown -R redis:redis ${statedir}
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
ExecStop=/bin/kill -s TERM $MAINPID
Restart=always
LimitNOFILE=1000000
LimitNPROC=1000000
LimitCORE=1000000

[Install]
WantedBy=multi-user.target
EOF
systemctl enable redis-server

#确认Redis 6.0.5版本
[www@zhangfangzhou_cn ~]# redis-server -v
Redis server v=6.0.5 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=1987ac006866aa00

CentOS7.7安装 devtoolset-8(使用高版本gcc (GCC) 8.3.1 20190311)编译安装aria2-1.35.0
CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

如何编译Linux Kernel(linux-5.6.12内核)并制作成rpm文件

如何编译内核及制作RPM包
CentOS 7 编译Linux Kernel(linux-5.6.12内核)并制作成rpm文件
1、下载Latest Stable Kernel
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.12.tar.xz
tar -Jxf linux-5.6.12.tar.xz

2、安装依赖包
yum -y install openssh-devel elfutils-libelf-devel bc

3、从 /boot 目录将现有版本的内核编译config配置文件拷过来到放到新的内核源码解压目录内并重命名为.config的隐藏文件(这个文件保存了在安装系统时内核所安装的模块配置信,否则需要重新手动指定每一个模块的编译配置)
cd linux-5.6.12
cp /boot/config-3.10.0-1062.el7.x86_64 ./.config
或者
cp /boot/config-$(uname -r) ./.config

3、安装开发工具包组
yum -y groupinstall "development tools"

4、安装ncurse-devel包 (make menuconfig 文本界面窗口依赖包)
yum -y install ncurses-devel
运行 make menuconfig,开启文本界面的编译选项菜单窗口,可以对内核加载的模块编译选项进行调整,如修改编译后的内核名称、新添加之前系统缺少的模块等
make menuconfig

(1)修改内核名称
General setup --->local version -append to kernel release #注意不要有空格

-----------
出现空格的话会产生错误错误
[root@www.zhangfangzhou.cn linux-5.6.12]# sudo make modules_install
ln: target ‘5.6.12_zhangfangzhou.cn_20200510/source’ is not a directory
make[1]: *** [_modinst_] Error 1
make: *** [sub-make] Error 2
-----------

(2)新添加NTFS文件系统支持模块
File systems --->DOS/FAT/NT Filesystems --->NTFS file system support

5、确认配置文件中NTFS功能是否添加成功
vi .config

6、编译内核 #时间较长,具体时间根据硬件性能决定
make -j `cat /proc/cpuinfo | grep 'model name'|wc -l`
或者
## get thread or cpu core count using nproc command ##
make -j $(nproc)

7、编译安装模块
编译完成后执行make modules_install 安装内核模块
make modules_install

8、安装内核核心文件
make install

9、制作成linux-5.6.12内核rpm文件
yum -y install rpmdevtools

cd linux-5.6.12
make rpm-pkg ##同时构建源和二进制RPM软件包
或者
make binrpm-pkg ##仅构建二进制RPM软件包

Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/kernel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64
Wrote: /root/rpmbuild/SRPMS/kernel-5.6.12_zhangfangzhou.cn_20200510-1.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-headers-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/kernel-devel-5.6.12_zhangfangzhou.cn_20200510-1.x86_64.rpm

10、CentOS 7 更换最新内核
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' #查看内核版本
grub2-set-default 0

reboot重启

11、Debian/Ubuntu 更换最新内核
sudo update-initramfs -c -k 5.6.12
sudo update-grub

12、查看内核版本
uname -msr
Linux 5.6.12_zhangfangzhou.cn_20200510 x86_64
----------
#https://linuxconfig.org/how-to-compile-vanilla-linux-kernel-from-source-on-fedora
#https://linuxhint.com/compile-linux-kernel-centos7/

U盘安装VMware ESXi 6.7.0.update03的时候出错提示menu.c32 not a com32r image

用U盘给一台电脑安装VMware ESXi 6.7.0.update03的时候出错提示menu.c32 not a com32r image
menu.c32: not a COM32R image
boot:

解决方法1
boot: install
在boot:后面输入install 然后按回车就可以继续安装

解决方法2
电脑支持UEFI BOOT的时候,可以选择UEFI模式从U盘启动,就可以顺利安装VMware ESXi 6.7.0.update03

U盘安装VMware ESXi 6.7.0.update03的时候提示No Network Adapters找不到网卡

网卡型号
瑞昱 RTL8168/8111/8112 Gigabit Ethernet Controller,瑞昱(realtek)网卡俗称螃蟹网卡

解决办法
需要打包驱动到VMware ESXi 6.7.0.update03或者对应的ESXi版本

VMware ESXi 6.7.0.update03安装包在线下载,在线封装网卡驱动

1、更新操作平台
Windows Server 2019
Windows PowerShell (5.1.17763.771)
PS C:\Users\Administrator> Get-Host | Select-Object Version
Version
-------
5.1.17763.771

2、安装VMware PowerCLI(VMware PowerCLI最新版地址https://code.vmware.com/web/dp/tool/vmware-powercli/)
(1)Windows PowerShell在线安装VMware PowerCLI
Find-Module -Name VMware.PowerCLI #查找VMware.PowerCLI模块
Install-Module -Name VMware.PowerCLI -Scope CurrentUser #当前用户安装VMware.PowerCLI,我执行后什么也没有显示
或者
Install-Module -Name VMware.PowerCLI #我执行后什么也没有显示

(2)离线安装VMware PowerCLI
打开网址https://code.vmware.com/web/dp/tool/vmware-powercli/找到VMware-PowerCLI-11.5.0-14912921.zip,点击下载然后解压到WindowsPowerShell模块目录下
C:\Windows\System32\WindowsPowerShell\v1.0\Modules

Import-Module VMware.PowerCLI #PowerShell导入模块
Import-Module : 无法加载文件 C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\VMware.VimAutomation.Sdk\VMware.VimAutomation.Sdk.psm1,因为在此系统上禁止运行脚本。
可能是新版本中PowerShell的Execution Policies为Undefined,较严格,修改一下就可以了
执行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser 修改后
再次执行Import-Module VMware.PowerCLI 导入即可。

导入成功提示
Welcome to VMware PowerCLI!

Log in to a vCenter Server or ESX host: Connect-VIServer
To find out what commands are available, type: Get-VICommand
To show searchable help for all PowerCLI commands: Get-PowerCLIHelp
Once you've connected, display all virtual machines: Get-VM
If you need more help, visit the PowerCLI community: Get-PowerCLICommunity

Copyright (C) VMware, Inc. All rights reserved.

3、下载ESXi-Customizer-PS 2.60 ( ESXi-Customizer-PS是一个Powershell脚本,可以极大地简化和自动化使用VMware PowerCLI)
直接下载
http://vibsdepot.v-front.de/tools/ESXi-Customizer-PS-v2.6.0.ps1

博客下载
http://www.zhangfangzhou.cn/sh/ESXi-Customizer-PS-v2.6.0.ps1

4、新建文件夹C:\www.zhangfangzhou.cn
将ESXi-Customizer-PS-v2.6.0.ps1放到文件夹C:\www.zhangfangzhou.cn

5、执行添加网卡驱动、sata驱动
.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168,net-igb,sata-xahci
在运行命令的文件夹会生成一个iso(ESXi-6.7.0-20191204001-standard-customized.iso)文件(大概20分钟左右)

说明
https://vibsdepot.v-front.de/ 由VMware User Community创建的适用于VMware ESXi的软件和驱动程序包

Updated driver for Realtek 8168/8111/8411/8118 based NICs #更新基于Realtek 8168/8111/8411/8118 NIC的驱动程序
https://vibsdepot.v-front.de/wiki/index.php/Net55-r8168
http://vibsdepot.v-front.de/depot/RTL/net55-r8168/net55-r8168-8.045a-napi.x86_64.vib
http://vibsdepot.v-front.de/depot/bundles/net55-r8168-8.045a-napi-offline_bundle.zip

Intel(R) Gigabit Ethernet Network Driver (modified to ignore invalid NVM checksums) #英特尔(R)千兆以太网网络驱动程序
https://vibsdepot.v-front.de/wiki/index.php/Net-igb
https://vibsdepot.v-front.de/depot/INTL/net-igb-5.3.2/net-igb-5.3.2-99.x86_64.vib
https://vibsdepot.v-front.de/depot/bundles/net-igb-5.3.2-99-offline_bundle.zip

Adds the PCI IDs of several unsupported SATA AHCI controllers and maps them to the built-in AHCI driver#添加多个不受支持的SATA AHCI控制器
https://vibsdepot.v-front.de/wiki/index.php/Sata-xahci
http://vibsdepot.v-front.de/depot/vft/sata-xahci-1.42/sata-xahci-1.42-1.x86_64.vib
http://vibsdepot.v-front.de/depot/bundles/sata-xahci-1.42-1-offline_bundle.zip

.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168
.\ESXi-Customizer-PS-v2.6.0.ps1 -v67 -vft -load net55-r8168,net-igb,sata-xahci

6、在线安装更新需要科学上网或者直接使用国外的服务器

命令行操作vSphere--VMware PowerCLI安装 https://zerlong.com/739.html
https://www.jianshu.com/p/6f5a007b46af

nginx.service start-pre operation timed out. Terminating.

问题
服务器重启后Nginx服务不会自动启动,手动启动Nginx服务没有出现任何问题。

错误状态
#systemctl status nginx
nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Fri 2020-02-28 19:13:13 CST; 6min ago
Docs: http://nginx.org/en/docs/
Process: 806 ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf (code=killed, signal=TERM)

Feb 28 19:11:43 izj6cdtn3gxvjysis55g0hz systemd[1]: Starting nginx - high performance web server...
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: nginx.service start-pre operation timed out. Terminating.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: Failed to start nginx - high performance web server.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: Unit nginx.service entered failed state.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: nginx.service failed.

#journalctl -u nginx.service
-- Logs begin at Sat 2020-02-29 03:11:38 CST, end at Fri 2020-02-28 19:20:01 CST. --
Feb 28 19:11:43 izj6cdtn3gxvjysis55g0hz systemd[1]: Starting nginx - high performance web server...
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: nginx.service start-pre operation timed out. Terminating.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: Failed to start nginx - high performance web server.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: Unit nginx.service entered failed state.
Feb 28 19:13:13 izj6cdtn3gxvjysis55g0hz systemd[1]: nginx.service failed.

原因
没有足够的超时值来启动Nginx服务

解决办法
vim /usr/lib/systemd/system/nginx.service
增加TimeoutStartSec参数值:
[Service]
...
TimeoutStartSec=600
-------------------------------------------
例子
cat /usr/lib/systemd/system/nginx.service
[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/var/run/nginx.pid
ExecStartPost=/bin/sleep 0.1
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=true
LimitNOFILE=51200
LimitNPROC=51200
LimitCORE=51200
TimeoutStartSec=600

[Install]
WantedBy=multi-user.target
--------------------------------------------

这个情况也可能出现在其他服务上面,没有足够的超时值来启动Nginx或Apache或者其他服务

CentOS7
使用任何文本编辑器(例如vi)打开初始化init脚本:
对于Apache: /usr/lib/systemd/system/httpd.service
对于nginx: /usr/lib/systemd/system/nginx.service

增加TimeoutStartSec参数值
[Service]
...
TimeoutStartSec=600

Debian9或者Ubuntu18
可以使用以下命令找到确切初始化脚本
systemctl status apache2.service | grep loaded
systemctl status nginx.service | grep loaded

使用任何文本编辑器(例如vi)打开初始化init脚本:
对于Apache:/lib/systemd/system/apache2.service
对于nginx:/lib/systemd/system/nginx.service

增加TimeoutStartSec参数值
[Service]
...
TimeoutStartSec=600
https://support.plesk.com/hc/en-us/articles/213387149-Nginx-Apache-are-not-running-after-server-reboot-on-a-Plesk-server-service-start-operation-timed-out-Terminating

Baidu Sitemap Generator 报错,WordPress发现了您的插件造成的错误:Baidu Sitemap Generator

升级PHP7.3之后,发现WordPress的Baidu Sitemap Generator在生成百度 XMLSitemap 生成器插件出现如下错误
错误详情
============
错误类别E_ERROR发生在文件www.zhangfangzhou.cn/wp-content/plugins/baidu-sitemap-generator/sitemap-function.php的439行。错误信息:Uncaught Error: Call to undefined function split() in www.zhangfangzhou.cn/wp-content/plugins/baidu-sitemap-generator/sitemap-function.php:439
Stack trace:
#0 www.zhangfangzhou.cn/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php(278): xml_annotate()
#1 www.zhangfangzhou.cn/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php(264): build_baidu_sitemap_xml('https...', 1)
#2 www.zhangfangzhou.cn/wp-content/plugins/baidu-sitemap-generator/baidu_sitemap.php(110): build_baidu_sitemap(1)
......
......
因为这款插件一直没有更新,PHP7版本废弃了一些PHP函数,split这个函数在PHP7版本已经不支持了,因此必须替换成PHP7版本的preg_split函数。

修复Baidu Sitemap Generator 报错需要修改2个地方

1、修改Baidu Sitemap Generator插件目录下的sitemap-function.php文件的439行和baidu_sitemap.php文件的308行
修改成

list( $today_year, $today_month, $today_day, $hour, $minute, $second ) = preg_split( '([^0-9])', $blogtime );

就是用preg_split替换掉split

2、修改Baidu Sitemap Generator插件目录下的baidu_sitemap.php


function baidu_sitemap_menu() {
/** Add a page to the options section of the website **/
if (current_user_can('manage_options'))
add_options_page("Baidu-Sitemap","Baidu-Sitemap", 8, __FILE__, 'baidu_sitemap_optionpage')
}
修改成
function baidu_sitemap_menu() {
/** Add a page to the options section of the website **/
if (current_user_can('manage_options'))
add_options_page("Baidu-Sitemap","Baidu-Sitemap", 'manage_options', __FILE__, 'baidu_sitemap_optionpage');
}

就是把8换成'manage_options'
修改完成后重启PHP,即可更新百度 XMLSitemap

百度云磁盘CDS Linux数据盘扩展分区

百度云磁盘CDS Linux数据盘扩展分区
随着Web业务的持续增加,原先400G的Web服务器数据磁盘已经不能满足使用,为满足Web业务的需要,决定扩容数据磁盘到1000G。
在百度云磁盘CDS扩容只是将磁盘的存储容量扩大,不会扩展分区和文件系统。

实战记录百度云磁盘CDS Linux数据盘扩展分区,Web 服务器为CentOS release 6.10 (Final)系统,数据磁盘的格式为EXT4。

1、查看Web服务器数据磁盘挂载信息
#mount | grep "/dev/vdb"
/dev/vdb1 on /data type ext4 (rw)

2、查看是否有程序在Web服务器数据磁盘正在运行
fuser -m /dev/vdb1
/dev/vdb1: 5115

如果有的话,查找并结束掉进程
ps aux | grep 5115
#ps aux | grep 5115
apache 5115 0.2 0.1 449060 29048 ? S 10:56 0:03 /usr/sbin/httpd

3、关闭正在使用Web服务器数据磁盘的服务或者进程
service httpd stop 或者 kill -9 5115

4、编辑fstab,取消Web服务器数据磁盘自动挂载
vi /etc/fstab
#/dev/vdb1 /data ext4 defaults 0 0

5、卸载Web服务器数据磁盘
#umount /dev/vdb1

#umount /dev/vdb1 如果有程序正在运行,则会这样提示
umount: /data: target is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
取消正在运行的程序 比如webserver mysql

6、调整分区大小
(1)查看分区表
fdisk /dev/vdb

p print the partition table
p
Command (m for help): p
Disk /dev/vdb: 1073.7 GB, 1073741824000 bytes
16 heads, 63 sectors/track, 2080507 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2c594bf0

Device Boot Start End Blocks Id System
/dev/vdb1 1 2080507 1048575496+ 83 Linux

(2) 删除当前分区。当屏幕显示"已选择分区 1
d delete a partition
d

(3)新建分区
n add a new partition
n

(4)保存修改并退出
w write table to disk and exit
w
The partition table has been altered!

----------------------------
如果fstab有自动挂载则会出现这样的提示,需要提前执行第4步。
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.
---------------------------
8、执行命令 lsblk /dev/vdb 查看当前文件系统是否已增加分区表
lsblk /dev/vdb
#lsblk /dev/vdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vdb 252:16 0 1000G 0 disk
└─vdb1 252:17 0 1000G 0 part /data

9、执行命令 e2fsck -n /dev/vdb1 查看当前文件系统的状态是否为 clean
e2fsck -n /dev/vdb1
如果有异常则会提示
/dev/vdb1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vdb1: 5641753/26214400 files (2.5% non-contiguous), 97404495/104857570 blocks

修复
fsck.ext4 -C0 /dev/vdb1

10、通知内核更新分区表 通知内核需同步数据盘的分区表信息。
yum -y install parted
partprobe /dev/vdb

11、完成文件系统扩展
resize2fs /dev/vdb1
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/vdb1 to 262142637 (4k) blocks.
The filesystem on /dev/vdb1 is now 262142637 blocks long.

Web服务器数据磁盘采用 ext4 文件系统,可以执行 resize2fs /dev/vdb1 命令以扩展文件系统大小。
对于 xfs 文件系统,需要先运行 mount /dev/vdb1 /data/ 命令,再运行xfs_growfs /dev/vdb1 以完成文件系统拓展。

12、编辑fstab,启用Web服务器数据磁盘自动挂载
vi /etc/fstab
/dev/vdb1 /data ext4 defaults 0 0

13、挂载全部
mount -a

14、确认文件系统扩展完毕
df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda1 ext4 20G 8.3G 11G 45% /
tmpfs tmpfs 12G 0 12G 0% /dev/shm
/dev/vdb1 ext4 985G 366G 569G 40% /data
/dev/vdc1 ext4 394G 270G 105G 73% /backup

---------------------------
https://cloud.baidu.com/doc/CDS/s/Lk0629a17

CentOS7.7安装 devtoolset-8(使用高版本gcc (GCC) 8.3.1 20190311)编译安装aria2-1.35.0

Aria2是一个支持HTTP/HTTPS, FTP, SFTP, BitTorrent和Metalink等协议的轻量级命令行下载工具。
编译安装aria2-1.35.0的时候出现错误,提示需要高版本gcc支持。
......
checking whether g++ supports C++11 features with -std=c++11 ... no
checking whether g++ supports C++11 features with -std=c++11 -stdlib=libc++... no
checking whether g++ supports C++11 features with -std=c++0x ... no
checking whether g++ supports C++11 features with -std=c++0x -stdlib=libc++... no
configure: error: *** A compiler with support for C++11 language features is required.
......

CentOS7.7默认的GCC版本为gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
#gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
#cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

解决方法有两种
1、手动编译gcc>4.8的版本
自行编译
2、安装devtoolset-8(使用高版本gcc (GCC) 8.3.1 20190311
yum install centos-release-scl -y
yum install devtoolset-8 -y
启用devtoolset-8
#scl enable devtoolset-8 -- bash
#source /opt/rh/devtoolset-8/enable

临时编译前使用高版本gcc (GCC) 8.3.1 20190311 (推荐使用这个方法)
export CC=/opt/rh/devtoolset-8/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-8/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-8/root/usr/bin/c++
继续编译安装aria2-1.35.0
......

CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2

CentOS6安装devtoolset(使用高版本gcc)GCC 4.8 GCC 4.9 GCC 5.2