Moosefs Dual Master switch

Source: Internet
Author: User

####################################
##### Network Architecture #####
####################################
(a) Network architecture
M1:192.168.1.138 primary server, storage block server, client
m2:192.168.1.139 log server, backup master server, storage block server

(ii) Two-machine switching test
1 Stop the Mfsmaster on the M1
[Email protected] ~]#/data/apps/mfs/sbin/mfsmaster-s
At this time
[[email protected] ~]# Ls/data/wwwroot/web/sharemfs # There is a problem and cannot be viewed. Description Mfsmaster Stop Effective

2 running the master on M2
[[email protected] ~]# vi/data/apps/mfs/etc/mfsexports.cfg # change mount file to same as M1
[[email protected] ~]# vi/data/apps/mfs/etc/mfsmaster.cfg # modify mfsmaster config file to be the same as M1
[[email protected] ~]#/data/apps/mfs/sbin/mfsmetarestore-a # fix
[[email protected] ~]#/data/apps/mfs/sbin/mfsmaster Start # Startup

3 Chunkserver's/etc/hosts file will update the original Mfsmaster record. (because we're not using the hostname in front of us, we're going to change the Chunkserver configuration file)
[Email protected] ~]# vi/data/apps/mfs/etc/mfschunkserver.cfg

Master_host = 192.168.1.139
[Email protected] ~]# vi/data/apps/mfs/etc/mfschunkserver.cfg
Master_host = 192.168.1.139
# Restart the service (# Here is a problem when reloading the configuration (reload), so reboot directly)
[Email protected] ~]#/data/apps/mfs/sbin/mfschunkserver-s
[[email protected] ~]#/data/apps/mfs/sbin/mfschunkserver start
[Email protected] ~]#/data/apps/mfs/sbin/mfschunkserver-s
[[email protected] ~]#/data/apps/mfs/sbin/mfschunkserver start


4 opening the Mfsmetalogger service on M1
[Email protected] ~]# cp/data/apps/mfs/etc/mfsmetalogger.cfg.dist/data/apps/mfs/etc/mfsmetalogger.cfg
[Email protected] ~]# vi/data/apps/mfs/etc/mfsmetalogger.cfg
Master_host = 192.168.1.139 # changed to the IP and port of the current meta-server
Master_port = 9419

[[email protected] ~]#/data/apps/mfs/sbin/mfsmetalogger-s # M2 on log server stop
[[email protected] ~]#/data/apps/mfs/sbin/mfsmetalogger start # M1 on log server

5 Re-mount
[Email protected] ~]# Umount/data/wwwroot/web/sharemfs
[Email protected] ~]#/data/apps/mfsclient/bin/mfsmount/data/wwwroot/web/sharemfs-p-H 192.168.1.139
MFS Password:
Mfsmaster accepted connection with PARAMETERS:READ-WRITE,RESTRICTED_IP; Root mapped to Root:root
[[email protected] ~]# Ls/data/wwwroot/web/sharemfs # View data discovery data exists
1.txt 2.txt 3.txt 4.txt 5.txt 6.txt 9.txt html1 html2 mfs_down_test.txt mfsshare

6 Now we add a file to switch the service back
[Email protected] sharemfs]# echo "101010101" > 10.txt

Process as
Operation on 6.1 M1
[[email protected] ~]#/data/apps/mfs/sbin/mfsmaster start # mfsmaster start
[[email protected] ~]# VI/DATA/APPS/MFS/ETC/MFSCHUNKSERVER.CFG # block Server configuration Restore

# Block Server restart
[Email protected] ~]#/data/apps/mfs/sbin/mfschunkserver-s
[[email protected] ~]#/data/apps/mfs/sbin/mfschunkserver start

# Log Server stopped
[Email protected] ~]#/data/apps/mfs/sbin/mfsmetalogger-s

# re-mount
[Email protected] ~]# Umount/data/wwwroot/web/sharemfs
[Email protected] ~]#/data/apps/mfsclient/bin/mfsmount/data/wwwroot/web/sharemfs-p-H 192.168.1.138

Operation on 6.2 M2
[[email protected] ~]#/data/apps/mfs/sbin/mfsmaster-s # mfsmaster Stop
[[email protected] ~]#/VI/DATA/APPS/MFS/ETC/MFSCHUNKSERVER.CFG # block Server configuration Restore

# Block Server restart
[Email protected] ~]#/data/apps/mfs/sbin/mfschunkserver-s
[[email protected] ~]#/data/apps/mfs/sbin/mfschunkserver start

# Log Server Startup
[[email protected] ~]#/data/apps/mfs/sbin/mfsmetalogger start

6.3 M1 to view the new file's data or exist
[Email protected] ~]# Cd/data/wwwroot/web/sharemfs
[[email protected] ~]# ls
[email protected] ~]# cat 10.txt




Moosefs Dual Master switch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.