未加星标

Building a GlusterFS cluster (CentOS 7)

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二05 | 时间 2018 | 作者 红领巾 ] 0人收藏点击收藏
Building a GlusterFS cluster (CentOS7)

Maciej Michalski

Constitution 3 nodes OS: CentOS 7 gluster 41 Creating file system forHadoop

List action:

Disk check Partition creation Disk check Format the device Mount OS restart as also mount 1. Diskcheck [root@glusterfs-node1 ~]# lsblk -a NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8: 0 0 50G 0 disk sda1 8:1 0 500M 0 part /boot sda2 8:2 0 49.5G 0 part centos-root 253:0 0 45.6G 0 lvm / centos-swap 253:1 0 3.9G 0 lvm [SWAP] sdb 8:16 0 50G 0 disk sr0 11: 0 1 1024M 0 rooms 2. Partition creation [root@glusterfs-node1 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xdea6092b. Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): First sector (2048-104857599, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): Using default value 104857599 Partition 1 of type Linux and of size 50 GiB is set Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. 3. Diskcheck [root@glusterfs-node1 ~]# lsblk -a NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8: 0 0 50G 0 disk sda1 8:1 0 500M 0 part /boot sda2 8:2 0 49.5G 0 part centos-root 253:0 0 45.6G 0 lvm / centos-swap 253:1 0 3.9G 0 lvm [SWAP] sdb 8:16 0 50G 0 disk sdb1 8:17 0 50G 0 part sr0 11: 0 1 1024M 0 rooms 4. Format thedevice [root@glusterfs-node1 ~]# mkfs.xfs /dev/sdb1 meta-data = / dev / sdb1 help = 512 agcount = 4, agsize = 3276736 blks = sectsz = 512 attr = 2, projid32bit = 1 = crc = 1 upbt = 0, sparse = 0 data = bsize=4096 blocks=13106944, imaxpct=25 = sunit=0 swidth=0 blks naming = version 2 bsize = 4096 ascii-ci = 0 ftype = 1 log =internal log bsize=4096 blocks=6399, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 5. Mount [root@glusterfs-node1 ~]# mkdir /data [root@glusterfs-node1 ~]# mount /dev/sdb1 /data [root@glusterfs-node1 ~]# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/mapper/centos-root xfs 47781076 1439964 46341112 4% / Devtmpfs devtmpfs 1928504 0 1928504 0% / dev tmpfs tmpfs 1940480 0 1940480 0% /dev/shm tmpfs tmpfs 1940480 8980 1931500 1% /run tmpfs tmpfs 1940480 0 1940480 0% /sys/fs/cgroup /dev/sda1 xfs 508588 301556 207032 60% /boot tmpfs tmpfs 388096 0 388096 0% /run/user/1000 /dev/sdb1 xfs 52402180 32944 52369236 1% /data 6. OS restart as alsomount

to the “/ etc / fstab” file

/dev/sdb1 /data xfs defaults 0 0

append

OS settings

List action:

Firewall, SELinux invalidation Hosts setting 1. Firewall, SELinux invalidation systemctl stop firewalld systemctl disable firewalld vi / etc / selinux / config ← changed to 'disabled' 2. Hostssetting

Add the following to “/ etc / hosts” file

192.168.11.110 glusterfs-node1.vsphere.local 192.168.11.111 glusterfs-node2.vsphere.local 192.168.11.112 glusterfs-node3.vsphere.local

GlusterFS installation

List action:

Installation 1.Installation yum install -y centos-release-gluster yum install -y glusterfs-server [root@glusterfs-node1 ~]# systemctl enable glusterd Created symlink from /etc/systemd/system/multi-user.target.wants/glusterd.service to /usr/lib/systemd/system/glusterd.service. [root@glusterfs-node1 ~]# systemctl start glusterd [root@glusterfs-node1 ~]# systemctl status glusterd ● glusterd.service - GlusterFS, a clustered file-system server Loaded: loaded (/usr/lib/systemd/system/glusterd.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2018-11-26 11:54:36 JST; 9s ago Process: 1556 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS) Main PID: 1557 (glusterd) CGroup: /system.slice/glusterd.service mq1557 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO Nov 26 11:54:36 glusterfs-node1.vsphere.local systemd[1]: Starting GlusterFS, a clustered file-system server... Nov 26 11:54:36 glusterfs-node1.vsphere.local systemd[1]: Started GlusterFS, a clustered file-system server. Create trusted server pool (node1) [root@glusterfs-node1 ~]# gluster peer probe glusterfs-node2.vsphere.local peer probe: success. [root@glusterfs-node1 ~]# gluster peer probe glusterfs-node3.vsphere.local peer probe: success. [root@glusterfs-node1 ~]# gluster peer status Number of Peers: 2 Hostname: glusterfs-node2.vsphere.local Uuid: 3af57bc4-9f3b-44fe-b9f6-59f06db9af85 State: Peer in Cluster (Connected) Hostname: glusterfs-node3.vsphere.local Uuid: f1419efb-1e7f-4ee6-98ad-90c4fea01736 State: Peer in Cluster (Connected) Volume creation

List action:

Confirm there is no volume Create distributed volume Confirmation Volume start 1. Confirm there is novolume [root@glusterfs-node1 ~]# gluster vol info No volumes present

Create a replica volume “vol_replica” that holds the same data in two replica volume creation nodes

[root@glusterfs-node1 ~]# gluster volume create vol_replica replica 2 glusterfs-node1.vsphere.local:/data/vol_replica glusterfs-node2.vsphere.local:/data/vol_replica Replica 2 volumes are prone to split-brain. Use Arbiter or Replica 3 to avoid this. See: http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/. Do you still want to continue? (y / n) and volume create: vol_replica: success: please start the volume to access data

Although it was recommended to create replica volumes on 3 nodes, this time ignoring creation and confirmation

[root@glusterfs-node1 ~]# gluster vol info Volume Name: vol_replica Type: Replicate Volume ID: 0766f185-4b61-457f-ae11-4f12b9ed08cc Status: Created Snapshot Count: 0 Number of Bricks: 1 x 2 = 2 Transport-type: tcp Bricks: Brick1: glusterfs-node1.vsphere.local:/data/

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

代码区博客精选文章
分页:12
转载请注明
本文标题:Building a GlusterFS cluster (CentOS 7)
本站链接:https://www.codesec.net/view/620913.html


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(170)