(服务运维)NFS和LAP组合实验

于今腐草无萤火,终古垂杨有暮鸦。这篇文章主要讲述(服务运维)NFS和LAP组合实验相关的知识,希望能为你提供帮助。


实验实验目的:

  • 客户机访问后台rs1(LAP)和rs2(LAP)负载均衡
  • 数据类的流量访问mysql,图片类访问NFS
  • MySQL数据定期异地备份到NFS服务器

RS1配置(172.16.10.18 因为centos版本问题我换成了172.16.10.12)
systemctl stop firewalld.service 
mkdir -pv   /var/www.html
hostnamectl set-hostname rs1.linweiwei.com
yum install httpd php-fpm php-mysqlndnfs-utils php-json -y
systemctl enable --now httpd php-fpm    nfs-server
systemctl status httpd php-fpm  nfs-server
vim /etc/fstab
尾行插入  172.16.10.10:/data/wordpress   /var/www.html     nfs     _netdev         0 0
mount -a

RS2配置(172.16.10.19 因为centos版本问题我换成了172.16.10.13)
systemctl stop firewalld.service 
mkdir -pv   /var/www.html
hostnamectl set-hostname rs2.linweiwei.com
yum install httpd php-fpm php-mysqlndnfs-utils php-json -y
systemctl enable --now httpd php-fpm    nfs-server
systemctl status httpd php-fpm  nfs-server
【(服务运维)NFS和LAP组合实验】vim /etc/fstab
尾行插入  172.16.10.10:/data/wordpress   /var/www.html     nfs     _netdev         0 0
mount -a

MySQL配置systemctl stop firewalld.service 
yum -y install mysql-server  nfs-utils
systemctl enable --now mysqld    nfs-server
systemctl status mysqld nfs-server
mysql
create database wordpress;
create user wordpress@172.16.10.% identified by 123456;   #创建用户和可以访问的网络以及验证password
grant all on wordpress.* to  wordpress@172.16.10.%;

NFS配置systemctl stop firewalld.service 
mkdir -pv  /data/wordpress
chmod 777  /data/wordpress
vim /etc/exports
尾行插入  /data/wordpress 172.16.10.0/24(rw)
yum -y install nfs-utils
systemctl enable --now   nfs-server
systemctl status   rpcbind   nfs-server   #看到RPC和NFS均启动正常
exportfs -r
exportfs -v

官网下载wordpress  ??http://cn.wordpress.org/??  并上传给NFS服务器
tar xf wordpress-5.8.3-zh_CN.tar.gz 
mv wordpress/* /data/wordpress/
client配置修改host文档(简化LVS部分直接修改host文档使流量负载均衡到RS1和RS2)
172.16.10.12 blog.linweiwei.com
172.16.10.13 blog.linweiwei.com


未完成,先下班~

    推荐阅读