Shell Script--03 Instance

Source: Internet
Author: User

1. Architecture 2. Front 2.1 Free Questions

The public key confirmation prompt pops up when the server is first connected. Causes an automated task to be interrupted due to the initial connection to the server.

The stricthostkeychecking configuration of the SSH client enables the new public key to be automatically received when the server is first connected.

    

vi /etc/ssh/~]#  ssh ip-ouserknownhostsfile=/dev/null - Ostricthostkeychecking=no

3. Script 3.1Server 3.2Master 3.3Agent

Modify the Master,agent property IP in Agent.json

Suppose you want to add

Master 1.1.1.1 instead of 1.1.1.2

Agent 1.1.1.11 Change to 1.1.1.12

#!/bin/Bash
Dos2unix Agent.jsonmaster=1.1.1.1Agent=1.1.1.11 forIpinch$(CatAgent.json |grepIP |sed 's/://g'|awk '{print$2}'|sed 's/"//g'|sed 's/,//g'); Do    if[${ip} = =${master}] Then     EchoChange Mastersed-I."s/${ip}/$1/g"Agent.jsonelif[${ip} = =${agent}] Then          EchoChange agentsed-I."s/${ip}/$2/g"Agent.jsonfi Done
$./ip.sh 1.1.1.2 1.1.1.12

4. Other

Shell Script--03 Instance

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.