<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                > 基于項目實戰中《方案一》設計 > 系統自動部署依賴軟件: Cobbler > 默認為Centos 7.x 系統,與Centos 6.x的區別會注明 ## 操作系統自動化部署需求 #### 系統環境標準化 - 標準化 - 字符集 - 標準化 - 命令行 - 標準化 - 內核參數 - 標準化 - 系統參數 #### 分區標準化 - 標準化 - 標準化分區 #### 系統配置標準化 - 標準化 - 網卡名稱 - 標準化 - IP地址 - 標準化 - IPv6 - 標準化 - YUM環境 - 標準化 - 系統服務 - 標準化 - 主機名 - 標準化 - VIM - 標準化 - 用戶 - 標準化 - SSH - 標準化 - 時間 - 標準化 - Selinux - 標準化 - 關閉ctrl+alt+del快捷鍵 #### 軟件標準化 - 標準化 - 基礎軟件包 - 標準化 - 常用軟件包 - 標準化 - Java標準化 #### 配套軟件標準化 - 標準化 - 監控Agent - 標準化 - 公鑰(管理機免密鑰) ## 需求拆解 >以下內容來自《3.1 Cobbler(系統自動部署)》 #### 系統環境標準化 - 字符集 ##### 需求 - 字符集設置 en_US.utf8 ##### 一鍵優化腳本配置 Centos 7.x ```shell #update system character localectl set-locale LANG=en_US.utf8 ``` 注意 Centos 6 和 Centos 7 之間配置的差異 #### 系統環境標準化 - 命令行 ##### 需求 - 配置shell,便于定位當前目錄 ##### 一鍵優化腳本 ```shell #modify PS1 echo 'export PS1="[ \033[01;33m\u\033[0;36m@\033[01;34m\h \033[01;31m\w\033[0m ]\033[0m \n#"' >> /etc/profile ``` #### 系統環境標準化 - 內核參數 ##### 需求 - 優化網卡 - 優化swap ##### 一鍵優化腳本配置 ```shell #tune kernel parametres cat >> /etc/sysctl.conf << EOF net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.ip_local_port_range = 10000 65000 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_tw_buckets = 36000 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_keepalive_time = 600 net.ipv4.tcp_fin_timeout = 30 vm.swappiness=10 vm.max_map_count = 262144 EOF ``` ##### 備注:對不了解的參數不要配置 #### 系統環境標準化 - 系統參數 ##### 需求 - 打開文件描述符 ##### 一鍵優化腳本配置 ```shell #set the file limit cat >> /etc/security/limits.conf << EOF * soft nofile 65535 * hard nofile 65535 EOF ``` ##### 備注:目前還不明白為什么很多人配置成102400 #### 分區標準化 - 標準化分區 ##### 需求 - 虛擬機或服務器 ```shell /boot 200M~1G /swap 1G~8G / 剩余全部 ``` - Oracle服務器 ```shell /boot 200M~1G /swap >16G / 40G /data(Oracle數據目錄) 剩余全部 ``` ##### Cobbler配置 ```shell #Disk partitioning information part /boot --fstype xfs --size 1024 --ondisk sda #Oracle:part swap --size 16384 --ondisk sda part swap --size 2048 --ondisk sda part / --fstype xfs --size 1 --grow --ondisk sda ``` 注意 Centos 6.x 和Centos 7.x 磁盤分區格式的區別 #### 系統配置標準化 - 網卡配置 ##### 需求 - 網卡名稱以eth0開始 - 關閉IPv6 ##### Cobbler配置 修改鏡像配置 ```shell cobbler profile edit --name=Centos-7.3-x86_64 --kopts='net.ifnames=0 biosdevname=0 noipv6' ``` #### 系統配置標準化 - 網絡和主機名配置 ##### 需求 - 系統安裝時指定IP地址、主機名、網關、子網掩碼 ##### Cobbler配置 ```shell cobbler system edit --name=odb01.prod.ding --mac=00:0c:29:34:58:f1 --profile=Centos-6.8-x86_64 --ip-address=192.168.0.20 --subnet=255.255.255.0 --gateway=192.168.0.1 --interface=eth0 --static=1 --hostname=odb01.prod.ding --name-servers="114.114.114.114" ``` #### 系統配置標準化 - YUM環境 ##### 需求 - 使用內網YUM源 - 如無內網YUM源,配置外網YUM源 ##### Cobbler配置內網YUM源 請參照 《3.1.4 Cobbler基礎配置》中“建立本地yum源” ##### 一鍵優化腳本 沒有cobbler-config.repo,就配置阿里YUM源 ```shell #clean OS default repo mkdir /etc/yum.repos.d/old && mv /etc/yum.repos.d/C* /etc/yum.repos.d/old/ #add repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo function_writelog_judgment "[add aliyun mirrors base]" wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo function_writelog_judgment "[add aliyun mirrors epel]" #rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm ``` #### 系統配置標準化 - 系統服務 ##### 需求 - 關閉無用服務 ##### 一鍵優化腳本 Centos 7.x ```shell 目前無優化方案 ``` Centos 6.x ```shell #set system start service LANG=en for chkoff in `chkconfig --list|grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $chkoff off;done for chkoff in crond network rsyslog sshd;do chkconfig --level 3 $chkoff on;done ``` #### 系統配置標準化 - VIM ##### 需求 - VIM基礎配置,并增加易讀性 ##### 一鍵優化腳本 結尾拷貝到普通用戶環境變量 ```shell #modify vimrc cat >> /root/.vimrc << EOF syntax enable syntax on set ruler set number set cursorline set cursorcolumn set hlsearch set incsearch set ignorecase set nocompatible set wildmenu set paste set nowrap set expandtab set tabstop=2 set shiftwidth=4 set softtabstop=4 set gcr=a:block-blinkon0 set guioptions-=l set guioptions-=L set guioptions-=r set guioptions-=R highlight CursorLine cterm=NONE ctermbg=black ctermfg=green guibg=NONE guifg=NONE highlight CursorColumn cterm=NONE ctermbg=black ctermfg=green guibg=NONE guifg=NONE EOF cp /root/.vimrc /home/ding/ ``` #### 系統配置標準化 - 用戶 ##### 需求 - 建立日常管理用戶 - 為用戶設置sudo權限 - 所有用戶使用相同密碼(無CMDB情況下) - 用戶設置強密碼 ##### 一鍵優化腳本 ```shell #add default user useradd ding -u 2017 echo 'ding@)!&' | passwd --stdin ding && history -c #set sudo authority echo "" >> /etc/sudoers echo "#set sudo authority" >> /etc/sudoers echo "ding ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers ``` #### 系統配置標準化 - SSH ##### 需求 - 禁止Root遠程登錄 - 關閉DNS解析 - 不允許空密碼 - 修改SSH默認端口 - 關閉GSSAPI校驗 ##### 一鍵優化腳本 ```shell \cp /etc/ssh/sshd_config /etc/ssh/sshd_config.`date +%F` sed -i 's/^GSSAPIAuthentication yes$/GSSAPIAuthentication no/' /etc/ssh/sshd_config sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config sed -i 's%#PermitRootLogin yes%PermitRootLogin no%g' /etc/ssh/sshd_config sed -i 's%#PermitEmptyPasswords no%PermitEmptyPasswords no%g' /etc/ssh/sshd_config #sed -i 's%#Port 22%Port 52020%g' /etc/ssh/sshd_config ``` #### 系統配置標準化 - 時間 ##### 需求 - 所有服務器每分鐘與時間服務器進行同步 ##### 一鍵優化腳本 ```shell echo "* 4 * * * /usr/sbin/ntpdate ${ntp_server}> /dev/null 2>&1" >> /var/spool/cron/root ``` #### 系統配置標準化 - Selinux ##### 需求 - 關閉selinux ##### 一鍵優化腳本 ```shell sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config ``` #### 系統配置標準化 - 關閉ctrl+alt+del快捷鍵 ##### 需求 - 關閉ctrl+alt+del快捷鍵 ##### 一鍵優化腳本 centos 7.x ```shell mv /usr/lib/systemd/system/ctrl-alt-del.target /usr/lib/systemd/system/ctrl-alt-del.target.bak ``` centos 6.x ```shell mv /etc/init/control-alt-delete.conf /etc/init/control-alt-delete.conf.bak ``` #### 軟件標準化 - 基礎軟件包 ##### 需求 - 安裝base包組 - 安裝core包組 - 安裝fonts包組 - 安裝performance tools包組 - Oracle 需要安裝desktop ##### Cobbler配置 ```shell #Package install information %packages @base @core @fonts @performance tools %end ``` #### 軟件標準化 - 常用軟件包 ##### 需求 - 安裝常用軟件 ##### 一鍵優化腳本 ```shell yum -y install ntp lrzsz tree telnet dos2unix sysstat sysstat iptraf ncurses-devel openssl-devel zlib-devel OpenIPMI-tools nmap screen ``` #### 軟件標準化 - 升級軟件包 ##### 需求 - 升級當前軟件包 ##### 一鍵優化腳本 ```shell yum -y update ``` #### 軟件標準化 - Java標準化 待完善 #### 配套軟件標準化 - 監控Agent ##### 需求 - 安裝監控所需要的Agent ##### 一鍵優化腳本 ```shell yum install zabbix-agent zabbix-sender -y ``` #### 配套軟件標準化 - 公鑰(管理機免密鑰) ##### 需求 - 設置管理機(Ansible)的公鑰 - 便于上線后,進行個性化配置(配置文件修改) ##### 一鍵優化腳本 ```shell wget http://cobbler_host/ansible_key -O /tmp/ansible_key cat /tmp/ansible_key >> /home/ding/.ssh/authorized_keys rm -f /tmp/ansible_key ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看