最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線(xiàn)溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
dhcp和ansible-創(chuàng)新互聯(lián)

一、搭建DHCP服務(wù),為局域網(wǎng)內(nèi)用戶(hù)提供10.1.1.0/24網(wǎng)段的IP,且租約期默認(rèn)為48小時(shí)
1.安裝軟件包:
yum install -y dhcp*
2.配置服務(wù):

讓客戶(hù)滿(mǎn)意是我們工作的目標(biāo),不斷超越客戶(hù)的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶(hù),將通過(guò)不懈努力成為客戶(hù)在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:空間域名、雅安服務(wù)器托管、營(yíng)銷(xiāo)軟件、網(wǎng)站建設(shè)、成華網(wǎng)站維護(hù)、網(wǎng)站推廣。
[root@localhost dhcp]# vim dhcpd.conf 
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 172800;
max-lease-time 172800;
log-facility local7;
subnet 10.1.1.0 netmask 255.255.255.0 {
        range 10.1.1.100 10.1.1.200;

3.啟動(dòng)服務(wù)并驗(yàn)證:

systemctl start dhcp
dhclient -d

二、在上述實(shí)驗(yàn)基礎(chǔ)上,實(shí)現(xiàn)DHCP中繼:

# 開(kāi)啟路由轉(zhuǎn)發(fā)功能
vim /etc/sysctl.conf
net.ipv4.ip-forward=1
sysctl -p
# 啟動(dòng)dhcp中繼服務(wù)
dhcrelay dhcp_server_ip

中繼服務(wù)實(shí)際使用中,基本沒(méi)有必要使用。其他網(wǎng)絡(luò)的主機(jī)另外新建一個(gè)dhcp服務(wù)就好,沒(méi)有必要非得使用中繼

三、借助Ansible Playbook自動(dòng)化搭建LNMP環(huán)境(可借助yum)
1.實(shí)驗(yàn)主機(jī):

ansible主機(jī):172.20.10.6
webservers:172.20.10.3
appservers:172.20.10.4

2.ansible主機(jī)免密鑰認(rèn)證
(1)

[root@localhost playbooks]# ssh-keygen  
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:LFUqZ3zNLyVoJzwgIo+LzGwHhd2YCnKh7kOl6IZQcZ4 root@localhost
The key's randomart image is:
+---[RSA 2048]----+
|  *o* . . .      |
|ooo@ + o = +     |
|+o+.E . * B = .  |
|*++.   * o + +   |
|=B..  . S   . .  |
|B .    .     .   |
|.=               |
|. .              |
|                 |
+----[SHA256]-----+

(2)

[root@localhost] ssh-copy-id 172.20.10.3
[root@localhost]# ssh-copy-id 172.20.10.4

3.ansible配置文件

[webservers]
172.20.10.3
[appservers]
172.20.10.4

4.定義playbook劇本:

[root@localhost playbooks]# vim lnmp.yml 
---
- hosts: webservers
  remote_user: root

  tasks:
    - name: install nginx
      yum:  name=nginx
    - name: config
      copy: src=/data/nginx.conf  dest=/etc/nginx/nginx.conf
      tags: conf
      notify: restart nginx
    - name: start nginx
      service: name=nginx state=started enabled=yes

  handlers:
    - name: restart nginx  
      service: name=nginx state=restarted

- hosts: appservers 
  remote_user: root

  tasks:
    - name: install services 
      yum: name={{ item }} 
      with_items:
        - mariadb
        - mariadb-server
        - php
        - php-fpm 
        - php-mysql
    - name:  php-fpm  config
      copy: src=/data/www.conf  dest=/etc/php-fpm.d/www.conf
      notify: restart php-fpm
    - name: start php-fpm
      service: name=php-fpm state=started enabled=yes
    - name : start mysql
      service: name=mariadb  state=started enabled=yes
    - name : config mysql
      shell: mysqladmin -uroot password "centos"
    - name: config php-index-file
      copy: src=/data/index.php  dest=/var/www/html/
    - name: config php-mysql-file
      copy: src=/data/mysql.php  dest=/var/www/html/

  handlers:
    - name: restart php-fpm
      service: name=php-fpm state=restart

(5)執(zhí)行結(jié)果:
dhcp和ansible
(6)測(cè)試:
dhcp和ansible
dhcp和ansible
四、采用Ansible Role方式自動(dòng)化搭建LNMP
1.實(shí)驗(yàn)主機(jī):

ansible主機(jī):172.20.10.6
webservers:172.20.10.3
appservers:172.20.10.4

2.ansible主機(jī)roles目錄:
dhcp和ansible
3.執(zhí)行結(jié)果為:
dhcp和ansible
4.訪(fǎng)問(wèn)測(cè)試為:
dhcp和ansible
dhcp和ansible

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線(xiàn),公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。


文章題目:dhcp和ansible-創(chuàng)新互聯(lián)
文章轉(zhuǎn)載:http://fisionsoft.com.cn/article/csesjh.html