自己做的網(wǎng)站如何上首頁旅行社網(wǎng)站模版
鶴壁市浩天電氣有限公司
2026/01/24 08:44:32
自己做的網(wǎng)站如何上首頁,旅行社網(wǎng)站模版,模板wordpress,網(wǎng)頁游戲傳奇霸業(yè)文章目錄實驗環(huán)境安裝ansible部署nfs網(wǎng)絡(luò)文件系統(tǒng)1、創(chuàng)建系統(tǒng)用戶和組2、在nfs上創(chuàng)建共享目錄3、編輯nfs配置文件4、開啟nfs服務(wù)5、進行掛載實驗環(huán)境
主機IP【配置靜態(tài)IP地址】主機名字#xff08;身份#xff09;10.0.0.61m01#xff08;管理節(jié)點#xff09;10.0.0.31nfs…文章目錄實驗環(huán)境安裝ansible部署nfs網(wǎng)絡(luò)文件系統(tǒng)1、創(chuàng)建系統(tǒng)用戶和組2、在nfs上創(chuàng)建共享目錄3、編輯nfs配置文件4、開啟nfs服務(wù)5、進行掛載實驗環(huán)境主機IP【配置靜態(tài)IP地址】主機名字身份10.0.0.61m01管理節(jié)點10.0.0.31nfs網(wǎng)絡(luò)文件系統(tǒng)安裝ansible安裝ansible只需要在主控節(jié)點進行安裝ansible服務(wù)配置ssh公私鑰#使用yum安裝ansible和依賴開發(fā)軟件包前提需要配置好阿里云的yum和epel源[rootm01 yum.repos.d]# lsCentOS-Base.repo epel.repo nginx.repo[rootm01 yum.repos.d]# yum repolistLoaded plugins: fastestmirror, langpacks Determining fastest mirrors repoidrepo name status!base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com10,072!epel/x86_64 Extra PackagesforEnterprise Linux7- x86_6413,791!extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com526!nginx-stable/7/x86_64 nginx stable repo364!updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com6,173repolist:30,926#安裝ansible和依賴yum -yinstallansible libselinux-python#配置主機文件這里我同步配置了/etc/hosts文件做了主機名和主機ip映射這樣在配置ansible主機文件的時候可以使用主機名字沒有的話就直接配置主機IP地址#注意ansible都是使用ssh進行登入的需要保障管理節(jié)點和被管理的節(jié)點可以ssh登入[rootm01 ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain610.0.0.5 lb0110.0.0.6 lb0210.0.0.7 web0110.0.0.8 web0210.0.0.9 web0310.0.0.31 nfs10.0.0.41 backup10.0.0.51 db0110.0.0.61 m0110.0.0.71 zabbix#測試主機映射是否成功[rootm01 ~]# ping nfsPING nfs(10.0.0.31)56(84)bytes of data.64bytes from nfs(10.0.0.31):icmp_seq1ttl64time0.179ms64bytes from nfs(10.0.0.31):icmp_seq2ttl64time0.231ms64bytes from nfs(10.0.0.31):icmp_seq3ttl64time0.504ms ^C --- nfspingstatistics ---3packets transmitted,3received,0% packet loss,time2000ms rtt min/avg/max/mdev0.179/0.304/0.504/0.143 ms#配置ansible的主機文件[rootm01 ~]# tail -2 /etc/ansible/hosts[test]nfs 在test組里面有主機nfs#配置ssh的公私鑰#生成公私秘鑰-t 加密類型 -C描述信息[rootm01 ~]# ssh-keygen -t rsa -C A-Server.comGenerating public/private rsa key pair. Enterfileinwhichto save the key(/root/.ssh/id_rsa): Created directory/root/.ssh.Enter passphrase(emptyforno passphrase): Enter same passphrase again: Your identification has been savedin/root/.ssh/id_rsa. Your public key has been savedin/root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:xO2DoVA16c29mx39r1hbG90M4dEPXJszdW8tBWB/Fo A-Server.com The keys randomart image is: ---[RSA 2048]---- | ..o. . o*B| | . ..o .*B| | . . . .* | | . o. .E | | . Soo .o. | | . .oo| | . . *| | o.. B| | . oo. *| ----[SHA256]----- #分發(fā)公鑰到被管理節(jié)點輸入被管理節(jié)點的root密碼 [rootm01 ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub root10.0.0.31 /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: /root/.ssh/id_rsa.pub /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root10.0.0.31s password: Number of key(s)added:1Now try logging into the machine, with:ssh root10.0.0.31and check tomakesure that only the key(s)you wanted were added.#檢查管理節(jié)點的公私鑰信息[rootm01 ~]# cd /etc/ssh/[rootm01 ssh]# lsmoduli ssh_host_ecdsa_key ssh_host_ed25519_key.pub ssh_config ssh_host_ecdsa_key.pub ssh_host_rsa_key sshd_config ssh_host_ed25519_key ssh_host_rsa_key.pub部署nfs網(wǎng)絡(luò)文件系統(tǒng)1、創(chuàng)建系統(tǒng)用戶和組[rootm01~]# ansible nfs -m group -a namewww gid666 statepresentnfs|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,gid:666,name:www,state:present,system:false}[rootm01~]# ansible nfs -m user -a namewww uid666 group666 create_homeno shell/sbin/nologin statepresentnfs|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,comment:,create_home:false,group:666,home:/home/www,name:www,shell:/sbin/nologin,state:present,system:false,uid:666}2、在nfs上創(chuàng)建共享目錄[rootm01~]# ansible nfs -m file -a path/data statedirectory owner666 group666 recurseyesnfs|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,gid:666,group:www,mode:0755,owner:www,path:/data,size:6,state:directory,uid:666}3、編輯nfs配置文件[rootm01~]# ansible nfs -m copy -a dest/etc/exports content/data 10.0.0.0/24(rw,all_squash,anonuid666,anongid666) mode600nfs|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,checksum:9595deab6719ad80dcef8a71f50a317dbfba5235,dest:/etc/exports,gid:0,group:root,md5sum:7c78689c50af25261f54f251b34c7e26,mode:0600,owner:root,size:56,src:/root/.ansible/tmp/ansible-tmp-1699072334.11-1365-90513311577736/source,state:file,uid:0}4、開啟nfs服務(wù)[rootm01~]# ansible nfs -m systemd -a namenfs statestarted enabledyesnfs|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,enabled:true,5、進行掛載[rootm01~]# ansible web -m mount -a src10.0.0.31:/data path/web fstypenfs optsdefaults statemountedweb01|SUCCESS{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:false,dump:0,fstab:/etc/fstab,fstype:nfs,name:/web,opts:defaults,passno:0,src:10.0.0.31:/data}web03|CHANGED{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:true,dump:0,fstab:/etc/fstab,fstype:nfs,name:/web,opts:defaults,passno:0,src:10.0.0.31:/data}web02|SUCCESS{ansible_facts:{discovered_interpreter_python:/usr/bin/python},changed:false,dump:0,fstab:/etc/fstab,fstype:nfs,name:/web,opts:defaults,passno:0,src:10.0.0.31:/data}