视频学习记录day13

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了视频学习记录day13相关的知识,希望对你有一定的参考价值。

LANP环境工作原理:

 老男孩以这个为准
1、安装mysql
mkdir -p /home/oldboy/tools
cd /home/oldboy/tools
tar -xf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.5.56-linux-glibc2.5-x86_64 /application/mysql-5.5.56
ln -s /application/mysql-5.5.56 /application/mysql
#################相当于make install完成###########################

2、创建用户:
useradd -s /sbin/nologin mysql -M
id mysql
chown -R mysql.mysql /application/mysql
ll -d /application/mysql
mkdir -p /application/mysql/data

3、初始化数据库:
cd /application/mysql
/application/mysql/scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
sed -i ‘s#/usr/local/#/application/#g‘ /application/mysql/bin/mysqld_safe
\cp support-files/my-small.cnf  /etc/my.cnf                                        #给配置文件
/application/mysql/bin/mysqld_safe --user=mysql &
PATH="/application/mysql/bin/:$PATH"
which mysql
sed -i ‘s#/usr/local/#/application/#g‘ support-files/mysql.server
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld stop
lsof -i :3306
/etc/init.d/mysqld start
lsof -i :3306
chkconfig --add mysqld
mysql


故障分析:
[[email protected] mysql]# ll -d /tmp               #要求/tmp目录必须是1777权限
drwxrwxrwt. 3 root root 4096 2017-05-30 13:36 /tmp
[[email protected] mysql]# cat /etc/hosts           #要求hosts必须有本机域名解析
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5   lb01
172.16.1.6   lb02
172.16.1.7   web02
172.16.1.8   web01
172.16.1.51  db01 db01.etiantian.org
172.16.1.31  nfs01
172.16.1.41  backup
172.16.1.61  m01
################################2017年5月20日 17:05:52##############
http://oldboy.blog.51cto.com/2561410/1122867

设置密码:
mysqladmin -u root password ‘oldboy123‘

登录mysql:
mysql -u root -p oldboy123

再次修改密码:
mysqladmin -uroot -poldboy123 password 123456

再次登录: (默认root用户登录)
mysql -p123456

这样有把柄history  最好 history -c  青空一下历史记录


2017年5月30日 22:12:34-
netstat -lntup |egrep "3306|80"          检查nginx和mysql的启动情况
安装php的前提是nginx和mysql已经安装启动完成
libiconv-devel  由于该包不能yum安装上去 所以得手动下载编译安装!

安装PHP基础库:
yum -y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
yum -y install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
mkdir -p /home/oldboy/tools
cd /home/oldboy/tools
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install
cd ../
安装PHP的相关扩展库:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo #已放入基础优化一键代码
yum -y install libmcrypt-devel mhash mcrypt
rpm -qa libmcrypt-devel mhash mcrypt

解压配置PHP:
rz上传php-5.5.32.tar.gz 到 /home/oldboy/tools  
然后tar zxf php-5.5.32.tar.gz  &  cd /home/oldboy/tools/php-5.5.32

然后配置php:
(斜线后不能有空格  最后一个不能有斜线)

./configure \
--prefix=/application/php5.5.32 \
--with-mysql=/application/mysql/ \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-fpm \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-ftp \
--enable-opcache=no

疑问:-bash: --prefix=/application/php5.5.32: 没有那个文件或目录   出现了这个但是不影响后续的操作
/usr/local/lib/php/ 居然被安装到默认路径了        
解答:因为./configure 和后面的必须连接起来  后面必须跟一个 \ 连接符号!
老男孩老师指导-规避相关错误:
ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/   #防止提示找不到共享库
touch ext/phar/phar.phar         #php5.3的bug
make
make install
ln -s /application/php5.5.32/ /application/php


配置php解析文件:
cp php.ini-production /application/php/lib/php.ini
配置php-fpm配置文件:
cd /application/php/etc/
cp php-fpm.conf.default php-fpm.conf
启动php-fpm:
/application/php/sbin/php-fpm
lsof -i :9000
ps -ef |grep php-fpm

2017年5月31日 21:52:24-
整合nginx+php:
        location ~ .*\.(php|php5)?$ {
            root   html/blog;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
        }
测试验证到nginx是否通畅:
cd /application/nginx/html/blog
echo "<?php phpinfo(); ?>" >test.info.php
出来结果成功,哈哈哈哈哈哈!

