In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
DNS master-slave synchronization script instance PS: After the two servers are up, it is best to restart both services. The master server configuration #!/ bin/bash#DNS master-slave synchronization--master server rpm -q bindif [ $? -ne 0 ];then yum install bind -y systemctl start namedfi#Determine whether DNS service is installed read -p "Please enter the master server address: " zhurad-p "Please enter the slave server address: " aggread-p "Domain name (please include suffix):" yuquanju="/etc/named.conf"quyu="/etc/named.rfc1912.zones"[ ! -e $quanju.bak ] && cp $quanju $quanju.baksed -i -e "13s/127.0.0.1/$zhu/" -e '21s/localhost/any/' $quanju[ ! -e $quyu.bak ] && cp $quyu $quyu.bak#Backup global, zone profiles grep "$yu" $quyu &> /dev/nullwhile [ $? -ne 0 ];do sed -i "18azone \"$yu\" IN {\n type master\;\n file \"$yu.dns\"\;\n allow- transfer { $cong\; }\;\n}\;\n" $quyu peizhi="/var/named/$yu.dns"cp -p /var/named/named.localhost $peizhidone#Determine whether the domain name exists, if not add sed -i -e '2d' -e "1a@ IN SOA "$yu"\. admin\. "$yu"\. (" /var/named/$yu.dnssed -i '8d' /var/named/$yu.dnssed -i '$d' /var/named/$yu.dnssed -i -e "7a\ NS $yu. " -e "/A/s/127.0.0.1/$zhu/" /var/named/$yu.dns#modify the zone file while [ 1 -ge 0 ];doread -p " Please enter a custom pointer (e.g. www IN A 8.8.8.8)" zhen echo $zhen > /var/named/$yu.dns read -p " Continue adding (y/n)" aif [ $a != "y" ];then breakfidone#loop systemctl stop firewalld.servicesetenforce 0systemctl restart namedjieguo=`systemctl status named| grep "active" &>/dev/null`if [ $? -eq 0 ];then echo "service startup"else echo "startup failure"fi#determine whether the service can start normally sed -i -e '3d' -e "2anameserver $zhu" /etc/resolv.conf#used for self-test slave server configuration #!/ bin/bash#DNS master-slave synchronization--slave server rpm -q bindif [ $? -ne 0 ];then yum install bind -yfi#Determine whether DNS service is installed read -p "Please enter the primary server address: " zhurad-p "Please enter the secondary server address: " aggread-p "Domain name (please include suffix):" yuquanju="/etc/named.conf"quyu="/etc/named.rfc1912.zones"[ ! -e $quanju.bak ] && cp $quanju $quanju.baksed -i -e "13s/127.0.0.1/$cong/" -e '21s/localhost/any/' $quanju[ ! -e $quyu.bak ] && cp $quyu $quyu.bak#Backup global, zone profiles grep "$yu" $quyu &> /dev/nullwhile [ $? -ne 0 ];do sed -i "18azone \"$yu\" IN {\n type slave\;\n file \"slaves\/$yu.dns\"\;\n masters { $zhu\;}\;\n}\;\n" $quyudone#Determine whether the domain name exists, if not add systemctl restart namedsystemctl stop firewalld.servicesetenforce 0jieguo=`systemctl status named| grep "active" &>/dev/null`if [ $? -eq 0 ];then echo "service startup"else echo "startup failure"fi#determine whether the service can start normally
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.