Linux系统集群架构在线项目配置实践(一)1.配置SSH免密码登录分发服务器使用全网备份服务器首先创建分发用户[root@centos~]#useraddfenfa-u999[root@centos~]#echo"123456"|passwd--stdinfenfaChangingpasswordforuserfenfa.passwd:allauthenticationtokensupdatedsuccessful.[root@centos~]#/bin/cp/etc/sudoers/etc/sudoers.bak[root@centos~]#echo"fenfaALL=(root)NOPASSWD:/usr/bin/rsync">>/etc/sudoers[root@centos~]#tail-1/etc/sudoersfenfaALL=(root)NOPASSWD:/usr/bin/rsync切换到fenfa用户创建key2.配置expect批量分发工具安装配置expect服务[root@centos~]$yuminstallexpect*-y编写脚本并执行脚本结果是如下[fenfa@centos~]$shfenfa_key.sh10.0.0.1[OK]10.0.0.2[OK]10.0.0.3[OK]10.0.0.4[OK]10.0.0.5[OK]10.0.0.6[OK]10.0.0.7[OK]10.0.0.0OK[OK]10.0.0.10[OK]10.0.0.11[OK]10.0.0.12[OK]10.0.0.13[OK]10.0.0.14[OK]切换到分发用户查看是否分发成功[root@centos~]#su-fenfa[fenfa@centos~]$ll/home/fenfa/.ssh/total4-rw------1fenfafenfa602Sep2112:14authorized_keys是根据上面的脚本编写的,分为hosts文件脚本脚本执行结果如下shfenfa_file.shhost.list/etc/[fenfa@centos~]$ll/etc/host.list-rw-rw-r--1fenfafenfa131Sep1612:45/etc/host.list只需要将host.list文件替换成你需要分发的文件就OK了。3.前端反向代理及管理后台服务器配置前端nginx反向代理服务器配置及安装所需的依赖包[root@centos~]#yuminstallpcre-develzlib-devleopenssl-develgcc-c++–ycompile并安装nginxcd/download/tools/wgethttp://nginx.org/download/nginx-1.12.1.tar.gztarzxfnginx-1.12.1.tar.gzcdnginx-1.12.1./configure--prefix=/app/nginx-1.12.1make&&makeinstall[root@centos~]#cd/app/[root@centosapp]#ln-snginx-1.12.1nginx[root@centos~]#cd/app/nginx/conf/[root@centosconf]#mkdirextra[root@centosconf\#cpnginx.confnginx.conf.bak在nginx.conf文件后添加如下配置includeextra/*.conf;[root@centos~]#cd/app/nginx/conf/extra/[root@centosextra]#vimadmin.mingongge.conf##HTTPS服务器配置#server{listen80;server\_nameadmin.mingongge.com;位置/{代理\_passhttp://10.0.0.6:8080;代理\_connect\_timeout600;代理\_read\_timeout600;代理\_发送\_超时600;}}[root@centosextra]#vimshangjia.mingongge.conf##HTTPS服务器配置#server{listen80;服务器\_nameshangjia.mingongge.com;location/{代理\_passhttp://10.0.0.7:8080;代理\_connect\_timeout600;代理\_read\_timeout600;代理\_发送\_超时600;}}业务平台管理后台admin.mingongge.comJDKTomcat环境安装tarzxfapache-tomcat-8.5.9.tar.gzmvapache-tomcat-8.5.9/usr/local/tomcattarzxfjdk-8u111-linux-x64.tar.gz-C/usr/local/cd/usr/local/ln-sjdk1.8.0_111jdkcat>>/etc/profile<
