linux环境下快速省时省力数据迁移的方法
首先给服务器添加免密 在老服务器上执行这个命令 ssh-keygen 之后一路回车下去 就ok。 如下所示:
root@logstash01 ~]# 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:
b0:f5:8a:f6:c3:f5:85:cf:9c:f7:55:28:15:ba:4c:60 root@logstash01
The key's randomart image is:
+--[ RSA 2048]----+
| E . |
| . . . . |
| . . o . |
| + . o o . |
| . S . +.. .|
| . .. ... .|
| o... . = ..|
| . .o . = o|
| .. .o|
+-----------------+
[root@logstash01 ~]#
执行 ssh-copy-id 192.168.10.11 192.168.10.11是新站的IP 然后输入yes和输入密码 然后就可以进行数据同步了
nohup `tar -c /home/wwwroot/www.test.com/ |gzip |ssh -c aes128-ctr 192.168.10.11 "gzip -d|tar -xC /" ` &
延伸阅读:
暂无内容!
评论列表 (0条):
加载更多评论 Loading...