User Tools

Site Tools


proxmox:proxmox4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
proxmox:proxmox4 [2016/09/06 15:41] joseproxmox:proxmox4 [2019/08/03 19:32] (current) jose
Line 4: Line 4:
  
 En resumen, en cada disco creo 3 particiones: En resumen, en cada disco creo 3 particiones:
-32 Gb / y RAID +  32 Gb / y RAID 
-4 Gb swap +  4 Gb swap 
-El que sobri RAID+  Lo que sobre para glusterfs
  
-I faig dos RAIDS el de / con boot+Y hacemos RAID en / con opción boot 
 + 
 +====== Configuración de RED ====== 
 +Hacemos un bonding y encima un bridge con las dos tarjetas. 
 +  /etc/network/interfaces 
 + 
 +<code> 
 +auto lo 
 +iface lo inet loopback 
 + 
 +iface eth0 inet manual 
 + 
 +iface eth1 inet manual 
 + 
 +auto bond0 
 +iface bond0 inet manual 
 +    slaves eth0 eth1 
 +    bond-mode 802.3ad 
 +    bond-miimon 100 
 + 
 +auto vmbr0 
 +iface vmbr0 inet static 
 +        address  192.168.2.1 
 +        netmask  255.255.252.0 
 +        gateway  192.168.1.1 
 +        bridge_ports bond0 
 +        bridge_stp off 
 +        bridge_fd 0 
 +</code> 
 + 
 +En el switch tenemos que activar port trunk. En mi caso es un tplink tl sg 1024de y entro a la configuración en 192.168.0.1 
 + 
 +{{:proxmox:seleccion_999_371_.png?200|}} 
 + 
 +===== Configurado red containers ===== 
 +/etc/pve/lxc/101.conf 
 +  net0: name=eth0,bridge=vmbr0,gw=192.168.0.1,hwaddr=6A:7F:40:EE:21:43,ip=192.168.0.101/24,type=veth 
 +  net1: name=eth1,bridge=vmbr1,gw=10.91.168.1,hwaddr=4A:72:61:FF:FF:59,ip=10.91.168.101/24,type=veth
  
-Cuando instalo se queda el segundo RAID (el de datos) así: 
-  # cat /proc/mdstat 
-  md1 : active (auto-read-only) raid1 sdb3[1] sda3[0] 
-    resync=PENDING 
-     
-Para forzar resync: 
-  # mdadm --readwrite /dev/md1 
  
  
-http://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Jessie#Adapt_your_sources.list+====== Instalación Proxmox ====== 
 +Fuente: http://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Jessie#Adapt_your_sources.list
  
-Asegurarse que el valor que resuelva hostname lo tenga en el /etc/hosts+Asegurarse que el valor que resuelva hostname lo tenga en el /etc/hosts. Por ejemplo: 
 +  127.0.0.1 localhost 
 +  192.168.1.100 proxmoxescorxador
  
 +Añadimos repositorios de proxmox:
   echo "deb http://download.proxmox.com/debian jessie pvetest" > /etc/apt/sources.list.d/pve-install-repo.list   echo "deb http://download.proxmox.com/debian jessie pvetest" > /etc/apt/sources.list.d/pve-install-repo.list
  
Line 50: Line 84:
 Desde el primer nodo que será master Desde el primer nodo que será master
 <code> <code>
-root@proxmox01:/gluster# pvecm create clusterproxmox+root@proxmox1:~# pvecm create clusterproxmox
 Corosync Cluster Engine Authentication key generator. Corosync Cluster Engine Authentication key generator.
 Gathering 1024 bits for key from /dev/urandom. Gathering 1024 bits for key from /dev/urandom.
 Writing corosync key to /etc/corosync/authkey. Writing corosync key to /etc/corosync/authkey.
-root@proxmox01:/gluster# pvecm status+</code> 
 + 
 +<code> 
 +root@proxmox1:~# pvecm status
 Quorum information Quorum information
 ------------------ ------------------
-Date:             Tue Aug 11 23:23:53 2015+Date:             Mon Sep 12 22:37:19 2016
 Quorum provider:  corosync_votequorum Quorum provider:  corosync_votequorum
 Nodes:            1 Nodes:            1
 Node ID:          0x00000001 Node ID:          0x00000001
-Ring ID:          4+Ring ID:          1/4
 Quorate:          Yes Quorate:          Yes
  
Line 75: Line 112:
 ---------------------- ----------------------
     Nodeid      Votes Name     Nodeid      Votes Name
-0x00000001          1 192.168.1.(local)+0x00000001          1 192.168.2.(local)
 </code> </code>
  
-Desde el segundo nodo+Desde el segundo nodo lo añadimos poniendo la ip del primero
 <code> <code>
