美文网首页
2020-04-25 openstack模板机制作

2020-04-25 openstack模板机制作

作者: 阿丧小威 | 来源:发表于2020-04-25 23:54 被阅读0次

    1. 安装系统

    新建虚拟机 稍后安装操作系统 选择Linux 命名和选择位置 硬盘大小为50G 完成 编辑虚拟机 把虚拟化勾上 选择光盘 开启虚拟机进入安装界面 按Tab键,在最后按空格输入"net.ifnames=0 biosdevname=0",回车 默认,下一步 点击配置网络 手动配置IP 勾选启动开启网络选项 修改主机名 修改时区 修改时区 修改支持语言 添加中文 选择安装包 选中安装包 创建分区 手动创建分区 手动创建分区 创建swap分区 剩下空间分给/根分区 保存 接受 取消内核崩溃备份 取消内核崩溃备份 开始安装 配置密码 配置密码 重启

    2. 配置网卡信息(把不需要的删掉):

    [root@template ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    TYPE=Ethernet
    BOOTPROTO=none
    NAME=eth0
    DEVICE=eth0
    ONBOOT=yes
    IPADDR=192.168.9.127
    PREFIX=24
    GATEWAY=192.168.9.1
    DNS1=192.168.9.1
    DNS2=8.8.8.8
    DNS3=114.114.114.114
    [root@template ~]# systemctl restart network
    

    3. 防火墙的优化

    [root@template ~]# systemctl stop firewalld
    [root@template ~]# systemctl disable firewalld
    Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    [root@template ~]# vi /etc/selinux/config
    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=disabled
    # SELINUXTYPE= can take one of three values:
    #     targeted - Targeted processes are protected,
    #     minimum - Modification of targeted policy. Only selected processes are protected.
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted
    

    4. SSH的优化

    [root@template ~]# vi /etc/ssh/sshd_config
    GSSAPIAuthentication no
    UseDNS no
    [root@template ~]# systemctl restart sshd
    

    5. yum源优化

    # 使用光盘搭建本地yum源
    umount /mnt
    cd /etc/yum.repos.d
    mkdir test -p
    \mv *.repo test
    echo '[local]
    name=local
    baseurl=file:///mnt
    gpgcheck=0'>local.repo
    mount /dev/cdrom /mnt
    yum makecache
    

    6. 其他优化

    # 关闭网卡图形化设置模式
    [root@template ~]# systemctl stop NetworkManager.service
    [root@template ~]# systemctl disable NetworkManager.service
    Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
    Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
    Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
    Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
    # 下载tab补全命令
    [root@template ~]# yum install -y bash-completion.noarch
    # 下载常用命令
    [root@template ~]# yum install -y net-tools vim lrzsz wget tree screen lsof tcpdump
    # 关闭邮件服务
    [root@template ~]# systemctl stop postfix
    [root@template ~]# systemctl disable postfix
    Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service.
    

    最后关机。

    相关文章

      网友评论

          本文标题:2020-04-25 openstack模板机制作

          本文链接:https://www.haomeiwen.com/subject/lmskwhtx.html