网站首页 > 技术教程 正文
实验环境:
10.10.204.62 Load Balancing
10.10.204.63 Nginx Web server
10.10.204.64 Nginx Web server
10.10.204.65 File Storage
1.File Storage 服务器安装
yum -y install nfs-utils
2.配置NFS并创建共享目录
# mkdir -p /Data/webapp # vim /etc/exports /Data/webapp 10.10.204.0/24(rw,sync,no_subtree_check,no_root_squash)
3.开启自启动
# systemctl enable rpcbind # systemctl enable nfs-server # systemctl start rpcbind # systemctl start nfs
4.相关参数:
rw:read-write:可读写; ro:read-only,只读; sync:文件同时写入硬盘和内存。 no_root_squash:来访的root用户保持root帐号权限;显然开启这项是不安全的。 root_squash:将来访的root用户映射为匿名用户或用户组;通常它将使用nobody或nfsnobody身份。 all_squash:所有访问用户都映射为匿名用户或用户组; anonuid:匿名用户的UID值,可以在此处自行设定。 anongid:匿名用户的GID值。 sync:将数据同步写入内存缓冲区与磁盘中,效率低,但可以保证数据的一致性。 async:文件暂存于内存,而不是直接写入内存。 no_subtree_check :即使输出目录是一个子目录,nfs服务器也不检查其父目录的权限,这样可以提高效率。
5.File Storage 服务器防火墙配置
# firewall-cmd --permanent --add-service=rpc-bind # firewall-cmd --permanent --add-service=nfs # firewall-cmd --reload
6.Nginx Web server 服务器安装以及挂载
# yum -y install nfs-utils # mkdir -p /Data/webapp # mount -t nfs 10.10.204.65:/Data/webapp /Data/webapp
7.如果需要开机自动挂载,在该文件最下方添加一行即可
# vim /etc/fstab 10.10.204.65:/Data/webapp /Data/webapp nfs auto,rw,vers=3,hard,intr,tcp,rsize=32768,wsize=32768 0 0
8.Nginx Web server 服务器测试
连续写16384个16KB的块到nfs目录下的testfile文件
# time dd if=/dev/zero of=/Data/webapp/testfile bs=16k count=16384 16384+0 records in 16384+0 records out 268435456 bytes (268 MB) copied, 2.89525 s, 92.7 MB/s real 0m2.944s user 0m0.015s sys 0m0.579s 测试读的性能 # time dd if=/nfsfolder/testfile of=/dev/null bs=16k 16384+0 records in 16384+0 records out 268435456 bytes (268 MB) copied, 0.132925 s, 2.0 GB/s real 0m0.138s user 0m0.003s sys 0m0.127s
综合来讲,NFS的速度还算理想。如果觉得速度慢,那么添加相关参数后,反复挂载卸载并测试读写,找到适合自己的配置方案。
猜你喜欢
- 2024-10-13 nginx的集群原理与常用的调度算法
- 2024-10-13 自己动手在阿里云部署 K8S 集群(阿里云 slb k8s)
- 2024-10-13 Kubernetes集群的自动化部署和管理
- 2024-10-13 最新Minio+Docker+Nginx多机集群(多台nginx集群方案)
- 2024-10-13 基于 consul + nginx 的Spring boot微服务集群部署
- 2024-10-13 k8s集群中部署nginx(k8s nginx ingress)
- 2024-10-13 完美!Kubernetes 集群的零停机服务器更新
- 2024-10-13 LVS+keepalived+nginx实现高性能高可用负载均衡集群--第二部分
- 2024-10-13 高级架构技术点之安装redis 集群(redis 安装配置)
- 2024-10-13 K8s Helm部署 ES集群 &Kibana 收集展示日志
你 发表评论:
欢迎- 最近发表
-
- Oracle 在其新的 Linux 内核中引入了热补丁功能
- CentOS 7.6下安装Oracle 11.2.0.4
- ORACLE体系 - 2(oracle体系讲解)
- ORA-12514 TNS 监听程序当前无法识别连接描述符中请求服务
- Hadoop自学系列集(二) ---- CentOS下安装JDK
- 如何升级oracle数据库安全补丁(oraclepsu补丁升级)
- 搭建Oracle数据库服务器(oracle服务器创建用户)
- OGG同步到Kafka(oggforbigdata到kafka)
- oracle是什么软件?(oracle是干什么用的)
- 脚本化修改Oracle用户的密码以及执行sql(增删改查等)
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)