<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                環境: 服務器操作系統:centos7.3 * haproxy: 外網IP: 10.2.13.220/24 內網IP:192.168.20.131/24 * WEB server: node7.51yuki.cn: 外網IP:10.2.13.219/24 內網IP:192.168.20.132/24 node8.51yuki.cn: 外網IP:10.2.13.217/24 內網IP:192.168.20.133/24 * Database Server master_mysql.51yuki.cn: 內網IP:192.168.20.135/24 第一步:分別在node7.51yuki.cn和node8.51yuki.cn的機器上安裝nginx和php 版本: nginx: nginx-1.12.2 php: php-5.6.33 安裝腳本: https://gitee.com/louis1986/shell_scripts/blob/master/Software_Install/install_lnmp_centos7.sh 把nginx和php-fpm添加到開機自動啟動 [root@node8 ~]# chkconfig --add php-fpm [root@node8 ~]# echo “/usr/local/nginx-1.12.2/sbin/nginx ">>/etc/rc.local 第二步:在master_mysql.51yuki.cn機器上安裝mysql服務 版本:mysql-5.6.38(安裝mysql二進制包) 查看博客地址 http://www.cnblogs.com/51yuki/p/mysql01.html 第三步:登錄mysql,創建數據庫 mysql> create database discuz; Query OK, 1 row affected (0.01 sec) mysql> grant all on discuz.* to discuz@'192.168.20.%' identified by 'discuz&0611'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) 第四步:在2臺web服務器上安裝discuz(以node8.51yuki.cn為例) 1)網站目錄 [root@node7 ~]# mkdir -p /opt/web/discuz 下載軟件,然后解壓,把upload目錄里的所有文件拷貝到/opt/web/discuz [root@node8 ~]# cd /usr/local/src/ [root@node8 src]# wget http://download.comsenz.com/DiscuzX/3.1/Discuz_X3.1_SC_UTF8.zip [root@node8 src]# unzip Discuz_X3.1_SC_UTF8.zip [root@node8 src]# cp -r upload/* /opt/web/discuz/ 2)配置虛擬主機 [root@node8 discuz]# cd /usr/local/nginx-1.12.2/conf/ [root@node8 conf]# mkdir conf.d [root@node8 conf.d]# vim ../nginx.conf 增加如下 include conf.d/*.conf; 配置虛擬主機 [root@node8 conf.d]# vim discuz.conf server { listen 8080; server_name localhost; location / { root /opt/web/discuz; index index.php index.html index.htm; } location ~ \.php$ { root /opt/web/discuz; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 3)改變文件及目錄權限 [root@node8 discuz]# chmod -R 777 ./config/ ./data/ ./uc_client/ ./uc_server/ 4)安裝 http://10.2.13.217:8080/install/ 最后,更改兩臺服務器的監聽地址,讓其監聽內網的ip地址 listen 192.168.20.133:8080; [root@node8 conf.d]# /usr/local/nginx-1.12.2/sbin/nginx -s stop [root@node8 conf.d]# /usr/local/nginx-1.12.2/sbin/nginx [root@node8 conf.d]# ss -tunlp|grep 8080 tcp LISTEN 0 128 192.168.20.133:8080 *:* users:(("nginx",pid=1339,fd=7),("nginx",pid=1338,fd=7)) 最后node7.51yuki.cn機器上操作方式類似 第五步:配置haproxy 1)先安裝haproxy [root@proxy01 ~]# yum -y install haproxy 2)配置haproxy.cfg ~~~ [root@proxy01 haproxy]# cat haproxy.cfg #--------------------------------------------------------------------- # Example configuration for a possible web application. See the # full configuration options online. # # http://haproxy.1wt.eu/download/1.4/doc/configuration.txt # #--------------------------------------------------------------------- #--------------------------------------------------------------------- # Global settings #--------------------------------------------------------------------- global # to have these messages end up in /var/log/haproxy.log you will # need to: # # 1) configure syslog to accept network log events. This is done # by adding the '-r' option to the SYSLOGD_OPTIONS in # /etc/sysconfig/syslog # # 2) configure local2 events to go to the /var/log/haproxy.log # file. A line like the following can be added to # /etc/sysconfig/syslog # # local2.* /var/log/haproxy.log # log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon # turn on stats unix socket stats socket /var/lib/haproxy/stats #--------------------------------------------------------------------- # common defaults that all the 'listen' and 'backend' sections will # use if not designated in their block #--------------------------------------------------------------------- defaults mode http log global option httplog option dontlognull option http-server-close option forwardfor except 127.0.0.0/8 option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout http-keep-alive 10s timeout check 10s maxconn 3000 #--------------------------------------------------------------------- # main frontend which proxys to the backends #--------------------------------------------------------------------- frontend main 10.2.13.220:80 #acl url_static path_beg -i /static /images /javascript /stylesheets #acl url_static path_end -i .jpg .gif .png .css .js #use_backend static if url_static default_backend websrvs #--------------------------------------------------------------------- # static backend for serving up images, stylesheets and such #--------------------------------------------------------------------- #backend static # balance roundrobin # server static 127.0.0.1:4331 check #--------------------------------------------------------------------- # round robin balancing between the various backends #--------------------------------------------------------------------- backend websrvs balance roundrobin server node7.51yuki.cn 192.168.20.132:8080 check server node8:51yuki.cn 192.168.20.133:8080 check ~~~ 最后測試: ![](https://box.kancloud.cn/d550504f3e28e9f1affeb5b50d3b9f8a_1321x630.png) 第六步:模擬node7.51yuki.cn機器故障
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看