RHEL5/6/7 final version and kernel

Red Hat Enterprise Linux 5

Release General Availability Date redhat-release Errata Date* Kernel Version
RHEL 5.11 2014-09-16 2014-09-16 RHEA-2014-1238 2.6.18-398

Red Hat Enterprise Linux 6

Release General Availability Date redhat-release Errata Date* Kernel Version
RHEL 6.10 2018-06-19 2018-06-19 RHBA-2018:1856 2.6.32-754

Red Hat Enterprise Linux 7

Release General Availability Date redhat-release Errata Date* Kernel Version
RHEL 7.9 2020-09-29 2020-09-29 RHBA-2020:3849 3.10.0-1160

Note: https://access.redhat.com/articles/3078

Linux栈溢出保护机制

root@# sysctl -w kernel.randomize_va_space=0
root@# sysctl -w kernel.exec-shield=0
root# gcc -fno-stack-protector -z execstack -g -o test test.c

GDB

(gdb) disass main

 

 

iscsi client and server setup

targetcli
/> backstores/fileio create test /tmp/test.img 100m
/> iscsi/ create iqn.2006-04.com.example:test-target
/> cd iscsi/iqn.2006-04.com.example:test-target/tpg1/
tpg1/> luns/ create /backstores/fileio/test
tpg1/> set attribute generate_node_acls=1
tpg1/> exit

systemctl enable target.service

 

 

virtualizaion

  1. microsoft hyper-v:  this article explains in detail to build private cloud
  2. xen:  pratice though download link.
  3. vsphere:  evluation the product go to website.
  4. cloudstack:  compare to openstack, the cloudstack more active nowadays.

hp gen10 and dell r740 will a option to server purchasment.  storage can be either EMC or netapp.

xen server management

service xapi restart                                — 重启XAPI服务(负载过高时慎用)

xe-toolstack-restart                              — 重启XenServer所有服务(负载过高时慎用)

xe pool-emergency-transition-to-master   — 将某台XenServer强制设置为池主服务器(丢失池主服务器时使用)

xe sr-list                                                     — 显示所有物理存储(SR)信息

xe sr-list uuid=”UUID”                                — 匹配SR的UUID显示SR信息

xe sr-list name-label=”SR名称”                   — 匹配SR名称显示SR信息

xe pbd-list sr-uuid=”SR-UUID”                   — 匹配SR的UUID找出对应的物理连接(PBD)信息

xe pbd-unplug uuid=”PBD-UUID”              — 匹配PBD的UUID删除对应的PBD

xe sr-forget uuid=”SR-UUID”                     — 匹配SR的UUID遗忘对应的SR

 

xe sr-create name-label=”自定义名称” shared=false device-config-device=/dev/sdb(设备名) type=lvm

xe vm-start name-label=”VM名称”                        — 匹配VM名称执行VM开机

xe vm-reboot name-label=”VM名称”                     — 匹配VM名称执行VM重启

xe vm-shutdown name-label=”VM名称”               — 匹配VM名称执行VM关机

xe vm-shutdown uuid=”UUID”                              — 匹配VM的UUID执行VM关机,

xe vm-start uuid=”UUID”

xe vm-reboot uuid=”UUID”

xe vm-list                                                               — 显示所有VM信息

xe vm-list name-label=”VM名称”                        — 匹配名称显示VM信息

xe vm-list uuid=”UUID”                                       — 匹配uuid显示VM信息

xe vdi-list                                                              — 显示所有虚拟硬盘(VDI)信息

xe vdi-list vm-uuid=”VM-UUID”                        — 匹配VM的UUID显示VDI信息

xe vdi-list uuid=”UUID”                                      — 匹配VDI的UUID显示VDI信息

xe vdi-list name-label=”VDI名称”                      — 匹配VDI名称显示VDI信息

xe vdi-forgrt uuid=”UUID”                                 — 匹配VDI的UUID遗忘该VDI信息

 

xe pif-reconfigure-ip uuid=b7907c0c-e7e7-9e14-74aa-3a86d694f7bf mode=static IP=172.16.30.101 netmask=255.255.255.0 gateway=172.16.30.1 dns=8.8.8.8

 

如果因为Pool中Master主机由于某种原因导致失效,会引起整个Pool进入紧急模式,恢复步骤如下:

在成员服务器上输入如下命令

# xe host-emergency-ha-disable              (关闭HA)

#xe-toolstack-restart

这些将会关闭成员服务上运行的虚拟机

如果确认原Master主机无法恢复,则需要手工指定Master主机,在要将某一台成员服务器设置成新的Master主机,请在该服务器上输入如下命令:

#xe pool-emergency-transition-to-master

#xe pool-recover-slaves

然后在原来的Master主机上运行如下命令,将其设置为Pool的成员服务器。

#xe pool-emergency-reset-master master-address=<IP ADDRESS of the new master>

如果原Master主机确定崩溃,只能重装,使用原机器名和IP地址重装后无法加入到Pool中,需先清理掉该主机的信息才能添加。使用如下命令删除主机:

#xe pool-eject host uuid=<host_uuid>

UUID的查找,可以通过如下命令进行:

#xe host-list

正常模式下,要切换Master主机,可以使用下列命令:

# xe pool-designate-new-master host-uuid=

Redhat yum to Centos

http://192.168.1.2/Centos72/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-langpacks-0.4.2-4.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-aliases-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-changelog-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-tmprepo-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-verify-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-plugin-versionlock-1.1.31-34.el7.noarch.rpm
http://192.168.1.2/Centos72/Packages/yum-utils-1.1.31-34.el7.noarch.rpm
rpm -qa | grep yum | xargs rpm -e –nodeps
rpm -ivh http://192.168.1.2/Centos72/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm http://192.168.1.2/Centos72/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm http://192.168.1.2/Centos72/Packages/yum-utils-1.1.31-34.el7.noarch.rpm http://192.168.1.2/Centos72/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm http://192.168.1.2/Centos72/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm http://192.168.1.2/Centos72/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm

rpm -ivh http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-50.el7.noarch.rpm

pvresize -v /dev/xvda2
lvs
lvextend -l +100%free /dev/mapper/rhel-root
lvresize -L 10 /dev/mapper/rhel-home

lvs
xfs_growfs /dev/mapper/rhel-root

dd if=/dev/zero of=/var/swap bs=1024 count=4000000
mkswap /var/swap
swapon /var/swap
chmod 0600 /var/swap
/var/swap swap swap defaults 0 0

4096000000 bytes (4.1 GB) copied, 132.766 s, 30.9 MB/s

pvcreate /dev/sdxx
vgextend media /dev/sdxx
lvm lvextend -l +100%FREE /dev/media/root
# resize2fs -f /dev/media/root
# reboot