-root@proxmox02:/mnt# pvecm add 192.168.1.4 +root@proxmox2:~# pvecm add 192.168.2.1 
-The authenticity of host '192.168.1.(192.168.1.4)' can't be established. +The authenticity of host '192.168.2.(192.168.2.1)' can't be established. 
-ECDSA key fingerprint is 8a:88:8a:2a:d2:8f:96:62:c1:85:ab:fc:c7:23:00:11.+ECDSA key fingerprint is 3a:17:aa:ca:c4:1b:55:2a:12:bb:fe:b4:ed:af:1e:af.
 Are you sure you want to continue connecting (yes/no)? yes Are you sure you want to continue connecting (yes/no)? yes
-root@192.168.1.4's password: +root@192.168.2.1's password: 
 copy corosync auth key copy corosync auth key
 stopping pve-cluster service stopping pve-cluster service
Line 92: Line 129:
 merge known_hosts file merge known_hosts file
 restart services restart services
-successfully added node 'proxmox02' to cluster.+successfully added node 'proxmox2' to cluster. 
 +</code> 
 + 
 +Ahora vemos que ya hay dos miembros: 
 +<code> 
 +root@proxmox1:~# pvecm status 
 +Quorum information 
 +------------------ 
 +Date:             Mon Sep 12 22:47:44 2016 
 +Quorum provider:  corosync_votequorum 
 +Nodes:            2 
 +Node ID:          0x00000001 
 +Ring ID:          1/12 
 +Quorate:          Yes 
 + 
 +Votequorum information 
 +---------------------- 
 +Expected votes:   2 
 +Highest expected: 2 
 +Total votes:      2 
 +Quorum:             
 +Flags:            Quorate  
 + 
 +Membership information 
 +---------------------- 
 +    Nodeid      Votes Name 
 +0x00000001          1 192.168.2.1 (local) 
 +0x00000002          1 192.168.2.2 
 </code> </code>
  
Line 108: Line 173:
 https://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-debian-wheezy-automatic-file-replication-mirror-across-two-storage-servers https://www.howtoforge.com/high-availability-storage-with-glusterfs-3.2.x-on-debian-wheezy-automatic-file-replication-mirror-across-two-storage-servers
  
-Versión 3.7.3 Gluster+Instalamos versión 3.7 que es la estable
-  http://download.gluster.org/pub/gluster/glusterfs/3.7/3.7.3/Debian/jessie/apt/+  http://download.gluster.org/pub/gluster/glusterfs/3.7/LATEST/Debian/jessie/ 
 +   
 +Instalamos: 
 +  wget -O - http://download.gluster.org/pub/gluster/glusterfs/LATEST/rsa.pub | apt-key add - 
 +  echo deb http://download.gluster.org/pub/gluster/glusterfs/LATEST/Debian/jessie/apt jessie main > /etc/apt/sources.list.d/gluster.list  
 +  apt-get update 
 +  apt-get install glusterfs-server
  
-De las dos máquinas +Queremos montar lo siguiente:
-  # gluster peer probe gluster01 +
-  peer probesuccess. +
  
-  #  gluster peer probe gluster02 +{{:proxmox:image.png?300|}} 
-  peer probesuccessProbe on localhost not needed + 
-  +En el /etc/hosts añadimos los dos servidores:
 <code> <code>
-root@proxmox01:/mnt# gluster peer status+root@proxmox1:~# cat /etc/hosts 
 +127.0.0.1 localhost 
 +192.168.2.1 proxmox1 
 + 
 +192.168.2.2     proxmox2 
 +</code> 
 + 
 +Conectamos los dos servidores. Desde el server1: 
 +  root@proxmox1:~# gluster peer probe proxmox2 
 +Vemos que están conectados: 
 +<code> 
 +root@proxmox1:~# gluster peer status
 Number of Peers: 1 Number of Peers: 1
  
-Hostname: proxmox02 +Hostname: proxmox2 
-Uuid: e95baaf8-8029-4181-89f3-d9e3ebbb9648+Uuid: 62eecf86-2e71-4487-ac5b-9b5f16dc0382
 State: Peer in Cluster (Connected) State: Peer in Cluster (Connected)
 </code> </code>
 +
 +Y desde el server2 igual
 <code> <code>
-root@proxmox02:/gluster# gluster peer status+root@proxmox2:~# gluster peer status
 Number of Peers: 1 Number of Peers: 1
  
-Hostname: proxmox01 +Hostname: proxmox1 
-Uuid: 67d84d45-7551-4b45-b068-8230d1b05cb6+Uuid: 061807e7-75a6-4636-adde-e9fef4cfa3ec
 State: Peer in Cluster (Connected) State: Peer in Cluster (Connected)
 </code> </code>
  
 +Creamos las particiones y formateamos en xfs
 +<code>
  
  
  
