点击上方“IT那活儿”,关注后了解更多内容,不管IT什么活儿,干就完了!!!
192.168.1.1
2. 进入到上传rmp包的目录,进行安装c3工具。
rpm -ivh c3-5.1.2-1.noarch.rpm
"Preparing... ################################# [100%]file /usr/bin from install of c3-5.1.2-1.noarch conflicts with file from package filesystem-3.2-21.el7.x86_64"
cd /usr/localmkdir c3_install && cd c3_installrpm2cpio tmp/c3-5.1.2-1.noarch.rpm |cpio -idvcp usr/local/c3_install/usr/bin/* usr/local/bin/cp usr/local/c3_install/usr/bin/* usr/bin/
3. 添加ip至c3.conf配置文件中,配置c3工具的节点需要添加。
cluster all {10.209.140.65:127.0.0.1 #head nodedead remove-index-00192.168.1.1192.168.1.2192.168.1.3192.168.1.4}cluster data {10.209.140.65:127.0.0.1 #head nodedead remove-index-00192.168.1.3192.168.1.4}
4. 使用cexec all: 'uptime' 验证,验证无问题,则安装成功。
以下为所有主机做互信步骤:
1. 在每个节点创建RSA密钥和公钥,gbase 用户。
cat /home/gbase/host.list |while read user ipdospawn scp gbase@${ip}:/home/gbase/.ssh/id_rsa.pub_${ip} /home/gbase/huxin/expect *assword*send passwd\rinteractdone
cp /home/gbase/.ssh/authorized_keys /home/gbase/.ssh/authorized_keys_bakcat /home/gbase/.ssh/id_res_pub >> /home/gbase/.ssh/authorized_keyscat /home/gbase/huxin/id_res_pub* >> /home/gbase/.ssh/authorized_keys
备份所有公钥后,进行生成rsa。
#!/use/bin/expectcat /home/gbase/host.list |while read user ipdospawn ssh gbase@${ip} ssh-keygen -t rsaexpect *assword*send passwd\rinteractdone
2. 将所有机器的公钥汇总到一个配置文件,例如:
vi scp.sh#!/use/bin/expectcat /home/gbase/host.list |while read user ipdospawn scp gbase@${ip}:/home/gbase/.ssh/id_rsa.pub_${ip} /home/gbase/huxin/expect *assword*send passwd\rinteractdone
在汇总主机上执行:
cp /home/gbase/.ssh/authorized_keys /home/gbase/.ssh/authorized_keys_bakcat /home/gbase/huxin/id_res_pub* >> /home/gbase/.ssh/authorized_keys
3. 分发整合后的公钥文件。
vi scp_push.sh#!/use/bin/expectcat host.list |while read user ipdospawn scp /home/gbase/.ssh/authorized_keys gbase@${ip}:/home/gbase/.ssh/expect *assword*send passwd\rinteractdone
4. 使用cexec all: 'uptime' 验证,验证无问题,则互信已成功配置。

本文作者:张开旭
本文来源:IT那活儿(上海新炬王翦团队)

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




