-
Data Storage Trends and Big Data Challenges
-
Distributed Storage and CAP Theorem
-
file system
-
Mogilefs Basic Principles
-
Mogilefs Implementation
-
Nginx Reverse Proxy for Tracker Nodes
| Google Filesystem | GFS+MapReducefile |
| Hadoop Distributed Filesystem | GFS +MapReduce, file |
| ClusterFS | file |
| Taobao Filesystem | file |
| MogileFS | file |
| Ceph | is a Linux PB file system |
| MooseFS | , can not |
| Lustre | file system |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
##### Databasenode mariadbGRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'mypass';CREATE DATABASE mogilefs;GRANT ALL ON mogilefs.* TO 'moguser'@'%' IDENTIFIED BY 'mogpass';FLUSH PRIVILEGES;##### Trackernode (can is all node )Installation mogilefsconfiguration file vim /etc/mogilefs/mogilefsd.conf daemonize = 1pidfile = /var/run/mogilefsd/mogilefsd.piddb_dsn = DBI:mysql:mogilefs:host=192.168.1.241db_user = moguserdb_pass = mogpasslisten = 0.0.0.0:7001conf_port = 7001query_jobs = 100delete_jobs = 1replicate_jobs = 5reaper_jobs = 1service mogilefsd start #service ss -tanlp (LISTEN 0 128 192.168.1.241:7001 )##### storagenode (can is all node )Installation mogilefsmkdir /mogdata/dev1 -pv #directory chown -R mogilefs.mogilefs /mogdata/dev2/ #vim /etc/mogilefs/mogstored.confmaxconns = 10000httplisten = 0.0.0.0:7500mgmtlisten = 0.0.0.0:7501docroot = /mogdata #directory service mogstored startss -tanlp (*:7500)##### trackernode storagenode and command mogadm check #node mogadm host list #each node a hostmogadm host add 192.168.1.213 --ip=192.168.1.213 --ip=192.168.1.213 --status=alive #a node mogadm host add 192.168.1.242 --ip=192.168.1.242 --ip=192.168.1.242 --status=alive #a node mogadm host add 192.168.1.241 --ip=192.168.1.241 --ip=192.168.1.241 --status=alive #a node mogadm device add 192.168.1.213 1 #a , not can mogadm device add 192.168.1.242 2 #mogadm device add 192.168.1.241 3 #mogadm check #can view status mogadm domain add files #file mogadm domain add images #mogadm domain list #view all mogupload --trackers=192.168.1.241 --domain=files --key='/fstab' --file='/etc/fstab' #fstabfile , key'/fstab'mogfileinfo --trackers=192.168.1.241 --domain=files --key='/fstab' #according to keyview file information |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
##### configuration Nginxtngyum install pcre-devel -yyum groupinstall "Development Tools" "Server Platform Development"yum install libxslt-devel gd-devel lua-devel geoip-develtengine-1.5.1.tar.gznginx-mogilefs-module-master.zip #mogilefsneed mkdir -pv /var/tmp/nginx/client #need unzip nginx-mogilefs-module-master.zipuseradd -r nginx./configure / --prefix=/usr/local/nginx / --sbin-path=/usr/local/nginx/sbin/nginx / --conf-path=/etc/nginx/nginx.conf / --error-log-path=/var/log/nginx/error.log / --http-log-path=/var/log/nginx/access.log / --pid-path=/var/run/nginx/nginx.pid / --lock-path=/var/lock/nginx.lock / --user=nginx / --group=nginx / --enable-mods-shared=all / --add-module=/nginx-mogilefs-module-mastermake && make installvim /etc/profile.d/nginx.shexport PATH=/usr/local/nginx/sbin:$PATH. !$provide Script.....configuration nginxvim /etc/nginx/nginx.cfgupstream trackers { server 192.168.1.242:7001 weight=1; server 192.168.1.213:7001 weight=1; server 192.168.1.241:7001 backup; check interval=3000 rise=2 fall=5 timeout=1000; check_http_send "GET / HTTP/1.0/r/n/r/n"; check_http_expect_alive http_2xx http_3xx; }location /jpg/ { mogilefs_tracker trackers; mogilefs_domain images; mogilefs_methods GET; mogilefs_pass { proxy_pass $mogilefs_path; proxy_hide_header Content-Type; proxy_buffering off; } }##### configuration keepalivedkeepalivedvim /etc/keepalived/keepalived.conf # backup priority 99global_defs { notification_email { root@localhost } notification_email_from admin@localhost smtp_server 127.0.0.1 smtp_connect_timeout 30 router_id LTT}vrrp_script chk_nginx { script "killall -0 nginx" interval 1 weight -2 fall 2 rise 1}vrrp_instance IN_1 { state MASTER interface eth0 virtual_router_id 22 priority 100 advert_int 1 authentication { auth_type PASS auth_pass aaaa } virtual_ipaddress { 192.168.1.222 } track_script { chk_nginx}} |