测试php连接mysql:
[[email protected] blog]# vim test.mysql.php

<?php
        $link_id=mysql_connect(‘localhost‘,‘root‘,‘123456‘) or mysql_error();
        if($link_id){
                echo "mysql successful by 20has !";
        }else {
                echo mysql_error();
        }

?>
 
mysqladmin -uroot -p123456 password oldboy123  后续统一mysqladmin密码为oldboy123

在web01上搭建wordpress个人用户博客
1、创建用户:
PATH="/application/mysql/bin/:$PATH"
mysql -uroot -poldboy123
mysql> show databases;                            #查看数据库
mysql> drop database test;                        #删除指定数据库
mysql> system whoami                              #查看当前目录
mysql> select user,host from mysql.user;          #查看所有用户
mysql> create database wordpress;                 #创建wordpress数据库
mysql> grant all on wordpress.* to [email protected]‘localhost‘ identified by ‘123456‘;
                                                  #授权grant wordpress用户管理wordpress表的所有内容
mysql> show grants for [email protected]‘localhost‘;     #查看wordpress用户授权范围
mysql> flush privileges;                          #刷新数据库,让权限生效


2、调整nginx配置并重启服务:
[[email protected] extra]# vim blog.conf

    server {
        listen       80;
        server_name  blog.etiantian.org;
        location / {
            root   html/blog;
            index index.php index.html index.htm;
        }
        location ~ .*\.(php|php5)?$ {
            root   html/blog;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
        }
        }
[[email protected] ~]# /application/nginx/sbin/nginx -t
[[email protected] ~]# /application/nginx/sbin/nginx -s reload

3、下载博客 安装  rz上传到web01服务器:
tar xf wordpress-4.7.4-zh_CN.tar.gz
cp -a wordpress/* /application/nginx/html/blog/
chown -R www.www /application/nginx/html/blog/      #先给个大权限 待优化
4、做hosts解析,浏览器安装博客:




2017年6月1日 20:11:12-
1、将LNMP服务中的数据库独立分离到服务器2:
web01备份数据库并导出:
mysqldump -uroot -poldboy123 wordpress -B |gzip>bak.sql.gz
scp bak.sql.gz [email protected]:/tmp

db01导入并检测:
mysqladmin -uroot password oldboy123
mysql -uroot -poldboy123 </tmp/bak.sql
mysql -uroot -poldboy123 -e "show databases like ‘wordpress‘;"
mysql -uroot -poldboy123 -e "use wordpress;show tables;"

db01数据库授权(设置管理员):
mysql -uroot -poldboy123 -e "grant all on wordpress.* to [email protected]‘172.16.1.%‘ identified by ‘123456‘;"

web01关闭本地数据库:
/etc/init.d/mysqld stop
chkconfig mysqld off
chkconfig --list|grep mysqld

web01更改配置wp-config.php文件:
[[email protected] blog]#vim /application/nginx/html/blog/wp-config.php

/** WordPress数据库的名称 */
define(‘DB_NAME‘, ‘wordpress‘);

/** MySQL数据库用户名 */
define(‘DB_USER‘, ‘wordpress‘);

/** MySQL数据库密码 */
define(‘DB_PASSWORD‘, ‘123456‘);

/** MySQL主机 */
define(‘DB_HOST‘, ‘172.16.1.51‘);
结果很明显是成功的!

2、将blog的资源文件迁移到NFS:
nfs服务器上设置:
[[email protected] ~]# vim /etc/exports
/data 172.16.1.0/24(rw,sync,all_squash,anonuid=891,anongid=891)

/etc/init.d/nfs reload
/etc/init.d/rpcbind status
showmount -e 172.16.1.31

资源目录:/application/nginx/html/blog/wp-content/uploads
[[email protected] ~]# useradd -u 891 www        #保证和nfs同样的用户uid和gid
[[email protected] uploads]# mv /application/nginx/html/blog/wp-content/uploads/* /tmp/
[[email protected] uploads]# mount -t nfs 172.16.1.31:/data/nfs-blog /application/nginx/html/blog/wp-content/uploads/
[[email protected] ~]# df -h
[[email protected] ~]# mv /tmp/2017 /application/nginx/html/blog/wp-content/uploads

