In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Installation and configuration of MogileFS
=
Overview:
=
1. Brief introduction:
MogileFS is an open source distributed file storage system developed by DangaInteractive, a company owned by LiveJournal.
The Danga team has developed a number of well-known open source projects, including Memcached, MogileFS, Perlbal and so on.
At present, many companies use MogileFS, such as several previous interconnection companies in Japan and domestic yupoo, digg, Douban, No.1, Dianping, Sogou and Anjuke, which manage a large number of pictures for their organizations or companies, respectively.
2.MogileFS features:
★ application layer
Runs in user space without special core components
★ has no single point
MogStored: stores multiple copies of data
Tracker: multi-node
Database:MySQL (store metadata)
★ automatic file replication
★ is transport neutral, has no special protocol, and can communicate through NFS or HTTP
★ simple namespace
Diomain,class,fid (that is, key that accesses the file)
Each file corresponds to a key: used for domain to define namespaces
★ does not have to share any data
Metadata: DB
Data: MogStored, copy
★ does not need RAID
3.MogileFS components:
★ MogileFS components:
☉ Tracker: tracking metadata
At the core of MogileFS is a scheduler.
The service process is mogilefsd
Responsibilities: delete, copy, monitor, query, etc.
☉ MogStored: storing data
Mogstored process: the location where data is stored, usually a HTTP (WebDAV) server, used to create, delete, and retrieve data
Storage nodes need to define "device dev" as storage space; each device needs to be identified by a unique DevID in the current cluster.
☉ Database: storing metadata
Used to store metadata information for tracker, mogileFS
Mysql is generally used to store the metadata of mogilefs. It is recommended to use redundancy scheme to ensure availability (MMM,MHA).
★ MogileFS service process
Mogilfsd (Tracker)
Mogstored (MogStored)
The implementation mechanism and working principle of 4.MogileFS:
★ implementation mechanism
In this file system cluster, each data block has multiple copies, which are stored on multiple Storage Node, and the number of copies of different file systems varies (generally recommended is 3). The storage location (which Storage and path) of each data block will be recorded separately on the Tracker Node. If a Storage node is not online, when the client requests data from the Tracker node, the Tracker node returns the storage location of the redundant copy to the client. This ensures the high availability of data in the entire file system. When data is stored in a storage node, each storage node will send copies to other nodes through inter-node communication according to the instructions of Tracker. If a storage is offline, the copies on that node will be re-provided by other nodes to ensure that the number of copies is not less than the specified value.
How ★ works
When the client needs to access data, it first interacts with Tracker. Tracker queries the database to obtain the metadata that the client needs to access data, and then returns it to the client. The client uses the results returned by Tracker to interact with Storage Nodes nodes to complete data access (it is possible to contact one or more at a time).
Attached picture:
Terms in 5.MogileFS:
☉ tracker
With the help of the database to save the metadata information of each node file, it is easy to retrieve and locate the data location and monitor each node, inform the client of the location of the storage area and direct the storage node to replicate the data, and the process is mogilefsd.
☉ databases
Store metadata information for node files for tracker nodes
☉ storage
Convert keys in the specified domain to unique file names and store them in a specific device file. After conversion, the file names are values, and storage automatically maintains the corresponding relationship between key values. Storage nodes use http for data transfer, depending on perbal, and the process is mogstored, perbal.
☉ Domain
The key value in a domain is unique. A MogileFS can have multiple fields to store different types of files. The Key must be unique in the same Domain, and the Key can be the same in different Domain.
☉ Class
The key value in a domain is unique. A MogileFS can have multiple fields to store different types of files. The Key must be unique in the same Domain, and the Key can be the same in different Domain.
☉ device
A storage node can have multiple device, that is, the directory used to store files. Each device has a device ID, which needs to be configured in the mogstored configuration file. The device cannot be deleted, and the device status can only be set to dead. After setting it to dead, the data cannot be recovered, and the device ID can no longer be used.
Attached picture:
MogileFS installation and configuration
How to install the 1.perl module:
★ online (online):
Yum-y install make gcc unzip perl-DBD-MySQL perl perl-CPAN perl-YAML perl-Time-HiRes
Execute the command: perl-MCPAN-e shell enters perl dependency package installation mode (or executes cpan-I module_name::name)
Cpan install App::cpanminus
Cpan install MogileFS::Server
Cpan install MogileFS::Utils
Cpan install IO::AIO
Cpan install IO::WrapTie
Cpan install Danga::Socket
★ offline (offline): need to solve a large number of dependencies
$perl Makefile.PL
$make
$sudo make install
★ rpm
☉ MogileFS installation:
Tracker:
$yum install MogileFS-Server-VERSION.rpm MogileFS-Server-mogilefsd-VERSION.rpm
Mogstored:
$yum install perl-IO-AIO
$yum install MogileFS-Server-VERSION.rpm MogileFS-Server-mogstored-VERSION.rpm
Lab: installation and configuration of MofileFS
Environment description:
Two virtual hosts of CentOS 7, node1 and node2,node1, act as tracker and mogstore storage nodes as well as mysql servers, and node2 are tracker and mogstaor nodes
The steps of the experiment:
1. First, use the CPAN tool to install perl module and mogilefs online on noge1
[root@centos7 ~] # yum-y install make gcc unzip perl-DBD-MySQL perl perl-CPAN perl-YAML perl-Time-HiRes [root@centos7 ~] # perl- MCPAN-e shell cpan > install App::cpanminus cpan > install MogileFS::Server cpan > install MogileFS::Utils cpan > install IO::AIO cpan > install IO::WrapTie cpan > install Danga::Socket#=# after installation, the program versions are as follows: [root@centos7 ~] # cpan Sys::SyscallReading'/ root/.cpan/Metadata' Database was generated on Thu 05 Jan 2017 18:41:02 GMTSys::Syscall is up to date. [root@centos7 ~] # cpan MogileFS::ServerReading'/ root/.cpan/Metadata' Database was generated on Thu, 05 Jan 2017 18:41:02 GMTMogileFS::Server is up to date. [root@centos7 ~] # cpan MogileFS::Utils Reading'/ root/.cpan/Metadata' Database was generated on Thu 05 Jan 2017 18:41:02 GMTMogileFS::Utils is up to date. [root@centos7 ~] # cpan IO::AIOReading'/ root/.cpan/Metadata' Database was generated on Thu, 05 Jan 2017 18:41:02 GMTIO::AIO is up to date. [root@centos7 ~] # cpan IO::WrapTie Reading'/ root/.cpan/Metadata' Database was generated on Thu 05 Jan 2017 18:41:02 GMTIO::WrapTie is up to date (2.111). [root@centos7] # cpan Danga::SocketReading'/ root/.cpan/Metadata' Database was generated on Thu, 05 Jan 2017 18:41:02 GMTDanga::Socket is up to date (2.111).
two。 Install MySQL on node1, create databases, and add administrative users
[root@centos7] # mysql-ptaoxiuWelcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 11Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c' to clear the current input statement.MariaDB [(none)] > create database mogfsdb; # create database MariaDB [(none)] > grant all privileges on mogfsdb.* to 'moguser'@'127.0.0.1' identified by' mogpass';MariaDB [(none)] > grant all privileges on mogfsdb.* to 'moguser'@'192.168.1.113' identified by' mogpass';MariaDB [(none)] > flush privileges
3. Initialize the database
[root@centos7] # mogdbsetup-dbhost='127.0.0.1'-dbname=mogfsdb-dbuser=moguser-dbpass=mogpass-type=MySQLThis will attempt to setup or upgrade your MogileFS database.It won't destroy existing data.Run with-help for more information. Run with-- yes to shut up these prompts.Continue? [N/y]: y
View the database as follows:
[root@centos7] # mysql-ptaoxiuWelcome to the MariaDB monitor. Commands end with; or\ g.Your MariaDB connection id is 5Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.MariaDB [(none)] > show databases +-+ | Database | +-+ | information_schema | | Syslog | | hellodb | | jingdong | | mogfsdb | | mysql | | ultrax | | zabbix | +- -+ 8 rows in set (0.12 sec) MariaDB [(none)] > use mogfsdb Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedMariaDB [mogfsdb] > show tables # generated table +-+ | Tables_in_mogfsdb | +-+ | checksum | | class | | device | | domain | | file | | file_on | | file_on_ Corrupt | | file_to_delete | | file_to_delete2 | | file_to_delete_later | | file_to_queue | | file_to_replicate | | fsck_log | | host | | server_settings | | tempfile | | unreachable_fids | +-+ 17 rows in set (0.00 sec) MariaDB [mogfsdb] > exit
Configure the tracker nod
1. Create the mogilefs directory under the / etc directory and provide the configuration file mogilefsd.conf, as follows:
[root@centos7 ~] # mkdir / etc/mogilefs [root@centos7 ~] # vim / etc/mogilefs/mogilefsd.conf # Enable daemon mode to work in background and use syslog daemonize = 1 # Where to store the pid of the daemon (must be the same in the init script) pidfile = / var/run/mogilefsd/mogilefsd.pid # specify the pid file location # Database connection information db_dsn = DBI:mysql:mogfsdb:host=127.0.0.1 # to change to the account authorized above and Password db_user = moguser # mysql user db_pass = mogpass # mysql password # IP:PORT to listen on for mogilefs client requests listen = 0.0.0.0 mysql 7001 # listening address and port (port 7001 of all addresses) # Optional If you don't define the port above. Conf_port = 7001 # Number of query workers to start by default. Query_jobs = 10 # the number of processes used for the query # Number of delete workers to start by default. Delete_jobs = 1 # the number of processes used for delete operations # Number of replicate workers to start by default. Replicate_jobs = 5 # number of processes used for replication # Number of reaper workers to start by default. # (you don't usually need to increase this) reaper_jobs = 1 # the number of processes used to recycle resources # Number of fsck workers to start by default. # (these can cause a lot of load when fsck'ing) # fsck_jobs = 1 # Minimum amount of space to reserve in megabytes # default: 100 # Consider setting this to be larger than the largest file you # would normally be uploading. # min_free_space = 200 # Number of seconds to wait for a storage node to respond. # default: 2 # Keep this low, so busy storage nodes are quickly ignored. # node_timeout = 2 # Number of seconds to wait to connect to a storage node. # default: 2 # Keep this low so overloaded nodes get skipped. # conn_timeout = 2 # Allow replication to use the secondary node get port, # if you have apache or similar configured for GET's # repl_use_get_port = 1
two。 Create the pid file directory and grant permissions, and then start the service.
# mogilefsd cannot be run as root, but must be run with another user. Add a mogilefs user for this Then start the service [root@centos7 ~] # useradd-r mogilefs# to create the pid file directory and modify the master group as mogilefs [root@centos7 ~] # mkdir / var/run/mogilefsd/-p [root@centos7 ~] # chown-R mogilefs.mogilefs / var/run/mogilefsd/# launch service [root@centos7 mogilefs] # su-mogilefs-c "mogilefsd-c / etc/mogilefs/mogilefsd.conf-- daemon" su: warning: cannot change directory to / home/mogilefs : No such file or directory# view port 7001 [root@centos7 mogilefs] # ss-tnlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 25 * 514 *: * LISTEN 0 50 *: 3306 *: * LISTEN 0 128 *: 22 *: * LISTEN 0 128 127.0.0.1 LISTEN 631 *: * 0128 *: 7001 *: * LISTEN 0 100 127.0.0.1 25 *: * LISTEN 0 128 127.0.0.1 LISTEN 6010 *: * 025: 514 : * LISTEN 0 128:: 22:: * LISTEN 0 128 :: 1 LISTEN 631: * 100:: 1:25 : * LISTEN 0 128:: 1 6010: *
Next, configure the mogstore node
1. Edit the configuration file vim / etc/mogilefs/mogstored.conf as follows:
[root@centos7 ~] # vim / etc/mogilefs/mogstored.conf maxconns = 10000 # maximum number of concurrent connections httplisten = 0.0.0.0etc/mogilefs/mogstored.conf maxconns 7500 # listening port mgmtlisten = 0.0.0.0etc/mogilefs/mogstored.conf maxconns 7501 # management port to detect the health status of mogstore docroot = / data/mogstored # data storage location
two。 Provide data storage directory / data/mogstored, partition, format, mount devices, and modify the master group to mogilefs
[root@centos7 ~] # mkdir-pv / data/mogstored# add disk dev (partition the disk device in the production environment, create a file system, and mount it to this directory Here, to test the creation of the directory dev) [root@centos7 ~] # mkdir / data/mogstored/dev {1 root@centos7 2} # modify the master group to mogilefs [root@centos7 ~] # chown-R mogilefs:mogilefs / data/mogstored/ [root@centos7 mogstored] # lltotal 0drwxr-xr-x 2 mogilefs mogilefs 6 Jan 5 15:52 dev1drwxr-xr-x 2 mogilefs mogilefs 6 Jan 5 15:52 partition, format, mount the file system in the dev2# production environment And authorize # fdisk / dev/sdb# mkfs.ext4 / dev/sdb1# mkdir / mystore/dev1-pv# mount / dev/sdb1 / mystore/dev1# chown-R mogilefs.mogilefs / data/mogstored/dev1
3. Start the service and view port 7500d7501
[root@centos7 mogstored] # su-mogilefs-c "mogstored-c / etc/mogilefs/mogstored.conf-- daemon" su: warning: cannot change directory to / home/mogilefs: No such file or directory [root@centos7 mogstored] # ss-tnlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 25 *: 514 *: * LISTEN 0 50 *: 3306 *: * LISTEN 0128 *: 7500 *: * LISTEN 0128 *: 7501 *: * LISTEN 0128 *: 22 *: * LISTEN 0 128 127.0.1 purl 631 *: * LISTEN 0 128 *: 7001 *: * LISTEN 0 100 127.0 .0.1 25 *: * LISTEN 0 128 127.0.0.1v 6010 *: * LISTEN 0 25: 514: * LISTEN 0 128 : 22:: * LISTEN 0 128:: 1purl 631 : * LISTEN 0 100:: 1:25: * LISTEN 0 128 :: 1purl 6010: *
Configure the mogstore storage node on the node node2 as follows:
1. It is also suitable for CPAN to install perl-related modules and mogilefs online. Storage nodes need to solve dependencies and install perl-IO-AIO.
[root@centos7 ~] # yum-y install make gcc unzip perl-DBD-MySQL perl perl-CPAN perl-YAML perl-Time-HiRes perl-IO-AIO [root@centos7 ~] # perl- MCPAN-e shell cpan > install App::cpanminus cpan > install MogileFS::Server cpan > install MogileFS::Utils cpan > install IO::AIO cpan > install IO::WrapTie cpan > install Danga::Socket
two。 Create a directory under / etc and provide the configuration file mogstored.conf for mogstore
[root@centos7 ~] # mkdir / etc/mogilefs [root@centos7 ~] # vim / etc/mogilefs/mogstored.conf maxconns = 10000 httplisten = 0.0.0.0 etc/mogilefs 7500 mgmtlisten = 0.0.0.0 etc/mogilefs 7501 docroot = / data/mogstored
3. Create mogilefs users, provide data storage directory / data/mogstored, partition, format, mount devices, and modify the master group to mogilefs
[root@centos7 ~] # useradd-r mogilefs [root@centos7 ~] # mkdir-pv / data/mogstored/dev {3pm 4} # two node devices cannot be the same And it is lowercase mkdir: created directory'/ data/mogstored'mkdir: created directory'/ data/mogstored/dev3'mkdir: created directory'/ data/mogstored/dev4' [root@centos7 ~] # chown-R mogilefs:mogilefs / data/mogstored/ [root@centos7 ~] # cd / data/mogstored/ [root@centos7 mogstored] # lltotal 0drwxr-xr-x 2 mogilefs mogilefs 6 Jan 5 15:22 dev3drwxr-xr-x 2 mogilefs mogilefs 6 Jan 5 15:22 dev4
4. Start the service and view the port
[root@centos7] # su-mogilefs-c "mogstored-c / etc/mogilefs/mogstored.conf-- daemon" su: warning: cannot change directory to / home/mogilefs: No such file or directory [root@centos7 ~] # ss-tnlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 50 *: 3306 *: * LISTEN 0 128 *: 7500 *: * LISTEN 0128 *: 7501 *: * LISTEN 0128 *: 22 *: * LISTEN 0128 127.0.0. 1RV 631 *: * LISTEN 0 100 127.0.0.1 LISTEN 25 *: * LISTEN 0 128 127.0.0.1 6011 *: * LISTEN 0 128 : 22:: * LISTEN 0 128:: 1purl 631 : * LISTEN 0 100:: 1:25: * LISTEN 0 128 :: 1Plus 6011: *
As above, we have a tracker and two mogstore, and then we can use MogileFS-Utils on the control node for administrative operations such as adding host,device,domain,class.
1. Use the mogadm command to add a storage node mogstore
[root@centos7 ~] # mogadm host add node1-- ip=192.168.1.112-- status=alive-- port=7500 [root@centos7 ~] # mogadm host add node2-- ip=192.168.1.113-- status=alive-- port=7500 [root@centos7 ~] # mogadm host listnode1 [1]: alive IP: 192.168.1.112:7500node2 [2]: alive IP: 192.168.1.11315
two。 Use the mogadm command to add the storage node device. Note that the device mounted earlier must be lowercase dev and the storage node name cannot be the same.
[root@centos7] # mogadm device add node1 1-- status=alive [root@centos7 ~] # mogadm device add node2 3-- status=alive [root@centos7 ~] # mogadm device add node2 4-- status=alive [root@centos7 ~] # mogadm device listnode1 [1]: alive used (G) free (G) total (G) weight (%) dev1: alive 3.674 36.307 39.980 node2 [2]: alive Used (G) free (G) total (G) weight (%) dev3: alive 0.398 39.582 39.980 dev4: alive 0.398 39.582 39.980
3. Add a domain domain or class class
[root@centos7 ~] # mogadm domain list domain class mindevcount replpolicy hashtype--[root@centos7 ~] # mogadm domain add files [root @ centos7 ~] # mogadm domain add packs _ Pictures [root @ centos7 ~] # mogadm domain list domain class mindevcount replpolicy hashtype-- Files default 2 MultipleHosts () NONE p_w_picpaths default 2 MultipleHosts () NONE # mindevcount: default minimum number of devices is 2 That is, two replicas are created by default # replpolicy: replication policy is multi-host replication # hashtype: hash type, NOME means not customized Use the default value [root@centos7 ~] # mogadm class list domain class mindevcount replpolicy hashtype- files Default 2 MultipleHosts () NONE p_w_picpaths default 2 MultipleHosts () NONE
4. View detection status
[root@centos7 ~] # mogadm checkChecking trackers... # tracker identifies OK 127.0.0.1 7001... OKChecking hosts... # Host Identification OK [1] node1... OK [2] node2... OKChecking devices... # device Identification OK host device size (G) used (G) free (G) use% ob state I Pot O%-[1] dev1 39.980 3.734 36.247 9.34% writeable 0.1 [2] dev3 39.980 0.432 39.549 1.08% writeable 0.0 [2] dev4 39.980 0.432 39.549 1.08% writeable 39.980 -total: 119.941 4.597 115.345 3.83%
5. Use the mogupload command to upload files
[root@centos7 ~] # mogupload-- help # upload file Usage: / usr/local/bin/mogupload-- trackers=host-- domain=foo-- key='/hello.jpg'-- file='./hello.jpg' [root@centos7 ~] # mogupload-- trackers=192.168.1.112-- domain=files-- key='/fstab.txt'-- file='/etc/fstab' [root@centos7 ~] # mogupload-- trackers=192.168.1.112-- domain=p_w_picpaths-- Key='/2.jpg'-- file='/root/man.jpg' [root@centos7 ~] # moglistkeys-- help # lists the file Usage: / usr/local/bin/moglistkeys-- trackers=host-- domain=foo-- key_prefix='bar/' [root@centos7 ~] # moglistkeys-- trackers=192.168.1.112-- domain=files/fstab.txt [root@centos7 ~] # moglistkeys-- trackers=192.168.1.112-- domain=p_w_picpaths/2.jpg
6. Use mogfileinfo to view file information as follows:
[root@centos7 ~] # mogfileinfo-trackers=192.168.1.112-domain=files-key='/fstab.txt'- file: / fstab.txt class: default devcount: 1 domain: files fid: 2 key: / fstab.txt length: 690-- Http://192.168.1.112:7500/dev1/0/000/000/0000000002.fid # can access the corresponding resources through this URL [root@centos7 ~] # mogfileinfo-- trackers=192.168.1.112-- domain=p_w_picpaths-- key='/2.jpg'- file: / man.jpg class: default devcount: 1 domain: imgs Fid: 3 key: / man.jpg length: 3401017-http://192.168.1.112:7500/dev1/0/000/000/0000000010.fid
Access its resources through URL as follows:
Note:
As can be seen in the above experiment, the uploaded files are only stored on one host device, in fact, both nodes should be stored. I found on the Internet that the reason for the error may be caused by the module Sys::Syscall. We see that the version of this module is now 0.25. I searched the Internet for a solution and found that if I reduced the software to version 0.23, it might fix the problem. Let's give it a try:
# the version installed before compilation is 0.25 [root@centos7 Sys-Syscall-0.23] # perl-MSys::Syscall-e 'print $Sys::Syscall::VERSION'0.25# download the source code package and compile and install
Wget http://search.cpan.org/CPAN/authors/id/B/BR/BRADFITZ/Sys-Syscall-0.23.tar.gz
Tar xf Sys-Syscall-0.23.tar.gz
Cd Sys-Syscall-0.23
Perl Makefile.PL
Make
Make test
Make install
Restart the mogilefsd process, and then upload a file to solve the problem successfully, as follows:
[root@centos7 ~] # mogupload-- trackers=192.168.1.112-- domain=p_w_picpaths-- key='/1.jpg'--file='/root/1.jpg' [root@centos7 ~] # mogfileinfo-trackers=192.168.1.112-domain=p_w_picpaths-key='/1.jpg'- file: / 1.jpg class: default devcount: 2 domain: P_w_picpaths fid: 9 key: / 1.jpg length: 31249077-http://192.168.1.112:7500/dev1/0/000/000/0000000009.fid-http://192.168.1.113:7500/dev3/0/000/000/0000000009.fid
7. Use mogstats to indicate the connected database, user and password, and view the status, as follows:
[root@centos7] # mogstats-- db_dsn= "DBI:mysql:mogdb:host=127.0.0.1"-- db_user= "moguser"-- db_pass= "mogpass"-- stats= "all" Fetching statistics... (all) Statistics for devices... Device host files status-dev1 node1 5 alive dev3 node2 4 alive dev4 node2 1 alive- -- Statistics for file ids... Max file id: 9Statistics for files... Domain class files size (m) fullsize (m)-files default 2 0 0 p_w_picpaths default 3 32 64-Statistics for replication... Domain class devcount files-files default 2 2 p_w_picpaths default 2 3- -- Statistics for replication queue... Status count-Statistics for delete queue... Status count-Statistics for general queues... Queue status count-done
As above, node1 is tracker, mogstore and mysql nodes, node2 is only mogstore node, and now adding node2 is also tracker node, as follows:
1. Copy the configuration file / etc/mogilefs/mogilefsd.conf of node1 node tracker to node2
[root@centos7 ~] # scp / etc/mogilefs/mogilefsd.conf node2:/etc/mogilefs/mogilefsd.conf
two。 Edit the configuration file mogilefsd.conf on the node2 node to modify the connection database information, as follows:
3. Create the pid file directory and grant permissions, and then start the service.
[root@centos7 ~] # mkdir / var/run/mogilefsd/-p [root@centos7 ~] # chown-R mogilefs.mogilefs / var/run/mogilefsd/ [root@centos7 ~] # su-mogilefs-c "mogilefsd-c / etc/mogilefs/mogilefsd.conf-daemon" # View port 7001 [root@centos7 ~] # ss-tnlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *: 7500 *: * LISTEN 0 128 *: 7501 *: * LISTEN 0128 *: 22 *: * LISTEN 0 128 127.0.1 631 *: * LISTEN 0 *: 7001 *: * LISTEN 0 100 127.0.0.1 purl 25 *: * LISTEN 0 128 127.0.1 6010 *: * LISTEN 0 128 127.0.1 6011 *: * LISTEN 0 128: 22 : * LISTEN 0 128:: 1 631: * LISTEN 0 100:: 1:25: * LISTEN 0 128: : 1 6010: * LISTEN 0 128:: 1Rule 6011: *
4. Use mogadm to view the host,device,domain and upload the file, as follows:
[root@centos7 ~] # mogadm host list # View hostnode1 [1]: alive IP: 192.168.1.112:7500node2 [2]: alive IP: 192.168.1.113 root@centos7 7500 [root@centos7 ~] # mogadm device listnode1 [1]: alive used (G) free (G) total (G) weight (%) dev1: alive 3.673 36.308 39.980 100node2 [2]: alive used (G) free (G) total (G) weight (%) dev3: alive 0.399 39.581 39.980 100 dev4: alive 0.399 39.581 39.980 # mogadm domain list domain class mindevcount replpolicy hashtype- -files default 2 MultipleHosts () NONE p_w_picpaths default 2 MultipleHosts () NONE # upload file [root@centos7 ~] # mogupload-- trackers=192.168.1.113-- domain=p_w_picpaths-- key='/2.jpg'--file='/root/2.jpg' [root@centos7 ~] # mogfileinfo-- trackers=192.168.1.113-- domain=p_w_picpaths-- key='/2.jpg'- file: / 2.jpg class: default devcount: 2 domain: p_w_picpaths fid: 10 key: / 2.jpg length: 1247365-http://192.168.1.112:7500/dev1/0/000/000/0000000010.fid-http://192.168.1.113:7500/dev4/0/000/000/0000000010.fid
As mentioned above, it is the whole process of installation and deployment of the distributed file system MogileFS.
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: 209
*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.