openstack-1基础环境准备

openstack-1基础环境准备

openstack
openstack

基础环境准备

安装系统

最小化安装centos操作系统
系统磁盘100G
每个虚拟机 4 个网卡,其中前两个网卡为 NAT 模式后两个网卡为仅主机模式 ,
CPU 两个核心或以上,必须勾选开启虚拟化功能,否则后期 openstack 无法启动云主机
内存3G以上

虚拟机配置

重命名网卡

传递内核参数 net.ifnames=0 biosdevname=0,以更改网卡名称为 eth0,ethX:
出现安装界面时使用键盘上下键移动到第一行即 Install Centos Linux 7 , 然后按 tab 键,即可出现传递参数界面

openstack
openstack

更改主机名

hostnamectl set-hostname node
cat /etc/hostname

修改 hosts 文件

cat /etc/hosts

关闭防火墙和 selinux

systemctl disable NetworkManager firewalld
vim /etc/selinux/config
SELINUX=disabled

NAT 网络配置

bond0

cd /etc/sysconfig/network-scripts/

cat ifcfg-eth0
BOOTPROTO=static
NAME=eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
USERCTL=no
SLAVE=yes

cat ifcfg-eth1
BOOTPROTO=static
NAME=eth1
DEVICE=eth1
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
USERCTL=no
SLAVE=yes

vim ifcfg-bond0
BOOTPROTO=static
NAME=bond0
DEVICE=bond0
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100" #指定绑定类型为 1 及链路状态监测间隔时间
IPADDR=192.168.10.X
NETMASK=255.255.255.0
GATEWAY=192.168.10.X
DNS1=192.168.10.X

bond1

cat ifcfg-eth2
BOOTPROTO=static
NAME=eth2
DEVICE=eth2
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond1
USERCTL=no
SLAVE=yes

cat ifcfg-eth3
BOOTPROTO=static
NAME=eth3
DEVICE=eth3
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond1
USERCTL=no
SLAVE=yes

cat ifcfg-bond1
BOOTPROTO=static
NAME=bond1
DEVICE=bond1
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100" #指定绑定类型为 1 及链路状态监测间隔时间
IPADDR=192.168.20.X
NETMASK=255.255.255.0

安装常用基础命令

yum install -y vim wget tree lrzsz gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel iproute net-tools iotop lsof ntpdate telnet bridge-utils

各服务器同步时间

时间必须保持一致,否则可能导致无法创建虚拟机等问题

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ntpdate ntp.aliyun.com && hwclock -w

crontab -l
* */2 * * * ntpdate ntp.aliyun.com && hwclock -w && date >> /root/ntpdate.log

记录用户操作历史命令history

vim /etc/profile
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
HISTTIMEFORMAT="`whoami`: | %F | %T: |${USER_IP}:" 
posted @ 2019-09-26 16:14  Final233  阅读(223)  评论(0编辑  收藏  举报