Web集群第11章 关于期中架构搭建!

wordpress伪静态的实现:
[[email protected] ~]# cd /application/nginx/conf/extra/
[[email protected] extra]# vim blog.conf
    server {
        listen       80;
        server_name  blog.etiantian.org;
        location / {
            root   html/blog;
            index index.php index.html index.htm;
            try_files $uri $uri/ /index.php?q=$uri&$args;
        }

或者  (抵过上述这堆)
[[email protected] extra]# /application/nginx/sbin/nginx  -s reload
LANP的搭建:
nginx 1.6.3 +php5.5.32 +mysql5.5.56

apache2.2.32 +php5.3.27 +mysql5.5.56

安装apache:
yum install gcc gcc-c++ ncurses-devel perl         #解决编译问题
yum -y install lrzsz nmap tree dos2unix nc          #上传软件等
yum -y install zlib zlib-devel
tar -xf httpd-2.2.32.tar.gz
cd /home/oldboy/tools/httpd-2.2.32
mkdir -p /application/apach2.2.31
./configure \
--prefix=/application/apache2.2.31 \
--enable-deflate \
--enable-expires \
--enable-headers \
--enable-modules=most \
--enable-so \
--with-mpm=worker \
--enable-rewrite
make
make install
ln -s /application/apache2.2.31/ /application/apache
ll /application/apache


基于域名的apache虚拟主机配置:
cd /application/apache/htdocs/
mkdir bbs blog www
vim /application/apache/conf/httpd.conf
405行      Include conf/extra/httpd-vhosts.conf   #去掉注释,使该行生效
98行       ServerName 127.0.0.1:80
145行      Options -Indexes FollowSymLinks        #加 - 号 表示不让列出目录

vim /application/apache/conf/extra/httpd-vhosts.conf
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/application/apache2.2.31/htdocs/www"
    ServerName www.etiantian.org
    ServerAlias etiantian.org
    ErrorLog "logs/www-error_log"
    CustomLog "logs/www-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/application/apache2.2.31/htdocs/blog"
    ServerName blog.etiantian.org
    ErrorLog "logs/blog-error_log"
    CustomLog "logs/blog-access_log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/application/apache2.2.31/htdocs/bbs"
    ServerName bbs.etiantian.org
    ErrorLog "logs/bbs-error_log"
    CustomLog "logs/bbs-access_log" common
</VirtualHost>

/application/apache/bin/apachectl -t              #检查语法
/application/apache/bin/apachectl start           #启动apache
/application/apache/bin/apachectl graceful        #优雅重启 相当于nginx -s reload

echo "apache www" > www/index.html                #添加首页文件    
echo "apache bbs" > bbs/index.html
echo "apache blog" > blog/index.html

测试:
[[email protected] ~]# grep www.etiantian.org /etc/hosts
172.16.1.7   web02 www.etiantian.org etiantian.org blog.etiantian.org bbs.etiantian.org
[[email protected] ~]# curl www.etiantian.org
apache www
[[email protected] ~]# curl bbs.etiantian.org
apache bbs
[[email protected] ~]# curl blog.etiantian.org
apache blog

2017年6月2日 22:59:56-
安装PHP基础库:
yum -y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
yum -y install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
mkdir -p /home/oldboy/tools
cd /home/oldboy/tools
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar zxf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/libiconv
make
make install
cd ../
安装PHP的相关扩展库:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo   #已放入基础优化一键代码
yum -y install libmcrypt-devel mhash mcrypt openssl-devel libxslt               #之前nginx已经安装openssl 所以不报错
rpm -qa libmcrypt-devel mhash mcrypt
安装php-5.3.27:
cd和rz上传php安装包 到 /home/oldboy/tools
tar -xf php-5.3.27.tar.gz
cd php-5.3.27
./configure \
--prefix=/application/php5.3.27 \
--with-apxs2=/application/apache/bin/apxs \
--with-mysql=mysqlnd \                                       #使用此参数本地可以没有Mysql软件包
--with-pdo-mysql=mysqlnd \
--with-iconv-dir=/usr/local/libiconv \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--enable-ftp
make
make install
cd ../
ln -s /application/php5.3.27/ /application/php
ls /application/php

配置httpd和php的整合:

[[email protected] tools]# vim  /application/apache/conf/httpd.conf      #增加修改如下几行
320行      ADDType application/x-httpd-php .php .phtml
321行      ADDType application/x-httpd-php-source .phps
168行      DirectoryIndex index.php index.html
67行        User www
68行        Group www
useradd -u 891  -s /sbin/nologin www
id www
/application/apache/bin/apachectl -t
/application/apache/bin/apachectl graceful


检查php:
cd /application/apache/htdocs/blog
[[email protected] blog]# cat phpinfo.php
<?php
phpinfo();
?>

检查MySQL:
cd /application/apache/htdocs/blog
[[email protected] blog]# vim test_mysql.php

<?php
        $link_id=mysql_connect(‘db01.etiantian.org‘,‘wordpress‘,‘123456‘) or mysql_error();
        if($link_id){
                echo "mysql successful by 20has !";
        }else {
                echo mysql_error();
        }

?>
[[email protected] blog]# cat /etc/hosts
127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
::1          localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5   lb01
172.16.1.6   lb02
172.16.1.7   web02
172.16.1.8   web01
172.16.1.31  nfs01
172.16.1.41  backup
172.16.1.51  db01 db01.etiantian.org
172.16.1.61  m01
原因又是出现在了mac,MAC,克隆的机器变成了同样的mac,导致局域网机器互通有问题 eth1的问题
>/etc/udev/rules.d/70-persistent-net.rules  清除原有网卡记录

2017年6月3日 22:51:04-
拷贝nginx的blog  到 apache的blog目录 就算完成wordpress的安装
web02分离挂载附件到nfs
yum -y install rpcbind nfs-utils
/etc/init.d/rpcbind start
chkconfig rpcbind on
showmount -e 172.16.1.31
mount -t nfs 172.16.1.31:/data/nfs-blog /application/apache/htdocs/blog/wp-content/uploads/
df -h
echo "/bin/mount -t nfs 172.16.1.31:/data/nfs-blog /application/apache/htdocs/blog/wp-content/uploads/" >>/etc/rc.local
cat /etc/rc.local


优化apache的工作模式:
[[email protected] conf]# vim /application/apache/conf/httpd.conf +391
Include conf/extra/httpd-mpm.conf           #去掉注释,使其生效
因为前面编译安装apache的时候已经指定apache工作模式是worker    --with-mpm=worker
[[email protected] extra]# vim /application/apache/conf/extra/httpd-mpm.conf +52
 51 <IfModule mpm_worker_module>
 52     StartServers          2
 53行  MaxClients          150              #调大并发数到1500,优化之一
 54     MinSpareThreads      25
 55     MaxSpareThreads      75
 56     ThreadsPerChild      25
 57     MaxRequestsPerChild   0        #每个子进程最大处理包数量到5000,优化之一
 58 </IfModule>

apache的目录许可说明:      搭建的小坑


nginx的负载均衡和期中述职没有看完

2017年6月4日 21:22:18-
负载均衡和反向代理的区别:

nginx L7  1.9版本后也支持L4               (L7表示网络七层模型之第7层 应用层)
lvs L4         (特大型企业使用lvs作为负载均衡)            
haproxy L4 L7

Example Configuration
upstream backend {
    server backend1.example.com       weight=5;
    server backend2.example.com:8080;
    server unix:/tmp/backend3;

    server backup1.example.com:8080   backup;
    server backup2.example.com:8080   backup;
}

server {
    location / {
        proxy_pass http://backend;
    }
}
源自nginx官网网站文档:  http://nginx.org/en/docs/http/ngx_http_upstream_module.html


Nginx编译安装:
yum install gcc gcc-c++ ncurses-devel perl                           #解决编译的问题
yum install openssl openssl-devel -y                                 #安装openssl
yum -y install pcre pcre-devel -y                                    #安装nginx环境
mkdir /home/oldboy/tools
cd /home/oldboy/tools
wget -q  http://mirrors.sohu.com/nginx/nginx-1.6.3.tar.gz
tar -zxvf nginx-1.6.3.tar.gz
cd nginx-1.6.3
useradd www -s /sbin/nologin -M
./configure --user=www --group=www  --with-http_stub_status_module --with-http_ssl_module --prefix=/application/nginx-1.6.3/
make
make install
ln -s /application/nginx-1.6.3/ /application/nginx

Nginx配置:
cd /application/nginx/conf
#egrep -v "#|^$" nginx.conf.default >nginx.conf
cat  >nginx.conf <<EOF
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
upstream www_server_pools {
    server 10.0.0.7       weight=1;
    server 10.0.0.8       weight=1;
}
    server {
        listen       80;
        server_name   www.etiantian.org etiantian.org;
        proxy_set_header Host \$host;                                       
        proxy_set_header X-Real-IP \$remote_addr;                             
        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;   
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://www_server_pools;
        }
        }
    }
