简体   繁体   English

同步两个Azure VM时要排除哪些文件?

[英]What are the files to exclude for syncing two azure vm?

I tried to sync between two azure instances (same os distros) using Rsync; 我试图使用Rsync在两个Azure实例(相同的OS发行版)之间进行同步; but after that, the target VM ssh connection not working, I think I missed some files to exclude.Any help ? 但是之后,目标VM ssh连接无法正常工作,我想我错过了一些要排除的文件。

NOTE: The procedure was a success on other platforms, may be in my script I missed azure VM specific exclude files? 注意:该过程在其他平台上是成功的,可能是在我的脚本中我错过了Azure虚拟机特定的排除文件?

Steps to reproduce issue: 重现问题的步骤:

  • Create two VMs with same os distros ( ubuntu 16.04 ) 使用相同的操作系统发行版创建两个VM(ubuntu 16.04)
  • run rsync command on source machine to sync files between ( use / excluding directories like /boot /etc/fstab /etc/hostname /etc/issue /etc/hosts etc. 在源计算机上运行rsync命令以在文件之间进行同步(使用/排除/ boot / etc / fstab / etc / hostname / etc / issue / etc / hosts等目录。

rsync -e "ssh -i keyfile" -rlpEAXogDtSzh -P -x --exclude-from="$excludefilelist" --rsync-path="sudo rsync" --verbose --progress username@$TARGETVM_IP:/

After syncing target vm seems to not running, note that am here used same ssh key files between those machines, username & group. 同步目标虚拟机似乎未运行后,请注意,此处在这些计算机,用户名和组之间使用了相同的ssh密钥文件。

my question here is is there any Azure specific file i missed ? 我的问题是,我是否缺少任何Azure特定文件?

There are two packages installed on the Azure Ubuntu VM that may change the settings of the VM: 在Azure Ubuntu VM上安装了两个软件包,它们可能会更改VM的设置:

  • Azure Linux Agent Azure Linux代理
  • Cloud-Init 云初始化

Running the command dpkg -L PakageName will give a list of files installed by the package. 运行命令dpkg -L PakageName将给出软件包安装的文件列表。 You may try to exclude all of these files. 您可以尝试排除所有这些文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM