Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

New applications of iSCSI and how to separate storage services from NFS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

For the new application of iSCSI and how to separate the storage service of NFS, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Iscsi applications cannot be mounted on multiple computers, and cannot be updated at any time. Shared content is suitable for HA cluster but not suitable for LB HA: one master, one standby ext4, xfs are local file systems need to be made into gfs global file system NFS network file system brief description: when A, B machine mounts the same iqn device C (ext4 or xfs), it also provides services, because they all provide storage services. The files in it can be modified, but the modified files can only be seen by the local computer. Other hosts mounted with the same storage device cannot see the changes to the files. For example, storage device C stores a.txt (123) and is mounted by An and B respectively. Both An and B can see a.txt (123). When A modifies a.txt, a.txt (1234) Only a.txt (123) is still visible on B, but a.txt has now been changed to a.txt (1234) When B makes changes to a.txt, a.txt (1235), A cannot see the changes of B. When both An and B uninstall the storage device and log out, after login and mount operation, you will see the last modification to this file, that is, after you log in and mount again here, An and B can see a.txt (1235) experiment: prepare: machine C set up iscsi sharing A: discovering, logging in, formatting, formatting, mounting / var/www/html/ echo > / var/www/hmtl/index.html B: discovering, logging in, mounting mount / dev/sda / var/www/html directly: when multiple computers mount the same storage device at the same time Cannot access the content modified by the other party step A: insert "0" sed-I'1a 0' / var/www/html/index.html after the first line to view cat / var/www/html/index.htmlB: view And there is already a file index.html cat / var/www/html/index.html that inserts "2" sed-I'1a 2' / var/www/html/index.html after the first line to view cat / var/www/html/index.htmlA: uninstall umount / var/www/html/ and log out iscsiadm-- mode node-- targetname iqn.2018-10.cn.tedu.storage51:vdb-- portal 192.168.4.51 var/www/html/index.html 3260-- Logout login iscsiadm-- mode node-- targetname iqn.2018-10.cn.tedu.storage51:vdb-- portal 192.168.4.51 targetname iqn.2018 3260-- login mount mount / dev/mapper/mpatha / var/www/html/ view Found that the modified content is B modified content cat / var/www/html/index.htmlB: uninstall umount / var/www/html login iscsiadm-- mode node-- targetname iqn.2018-10.cn.tedu.storage51:vdb-- portal 192.168.4.51 var/www/html 3260-- logout login iscsiadm-- mode node-- targetname iqn.2018-10.cn.tedu.storage51:vdb-- portal 192.168.4.51j3260-- login Mount mount / dev/sdb / var/www/html/ to view It is found that the modified content is B modified content cat / var/www/html/index.htmlNFS server nfs-utils provides shared service rpcbind provides data transfer master configuration file vim / etc/exports async: save the file content in cpu, then save the file content to disk synchronously: save the file content in cpu, save it to disk at the same time experiment: storage and service separation httpd problem: different network hosts' web page files may be the same There will be the operation of repeating the web page file. Waste of manpower purpose: multiple web hosts access the same device web page file preparation: host: storage51:192.168.4.51 web52:192.168.4.52 web53:192.168.4.53 add a 2G disk all space is divided into a partition formatted as ext4 mount to / sharedirstorage51: release NFS disk share yum-y install nfs-utils rpcbind / / install two packages vim / etc/ Exports/sharedir * (rw) systemctl restart rpcbind.service nfs-utils.service nfs-server.servicesystemctl enable rpcbind.service nfs-utils.service nfs-server.serviceshowmount-e 127.0.0.1 / / the permission to view the local NFS share export list for 127.0.0.1: / sharedir * / / share is * Is the protection of common files the client mounts the NFS shared disk web52:yum-y install httpdmount 192.168.4.51:/sharedir / var/www/htmlweb53:yum-y install httpdmount 192.168.4.51:/sharedir / var/www/html / / at this time web52 and web53 cannot create files under / var/www/html, because storage51 does not give write permissions to / sharedir other users storage51:chmod ownw / sharedir. This is the answer to the question about the new application of iSCSI and how to separate the storage services of NFS. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report