In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Environmental Analysis:
At present, four web servers in the environment adopt shared storage technology. Due to the frequent disconnection of nas service recently, which affects the access to the website, we plan to adopt the object storage scheme. Our cloud environment remediation measures can use multiple Linux servers for storage, together with rsync (synchronization) + notify (trigger) to achieve server data synchronization.
Programme implementation:
1. Scheme analysis:
Each web server mounts a storage disk / newweb, and modifies the path of the original website access resources to / otherweb to this / newweb. As the disk capacity is not as large as nas, you can put the data sources used by web, such as pictures, web pages, etc., under this path. Mailboxes, logs, etc., continue to be placed under nas, even if nas is offline, it will not affect the normal access of the website.
2. Synchronization steps:
Master is the main control point. Every time the update resource is on the master, master will check whether the file is updated in real time. If it is updated, it will synchronize the data to the web1-web4. If there is no update, it will not be synchronized. This can reduce the unnecessary load on the server, and master can also be used as a backup server.
3. Technical analysis:
Inotify, which is a kernel mechanism for notifying user space programs of file system changes, is also a file system change notification mechanism, such as file addition, deletion and other events can immediately let the user state know.
Rsync is actually remote rsync, it is a remote synchronization tool, with both cp and scp functions, the use of rsync commands is almost the same as scp. Rsync triggers synchronization through the super daemon xinetd.
Rsync+inotify combination is a trigger update. Whenever there is a change in data, the update will be synchronized immediately.
Write rsync script to achieve real-time data synchronization, the script can be executed in the background.
Here are the steps to begin:
1) install rsync,inotify on the rsync client master service:
Yum-y install rsync
2 on the server side of rsync, that is, the server where web is located, such as web1, only rsync can be installed.
Yum-y install rsync
Edit the rsync configuration file vim / erc/rsyncd.conf:
3. Start the rsync service:
Systemctr start rsyncd
4. Write a rsync script on the rsync client to grant executable permissions:
Then execute. / rsync.sh &
Write a test file on the client, and then check to see if it is synchronized on another server.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.