EOF
../sbin/nginx -t
../sbin/nginx
#../sbin/nginx -s reload
lsof -i :80
cat >/etc/hosts <<EOF
127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
::1          localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5   lb01 www.etiantian.org etiantian.org blog.etiantian.org bbs.etiantian.org
172.16.1.6   lb02
172.16.1.7   web02
172.16.1.8   web01
172.16.1.31  nfs01
172.16.1.41  backup
172.16.1.51  db01 db01.etiantian.org
172.16.1.61  m01
EOF


循环测试:
for n in `seq 10`;do curl etiantian.org;sleep 1;done

方法一:添加辅助ip(由ip命令创建):                                      ifconfig配置的叫做别名
[[email protected] ~]# ip addr add 10.0.0.3/24 dev eth0 label eth0:0
手动切换lb01和lb02的方法    用辅助ip,然后模拟lb01或者lb02宕机。

方法二:keepalive
yum -y install keepalived

#主lb01
yum -y install keepalived
cat >/etc/keepalived/keepalived.conf <<EOF
! Configuration File for keepalived
global_defs {
   notification_email {
     [email protected]
   }
   notification_email_from [email protected]
   smtp_server 192.168.200.1
   smtp_connect_timeout 30
   router_id LVS_DEVEL
}

vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.3/24 dev eth0 label eth0:1
    }
}
EOF
/etc/init.d/keepalived start
/etc/init.d/keepalived restart
ip addr |grep 10.0.0.3

