分类目录归档:Linux/Unix

CentOS7安装4.17内核并启动BBR

安装4.17内核:

首先导入elrepo安装源

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

安装4.17内核

sudo yum --enablerepo=elrepo-kernel install -y kernel-ml

确认安装结果

rpm -qa | grep kernel-ml

列出当前grub2启动菜单的所有项

awk -F\' '$1=="menuentry " {print i++ ":" $2}' /etc/grub2.cfg

继续阅读

CentOS7安装配置DRBD9

安装:
首先导入elrepo安装源

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

安装DRBD软件包

yum install -y drbd90-utils kmod-drbd90

启动DRBD内核模块

modprobe drbd
echo drbd > /etc/modules-load.d/drbd.conf

继续阅读

VMware Photon OS安装配置

VMware Photon OS是VMware公司制作的Container Host系统,由于Photon OS可以直接部署在vSphere平台上,使得系统可以去除大量不必要的硬件驱动,让系统变得十分精简高效。以下将对Photon OS在vSphere平台上的安装配置做一个简单探索。

Photon OS下载页面https://github.com/vmware/photon/wiki/Downloading-Photon-OS,当前版本为2.0。
下载介质分多种版本,Full ISO包含了所有的包,可用于完整安装;OVA with virtual hardware v11用于vSphere 6.0平台;OVA with virtual hardware v13用于vSphere 6.5、6.7平台;其他镜像(略)可用于VMware Workstation、VMware Funsion、Amazon AWS、Microsoft Azure、Google Compute Engine等工作站和云平台。
继续阅读

CentOS Atomic下载

CentOS Atomic主机是一个专为执行Docker容器而设的轻量操作系统,它创建自标准的CentOS 7组件,并追随Red Hat企业级Linux Atomic主机的组件版本。
更多内容可查看Atomic项目主页http://www.projectatomic.io/
以下下载地址来源于CentOS网站:https://wiki.centos.org/SpecialInterestGroup/Atomic/Download
未压缩qcow2格式下载链接
xz压缩qcow2格式下载链接
gz压缩qcow2格式下载链接
ISO镜像下载链接

CoreOS ISO引导安装

1. 从官网下载最新CoreOS ISO文件
https://stable.release.core-os.net/amd64-usr/current/coreos_production_iso_image.iso

2. 修改SSH配置
使用ISO文件引导Live CD,复制sshd_config文件
cd /etc/ssh
sudo mv sshd_config{,.bak}
sudo cp /usr/share/ssh/sshd_config .
sudo vi sshd_config
增加一行PermitRootLogin yes
sudo systemctl restart sshd
sudo passwd root

3. 通过SSH将ignition.json复制到服务器
ignition.json文件内容如下

{
  "ignition": {
    "config": {},
    "timeouts": {},
    "version": "2.1.0"
  },
  "networkd": {},
  "passwd": {
    "users": [
      {
        "name": "core",
        "sshAuthorizedKeys": [
          "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGdByTgSVHq......."
        ]
      }
    ]
  },
  "storage": {},
  "systemd": {}
}

4. 将CoreOS安装到磁盘
sudo coreos-install -d /dev/sda -C stable -i ~/ignition.json

RHEL6与RHEL7的变化(转)

System and command changes between RHEL 6 and RHEL 7

Between RHEL6 and RHEL7 there are a number of changes to tools, commands, and workflows. Changes that are likely to affect common administrative tasks are listed here:

  • Anaconda RHEL installer completely redesigned1
  • Legacy GRUB boot loader replaced by GRUB22
  • Procedure for bypassing root password prompt at boot completely different3
  • SysV init system and all related tools replaced by systemd4
  • ext4 replaced by xfs as default filesystem type5
  • Directories /bin, /sbin, /lib and /lib64 are now all under the /usr directory6
  • Network interfaces have a new naming scheme based on physical device location (e.g., eth0 might become enp0s3)7
  • ntpd replaced by chronyd as the default network time protocol daemon8
  • GNOME2 replaced by GNOME3 as default desktop environment9
  • System registration and subscription now handled exclusively with Red Hat Subscription Management (RHSM)10
  • MySQL replaced by Mariadb11
  • tgtd replaced by targetcli12
  • High Availability Add-On: RGManager removed as resource-management option (in favor of Pacemaker); all CMAN features merged into Corosync (qdiskd replaced by votequorum plugin); all tools unified into pcs13
  • ifconfig and route commands are further deprecated in favor of ip
  • netstat further deprecated in favor of ss
  • System user UID range extended from 0-499 to 0-999
  • locate no longer available by default; (available as mlocate package)
  • nc (netcat) replaced by nmap-ncat

See footnotes for additional detail about these changes.

继续阅读

CentOS 7 (RHEL 7)服务管理命令的变化

CentOS 7 (RHEL 7)带来了新的服务管理命令,为了保持兼容原有的命令仍可以使用,以下是新旧命令的对照。

启动、停止、重启、重载、检查服务:
6: service httpd start|stop|restart|reload|status
7: systemctl start|stop|restart|reload|status httpd.service

允许、禁止服务自启动:
6: chkconfig httpd on|off
7: system enable|disable httpd.service

列出服务:
6: chkconfig –list
7: systemctl list-unit-files –type=service 或 ls /etc/systemd/system/*.wants/

添加服务:
6: chkconfig httpd –add
7: systemctl daemon-reload

Windows & Unix Command基础教学(1) – cd命令

cd命令
cd命令用于更改工作目录用

Windows中的用法: (cd命令也可写为chdir)
cd 更改工作目录到当前盘符的根目录
cd .. 更改工作目录到当前目录的上一级目录
cd c:windows 更改工作目录到c:windows
cd /d d:temp 更改工作目录到d:temp,不用先输d:
cd 显示当前路径

Unix中的用法:
cd / 更改工作目录到根目录
cd /usr/local 更改工作目录到/usr/local目录
cd 更改工作目录到当前用户的home目录
(Unix中显示当前路径的命令是pwd)