Linux系統叢集架構線上項目配置實戰教程(一),linux實戰

來源:互聯網
上載者:User

Linux系統叢集架構線上項目配置實戰教程(一),linux實戰

項目整體介紹

整個項目包括以下幾個應用工程

1、 使用者APP

2、 商家APP

3、 業務平台管理後台

4、 商家業務管理後台

5、 官網

整體專案規劃設計如下

1、 使用者APP採用JAVA環境布署,初始環境兩台伺服器,實現負載平衡與高可用,前端負載使用nginx 做負載

2、 商家APP採用JAVA環境布署,初始環境兩台伺服器,實現負載平衡與高可用,前端負載使用nginx 做負載

3、 業務平台管理後台採用JAVA環境布署,初始環境一台伺服器,前端使用nginx 反向 Proxy,後續業務流量擴大,架構重新擴充

4、 商家平台管理後台採用JAVA環境布署,初始環境一台伺服器,前端使用nginx 反向 Proxy,後續業務流量擴大,架構重新擴充

5、 官方網站都是一些靜態頁面,採用nginx布署,WEB服務另安裝FTP伺服器,做為業務管理後台一些靜態資源的上傳

6、 資料庫使用Mysql主從複製架構,程式上實現讀寫分享,從庫開啟binlog做備份使用

7、 全網所有備份資料全部同步到專業內網備份伺服器,所有業務備份資料保留30天

8、 全網所有伺服器監控(基本監控與服務監控)都採用zabbix監控

伺服器IP地址規劃如下

伺服器環境與應用軟體版本介紹

伺服器環境

[root@centos ~]# cat /etc/redhat-releaseCentOS release 6.8 (Final)[root@centos ~]# uname -r2.6.32-642.el6.x86_64

應用軟體版本

Nginx 1.12.1

Mysql 5.7.17

Jdk 1.8

Tomcat 8.5.9

Zabbix 3.0

Yum 源使用163、阿里去、sohu國內的源都可以,自行選擇

Redis 4.0.1

伺服器邏輯架構圖

配置國內YUM源,以163為例

[root@centos ~]# cd /etc/yum.repos.d/[root@centos yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo[root@centos yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak[root@centos yum.repos.d]# mv CentOS6-Base-163.repo CentOS-Base.repo

安裝需要的軟體包

[root@centos ~]# yum install lsof vim telnet dos2unix lrzsz tree –y

關閉不需要啟動的服務

[root@centos ~]#for service in chkconfig --list|grep 3:on|awk '{print $1}';do chkconfig —level 3 $service off;done[root@centos ~]#for service in crond network sshd rsyslog;do chkconfig —level 3 $service on;done[root@centos ~]# chkconfig —list|grep 3:on

修改SSH服務的預設配置

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.baksed -i ‘s%#Port 22%Port 2233%g’ /etc/ssh/sshd_configsed -i ‘s%#PermitRootLogin yes%PermitRootLogin no%g’ /etc/ssh/sshd_configsed -i ‘s%#PermitEmptyPasswors no%PermitEmptyPasswors no%g’ /etc/ssh/sshd_configsed -i ‘s%#UseDNS yes%UseDNS no%g’ /etc/ssh/sshd_configegrep “UseDNS|2233|RootLogin|EmptyPass” /etc/ssh/sshd_config/etc/init.d/sshd reload

關閉selinux

設定檔/etc/selinux/config

sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g’ /etc/selinux/configegrep “SELINUX=” /etc/selinux/config

關閉防火牆

如果不是對外網的伺服器,直接關閉防火牆,有外網地址的可建議開啟,並允許相關的服務連接埠,並發高的伺服器也不需要開啟防火牆,可能會影響效能

/etc/invited/pintables stop/etc/invited/pintables statuspintables: Firewall is not running.

鎖定系統關鍵檔案

for file in /etc/passed /etc/shadow /etc/services /etc/initial /etc/rc.localdochattr +i $filedone

配置全網伺服器時間同步

/usr/sbin/ntpdate time.windows.comcat>>/var/spool/cron/root<#this cron is for ntpdate/5 * /usr/sbin/ntpdate time.windows.com >/dev/null 2>&1#cron config endEOF

配置全網伺服器hosts檔案

Cat>>/etc/hosts<10.0.0.1 nginx-lb10.0.0.2 nginx-proxy10.0.0.3 nginx10.0.0.4 userapp10.0.0.5 sjapp10.0.0.6 admin10.0.0.7 shangjia10.0.0.8 web10.0.0.9 mysql-m10.0.0.10 mysql-s10.0.0.11 ftp-backup10.0.0.12 redis10.0.0.13 backup-server10.0.0.14 zabbixEOF

規範所有伺服器目錄(實際生產環境很重要)

[root@centos ~]# mkdir /download/tools/ -p[root@centos ~]# mkdir /app/logs -p[root@centos ~]# mkdir /app -p[root@centos ~]# mkdir /server/{scripts,backup} –p

至此基本的伺服器最佳化配置也就結束了,接下來就是安裝各類服務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.