linux:filesystem:glusterfs

Diferències

Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.

Enllaç a la visualització de la comparació

Ambdós costats versió prèvia Revisió prèvia
Següent revisió
Revisió prèvia
linux:filesystem:glusterfs [05/12/2020 07:10] – [vagrant] matelinux:filesystem:glusterfs [06/12/2020 03:39] (actual) – [peers] mate
Línia 1: Línia 1:
 = glusterfs = glusterfs
- +  * [[linux:filesystem:glusterfs:vagrantpoc]]
-== vagrant +
-  require: ''vagrant plugin install vagrant-hosts'' +
-<code ruby Vagrantfile> +
-VAGRANTFILE_API_VERSION = "2" +
-  +
-cluster = { +
-  "node1" => { :ip => "10.0.0.10", :cpus => 1, :mem => 1024 }, +
-  "node2" => { :ip => "10.0.0.20", :cpus => 1, :mem => 1024 }, +
-  "node3" => { :ip => "10.0.0.30", :cpus => 1, :mem => 1024 } +
-+
-  +
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| +
-  +
-  cluster.each_with_index do |(hostname, info), index| +
-  +
-    config.vm.define hostname do |cfg| +
- +
-      cfg.vm.provider :virtualbox do |vb, override| +
-        config.vm.box = "debian/buster64" +
-        override.vm.network :private_network, ip: "#{info[:ip]}" +
-        override.vm.hostname = hostname +
-        vb.name = hostname +
-        vb.customize ["modifyvm", :id, "--memory", info[:mem], "--cpus", info[:cpus], "--hwvirtex", "on"] +
- +
-        file_to_disk = 'data/' + hostname + '-disk.vdi' +
-        unless File.exist?(file_to_disk) +
-          vb.customize ['createhd',  +
-                        '--filename', file_to_disk,  +
-                        '--size', 5 * 1024] +
-        end +
-        vb.customize ['storageattach', :id,  +
-                      '--storagectl', 'SATA Controller',  +
-                      '--port', 1,  +
-                      '--device', 0,  +
-                      '--type', 'hdd',  +
-                      '--medium', file_to_disk] +
- +
-      end # end provider +
-       +
-      config.vm.provision 'shell', path: './data/allnodes.sh' +
-      config.vm.provision :hosts, :sync_hosts => true +
-       +
-      node_script = './data/' + hostname + '.sh' +
-      if File.exists?(node_script) then +
-        config.vm.provision "file", source: node_script, destination: "$HOME/" +
-      else +
-        config.vm.provision "shell", inline: "echo SCRIPT not found!" +
-      end +
-     +
-    end # end config +
-  +
-  end # end cluster +
-end +
-</code> +
-<code bash allnodes.sh> +
-[[ ! -f /etc/provision_env_disk_added_date ]] && { +
- +
-  echo 'type=83' | sudo sfdisk /dev/sdb +
-  sudo mkfs.ext4 /dev/sdb1 +
-  sudo mkdir -p /exports/sdb1 +
-  echo "/dev/sdb1      /exports/sdb1   ext4 user,auto,defaults           0" | sudo tee --append /etc/fstab +
-  sudo date > /etc/provision_env_disk_added_date +
- +
-+
- +
-mount /exports/sdb1 +
-sudo mkdir /exports/sdb1/brick1 +
- +
-sudo apt-get -y install gnupg +
-wget -O - https://download.gluster.org/pub/gluster/glusterfs/7/rsa.pub | sudo apt-key add - +
-# DEBID=$(grep 'VERSION_ID=' /etc/os-release | cut -d '=' -f 2 | tr -d '"'+
-# DEBVER=$(grep 'VERSION=' /etc/os-release | grep -Eo '[a-z]+'+
-# DEBARCH=$(dpkg --print-architecture) +
-# echo "deb https://download.gluster.org/pub/gluster/glusterfs/LATEST/Debian/${DEBID}/${DEBARCH}/apt ${DEBVER} main" | sudo tee /etc/apt/sources.list.d/gluster.list +
-echo "deb https://download.gluster.org/pub/gluster/glusterfs/LATEST/Debian/10/amd64/apt buster main" | sudo tee /etc/apt/sources.list.d/gluster.list +
- +
-sudo apt-get -y update +
- +
-sudo apt-get -y install glusterfs-server +
-sudo systemctl start glusterd +
-sudo systemctl enable glusterd +
- +
-</code> +
-<code bash node1.sh> +
-#!/bin/bash +
- +
-sudo gluster peer probe node2 +
-sudo gluster peer probe node3 +
- +
-sudo gluster volume create gv0 replica 3 \ +
-  node1:/exports/sdb1/brick1 \ +
-  node2:/exports/sdb1/brick1 \ +
-  node3:/exports/sdb1/brick1 +
- +
-sudo gluster volume start gv0 +
- +
-sudo mount -t glusterfs node1:/gv0 /mnt +
-</code> +
-<code bash node{2,3}.sh> +
-#! /bin/bash +
- +
-sudo mount -t glusterfs node1:/gv0 /mnt +
-</code> +
-  * enb lugar de **node1**, podría ser cualquier otro de los dos nodos+
 == links == links
   * [[https://docs.gluster.org/en/latest/Quick-Start-Guide/Quickstart/]]   * [[https://docs.gluster.org/en/latest/Quick-Start-Guide/Quickstart/]]
Línia 115: Línia 11:
   * [[https://docs.gluster.org/en/latest/CLI-Reference/cli-main/]]   * [[https://docs.gluster.org/en/latest/CLI-Reference/cli-main/]]
   * [[https://docs.gluster.org/en/latest/Install-Guide/Install/]]   * [[https://docs.gluster.org/en/latest/Install-Guide/Install/]]
- 
- 
 == logs == logs
   * [[https://docs.gluster.org/en/latest/Administrator%20Guide/Logging/]]   * [[https://docs.gluster.org/en/latest/Administrator%20Guide/Logging/]]
Línia 182: Línia 76:
  
 === peers === peers
 +  * o TSP = Trusted Server Pool:<code bash>gluster pool list</code>
   * afegir un nou node (ja configurat):<code bash>gluster peer probe <HOSTNAME></code>   * afegir un nou node (ja configurat):<code bash>gluster peer probe <HOSTNAME></code>
 +  * treure node:<code bash>gluster peer detach <HOSTNAME></code>
   * status dels nodes:<code bash>gluster peer status</code>   * status dels nodes:<code bash>gluster peer status</code>
  
  • linux/filesystem/glusterfs.1607181048.txt.gz
  • Darrera modificació: 05/12/2020 07:10
  • per mate