In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Distributed:
Concept of distributed storage or distributed file system:
Each of the multiple computers provides a certain storage space to store data, and the data is stored evenly on each node through the metadata server.
Metadata: data that describes data, mainly data attributes, and is used to support functions such as indicating storage location, resource lookup, file records, etc.
Distributed file system: can be directly mounted on the system for access
Distributed storage: can only be accessed through API
There are metadata node servers: metadata nodes store metadata, data nodes store data
No metadata node server: each data node holds complete metadata and part of the data
Common software:
GFS:google file system
HDFS:Hadoop file system
TFS:taobao (Taobao) file system
Distributed File system implemented in ceph:linux Kernel
MooseFS: lightweight distributed file system
MogileFS: lightweight distributed file system with higher performance than moosefs
MogileFS
MogileFS has three components:
Tracker: the core node of the file system cluster, which stores metadata based on the database. It is mainly used to monitor and instruct storage nodes to complete data addition, deletion, query, and data replication between nodes. Tracker nodes usually have multiple nodes to achieve load balancing and high availability.
Storage: the location where the actual data is stored, and the file can be created, deleted, renamed, etc.
Database: stores metadata and global information of Tracker nodes
Implementation principle: in MogileFS, each data block will have multiple copies, stored on multiple storage (usually 3 copies), and the storage location of each data block will be separated on Tracker. If a storage node is not online, when the client requests data from the Tracker node, the Tracker node will return the storage location of the copy to the client. This ensures the high availability of the entire cluster. 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.
Installation configuration:
Environment preparation: [epel] nama=epel package baseurl= http://mirrors.aliyun.com/epel/6/x86_64/ # Ali yum Source gpgcheck=1 enabled=1 gpgkey= http://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-6 yum-y install Perlbal # install Perl package management tool yum-y install perl-DBI # install other dependency packages yum-y install perl-DBD-MySQL # connect database module yum-y install perl-Danga-Socket yum-y install perl-IO-AIO yum-y install perl-Net-Netmask yum -y install cpan # perl module management tool yum-y install mysql mysql-server # installation database cpan # the first time you use the perl package management tool, you need to enter yes to configure the environment cpan [1] > install MogileFS::Client # install MogileFS::Client using cpan Cpan [1] > install MogileFS::Utils installation mogilefs: wget http://search.cpan.org/CPAN/authors/id/D/DO/DORMANDO/MogileFS-Server-2.44.tar.gz tar zxvf MogileFS-Server-2.44.tar.gz-C / usr/src/ cd / usr/src/MogileFS-Server-2.44 perl Makefile.PL # check the environment make & & make install # compile, install and configure mysql database: chkconfig-- add mysqld chkconfig mysqld on service mysqld start # launch mysql mysqladmin-uroot password 123.com # set root password mysql-uroot-p # connect to database create database mogilefs # create database grant all on mogilefs.* to 'mogilefs'@'192.168.%.%' identified by' 456.compose; # authorized user flush privileges Mogdbsetup-- dbhost=192.168.0.10-- dbrootpass='123.com'-- dbuser=mogilefs-- dbpass='456.com'-- dbhost= # database address. Default is localhost-- dbport= # port. Default is 3306-the library name of the dbname= # connection. Default mogilefs-- dbrootuser= # initialization library user, default root-- dbrootpass= # root password, default blank-- dbuser= # connection initialization library user, default mogilefs-- dbpass= # initial user password, default is empty
Configure mogilefs: useradd-r mogilefs # to create a running user Mogilefs cannot run mkdir / etc/mogilefs mkdir / var/run/mogilefsd # pid file location as root user vim / etc/mogilefs/mogilefsd.conf # create configuration file pidfile = / var/run/mogilefsd/mogilefsd.pid # pid file location db_dsn = DBI:mysql:mogilefs:host=192.168.0.10 Port=3306 Mysql_connect_timeout=5 # Information about connecting to the database daemonize = 1 # run as daemon db_user = mogilefs # username db_pass = 456.com # password corresponding to user name listen = 0. 0.0.0 conf_port 7001 # listeners conf_port = 7001 query_jobs = 10 # number of processes used for query delete_jobs = 1 # number of processes used for delete operation replicate_jobs = 5 # number of processes used for replication Reaper_jobs = 1 # number of processes used to recycle resources chown-R mogilefs:mogilefs / etc/mogilefs # modify the master group chown-R mogilefs:mogilefs / var/run/mogilefsd su-mogilefs-c "mogilefsd-c / etc/mogilefs/mogilefsd.conf-daemon" # start the service ss -tnl | grep 7001 # check whether the service starts storage configuration: install the same package as Tracker If not as Tracker, you do not need to configure the installation database useradd-r mogilefs # to create the running user mkdir-pv / mogilefs/data/dev1 # to create a data storage directory Dev1 must have a device that represents the first storage mkdir / etc/mogilefs vim / etc/mogilefs/mogstored.conf maxconns = 1000 # maximum number of concurrent connections httplisten = 0.0.0.0mkdir 7500 # http listening address mgmtlisten = 0.0.0.0mkdir 7501 # management interface listening Address docroot = / mogilefs/data # directory for storage chown-R mogilefs:mogilefs / etc/mogilefs # modify subordinate group chown-R mogilefs:mogilefs / mogilefs/ su-mogilefs-c "mogstored-c / etc/mogilefs/mogstored.conf-- daemon" # launch service ss-ntl | grep 7500 Ss-ntl | grep 7501mogilefs Management: mogadm check # check status mogadm device list # check the status of each node mogadm host list # check the situation of each node mogadm host add 192.168.0.10-- ip=192.168.0.10-- status=alive # add nodes 192.168.0.10 tag name mogadm host add 192.168.0.50-- ip=192.168.0.50-- status=alive # add Node 192.168.0.50 tag name mogadm device add 192.168.0.10 1 # add first node mogadm device add 192.168.0.50 2 # add second node mogadm domain list # View domain mogadm domain add www # add www domain mogadm-- Trackers=192.168.0.10:7001 class add www user-- mindevcount=2 # add the user class in the www domain Mindevcount: minimum number of copies of files replpolicy: number of copies mogupload-- trackers=192.168.0.10:7001-- domain=www-- key='pwd'-- file='/etc/passwd' # upload file key: upload and save location File based on dev: local file mogfileinfo-- trackers=192.168.0.10:7001-- domain=www-- key='pwd' # View file moglistkeys-- trackers=192.168.0.10-- domain=www # list all key
Configuration example:
Experimental environment: centos6.5 192.168.0.10 Nginx 192.168.0.20 mysql 192.168.0.30 mogilefs 192.168.0.40 mogilefs 192.168.0.50 mogilefs 1, Configure mogilefs: mogadm-- trackers=192.168.0.30 host add 192.168.0.30-- ip=192.168.0.30-- status=alive mogadm-- trackers=192.168.0.30 host add 192.168.0.40-- ip=192.168.0.40-- status=alive mogadm-- trackers=192.168.0.30 host add 192.168.0.50-- ip=192.168.0.50-- status=alive mogadm domain add www mogupload-- trackers=192.168.0.10:7001- -domain=www-- key='pwd'-- file='/etc/passwd' 2 Compile and install nginx: groupadd-r nginx useradd-r-g nginx nginx yum-y install pcre-devel tar zxvf nginx-1.8.1.tar.gz-C / usr/src/ tar zxvf nginx_mogilefs_module-1.0.4.tar.gz-C / usr/src/ # support mogilefs third-party module. / configure-- prefix=/usr/local/nginx -- user=nginx-- group=nginx-- add-module=/usr/src/nginx_mogilefs_module-1.0.4/-- add-module: specify the third-party module location make & & make install 3, Configure nginx: http {include mime.types Default_type application/octet-stream; upstream mogfs {# tracker address server 192.168.0.30 server 7001; server 192.168.0.40 server 7001; server 192.168.0.50 server 7001;} sendfile on; keepalive_timeout 65 Server {listen 80; server_name localhost; location / img/ {# enable mogilefs Cluster mogilefs_tracker mogfs; # tracker address mogilefs_domain www # specify domain mogilefs_noverify on; # do not verify mogilefs_methods GET; # request method mogilefs_pass {proxy_pass $mogilefs_path # must be written like this, $mogilefs_path module built-in variable proxy_hide_header Content-Type; # hides Content-Type proxy_buffering off # close cache}} 4, verify 1, access http://192.168.0.10/img/pwd 2, close 192.168.0.30 to continue access Check whether the access is normal
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.