=====================================================我是可爱的分割线=========================================================
#备lb02:
yum -y install keepalived
cat >/etc/keepalived/keepalived.conf <<EOF
! Configuration File for keepalived
global_defs {
   notification_email {
     [email protected]
   }
   notification_email_from [email protected]
   smtp_server 192.168.200.1
   smtp_connect_timeout 30
   router_id LVS_DEVEL1
}

vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 51
    priority 99
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.3/24 dev eth0 label eth0:1
    }
}
EOF
/etc/init.d/keepalived start
/etc/init.d/keepalived restart
ip addr |grep 10.0.0.3

提示:检测方法可以使用arp来查看mac地址区别对应的ip和主机。

添加 ip_hash; 可以轮寻ip的时候保持会话,避免集群的时候让用户频繁登录,因为每次用户登录都是把会员文件保存在本地 /tmp目录,如果轮寻到下个不同ip会导致没有/tmp的会话文件,就会提示重新登录。
缺点就是 会导致负载不均衡的问题把!
cd /application/nginx/conf
cat  >nginx.conf <<EOF
worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
upstream www_server_pools {
    ip_hash;
    server 10.0.0.7       weight=1;
    server 10.0.0.8       weight=1;
}
    server {
        listen       80;
        server_name   www.etiantian.org etiantian.org;
        proxy_set_header Host \$host;
        proxy_set_header X-Real-IP \$remote_addr;
        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
        location / {
            root   html;
            index  index.html index.htm;
            proxy_pass http://www_server_pools;
        }
        }
    }
EOF
../sbin/nginx -t
../sbin/nginx -s reload

比起 ip_hash; 更好的办法是搭建memcached,redis来存储所有web服务器的会话文件,而不是再存储在每台web服务器本地/tmp目录下。这样,任何一个用户登录、任何一个会话到任意一个web服务器都会去后面的节点reids等服务器上去验证 会话文件(session)。


2017年6月6日 13:26:01-
参考其他人的述职报告,完善自己的方案来!
 镇楼!







http://www.cnblogs.com/lonnelan/p/3991298.html  搭建本地yum源





以上是关于视频学习记录day13的主要内容,如果未能解决你的问题,请参考以下文章

视频学习记录day03

视频学习记录day02

视频学习记录和规划day10

视频学习记录和规划day11

视频学习记录day04

视频学习记录和规划day12