-Creamos el volumen: +</code>
-  # gluster volume create volumen_gluster replica 2 transport tcp gluster01:/mnt/gluster gluster02:/mnt/gluster force +
-  volume create: volumen_gluster: success: please start the volume to access data+
  
-Lo iniciamos: +Montamos las particiones en /gluster/brick1 y /gluster/brick2
-  root@proxmox01:~# gluster volume start volumen_gluster +
-  volume start: volumen_gluster: success+
  
-Miramos el estado:   +  blkid
-  gluster volume status+
  
 +  /dev/sda3: UUID="6afd599f-ea83-4c19-bc71-8ebfce42a332" TYPE="xfs"
 +  /dev/sdb3: UUID="bd39fa7a-6b23-4b43-89e0-693b61ba4581" TYPE="xfs"
 +
 +Fichero /etc/fstab
 <code> <code>
 +#brick 1
 +UUID="6afd599f-ea83-4c19-bc71-8ebfce42a332" /glusterfs/brick1  xfs rw,inode64,noatime,nouuid 0 1
 +
 +#brick 2
 +UUID="bd39fa7a-6b23-4b43-89e0-693b61ba4581" /glusterfs/brick2 xfs  rw,inode64,noatime,nouuid 0 1
 +</code>
 +Creamos el volúmen. Mejor un volumen grande que dos pequeños:
 +  gluster volume create volumen_gluster replica 2 transport tcp proxmox1:/bricks/disc1/brick1 proxmox2:/bricks/disc1/brick1 proxmox1:/bricks/disc2/brick2 proxmox2:/bricks/disc2/brick2
 +volume create: volumen_gluster: success: please start the volume to access data
 +
 +
 +Lo iniciamos:
 +<code>
 +root@proxmox1:~# gluster volume start volumen_gluster
 +volume start: volumen_gluster1: success
 +</code>
 +
 +Miramos el estado:
 +<code># gluster volume status
 Status of volume: volumen_gluster Status of volume: volumen_gluster
 Gluster process                             TCP Port  RDMA Port  Online  Pid Gluster process                             TCP Port  RDMA Port  Online  Pid
 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-Brick proxmox01:/gluster/proxmox            49152              Y       16096 +Brick proxmox1:/bricks/disc1/brick1         49152              Y       8938  
-NFS Server on localhost                     2049      0          Y       16120 +Brick proxmox2:/bricks/disc1/brick1         49154     0          Y       7721  
-Self-heal Daemon on localhost               N/      N/       Y       16125+Brick proxmox1:/bricks/disc2/brick2         49153              Y       8957  
 +Brick proxmox2:/bricks/disc2/brick2         49155              Y       7740  
 +Self-heal Daemon on localhost               N/      N/       Y       8977  
 +Self-heal Daemon on proxmox2                N/A       N/       Y       7760  
 +  
 +Task Status of Volume volumen_gluster 
 +------------------------------------------------------------------------------ 
 +There are no active volume tasks 
 </code> </code>
  
 ===== Conectar como cliente ===== ===== Conectar como cliente =====
-  #mount -t glusterfs proxmox01:/volumen_gluster /mnt/glusterfs+  #mount -t glusterfs proxmox1:/volumen_gluster /glusterfs 
 +  
 /etc/fstab /etc/fstab
-  proxmox01:/volumen_gluster /mnt/glusterfs glusterfs defaults,_netdev 0 2+  proxmox1:/volumen_gluster /glusterfs glusterfs defaults,_netdev 0 2
      
-En un container lxc falla, hay que crear fuse a mano: +====== Almacenamiento compartido Proxmox ====== 
-   mknod /dev/fuse c 10 229+De momento los containers no soportan GlusterFS directamente desde proxmox, las VMs si.
  
-   +Montamos /glusterfs y lo ponemos como almacenamiento de Containers (y también de VMs):
-  +
  
 +{{:proxmox:seleccion_999_369_.png|}}
  
-====== Almacenamiento compartido Proxmox ====== 
  
  
-  +{{:proxmox:seleccion_999_370_.png|}} 
 + 
 +====== NFS ====== 
 +Montamos el recurso por nfs en el servidor de proxmox. En los containers los montamos por bind: 
 + 
 +En la carpeta /etc/pve/lxc editamos los ficheros *.conf 
 + 
 +**Nota:** No poner / delante de container/folder 
 +  lxc.mount.entry: /host/folder container/folder  none bind,create=dir,optional 0 0 
 +**Fuente:** https://pve.proxmox.com/wiki/LXC_Bind_Mounts 
 +Ejemplo: 
 +  lxc.mount.entry: /mnt/pelis mnt/pelis  none bind,create=dir,optional 0 0 
 +  lxc.mount.entry: /mnt/series mnt/series  none bind,create=dir,optional 0 0
proxmox/proxmox4.1473176467.txt.gz · Last modified: 2016/09/06 15:41 by jose