配置SSH互信
分享一段配置SSH互信的脚本。
-- all 3 nodes
su - mysql
mkdir -p $HOME/.ssh
chmod 700 $HOME/.ssh
ssh-keygen -t rsa -P '' -f $HOME/.ssh/id_rsa
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
chmod 644 $HOME/.ssh/authorized_keys
【配置SSH互信】--Copy the public key to new slave node in mysql user $HOME directory
--node1
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.82:/home/mysql/.ssh/id_rsa.pub_node1
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.83:/home/mysql/.ssh/id_rsa.pub_node1
--node2
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.81:/home/mysql/.ssh/id_rsa.pub_node2
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.83:/home/mysql/.ssh/id_rsa.pub_node2
--node3
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.81:/home/mysql/.ssh/id_rsa.pub_node3
scp $HOME/.ssh/id_rsa.pub mysql@192.168.56.82:/home/mysql/.ssh/id_rsa.pub_node3
--node1
cat $HOME/.ssh/id_rsa.pub_node2 >> $HOME/.ssh/authorized_keys
cat $HOME/.ssh/id_rsa.pub_node3 >> $HOME/.ssh/authorized_keys
--node2
cat $HOME/.ssh/id_rsa.pub_node1 >> $HOME/.ssh/authorized_keys
cat $HOME/.ssh/id_rsa.pub_node3 >> $HOME/.ssh/authorized_keys
--node3
cat $HOME/.ssh/id_rsa.pub_node1 >> $HOME/.ssh/authorized_keys
cat $HOME/.ssh/id_rsa.pub_node2 >> $HOME/.ssh/authorized_keys
--modify /etc/ssh/ssh_config文件(或$HOME/.ssh/config)in all 3 nodes
su -
vi /etc/ssh/ssh_configStrictHostKeyChecking no
UserKnownHostsFile /dev/nullsystemctl restart sshd.service
--copy something from local to remote.
[mysql@node1 ~]$ scp -r /opt/soft/mysql-cluster-8.0.25-el7-x86_64 node2:/opt/soft
[mysql@node1 ~]$ scp -r /opt/soft/mysql-cluster-8.0.25-el7-x86_64 node3:/opt/soft
推荐阅读
- vue-cli|vue-cli 3.x vue.config.js 配置
- SSH|SSH 免密
- 从战略性的角度可以配置股票
- ssh生成公钥秘钥
- 缓存有关的配置和属性
- Spring|Spring Boot 自动配置的原理、核心注解以及利用自动配置实现了自定义 Starter 组件
- Vagrant|Vagrant (三) - 网络配置
- java|java b2b2c shop 多用户商城系统源码- config 修改配置
- CentOS7 阿里云镜像配置方法
- Python|Win10下 Python开发环境搭建(PyCharm + Anaconda) && 环境变量配置 && 常用工具安装配置