Instalación de máquina
- Instalación de máquina virtual con ubuntu 18
Establecemos ip fija
- Establecemos ip fija en la VLAN 201 y VLAN 210
- Agregamos dos interfaces de red una en cada VLAN con VirtIO
- Luego abrimos:
nano /etc/netplan/50-cloud-init.yaml
- Remplazamos el contenido por
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
ens18:
addresses:
- 10.20.200.66/24
gateway4: 10.20.200.1
nameservers:
addresses:
- 10.20.200.36
search:
- siua.ac.cr
ens19:
addresses:
- 10.20.210.66/24
version: 2
- Netplan
netplan generate
netplan apply
Actualizamos el sistema
- Actualización: guía
Instalación de Bluecherry
- Instalamos
bash -c "$(wget -O - https://dl.bluecherrydvr.com/scripts/install)"
- Nos pide el nombre usuario de administración de base de datos «root»
- Contraseña: HB0
- Establecemos el nombre la la base de datos «bluecherry»
- Usuario de conexión del sistema «remoto»
- Contraseña: RB0
- Ingresamos al navegador
https://vigilancia2.siua.ac.cr:7001/login
- Ingresamos con las credenciales
- Usuario: «Admin»
- pass: «bluecherry»
Agregar NAS PERSEFONE al Servidor
- Instalar open-iscsi
apt-get install open-iscsi -y
- Establecemos que el servicio inicie al arrancar la maquina
nano /etc/iscsi/iscsid.conf
- REMPLAZAR:
node.startup = manual
X
node.startup = automatic
- Paso 4: mandamos a descubrir el NAS
PERSEFONE
iscsiadm -m discovery -t sendtargets -p 10.20.210.40
- RESULTADO
10.20.210.40:3260,1 iqn.1995-05.com.seagate:persefone.iscsi6
10.20.200.40:3260,1 iqn.1995-05.com.seagate:persefone.iscsi6
- Para ver los target descubiertos
iscsiadm -m discovery
- RESULTADO:
PERSEFONE
10.20.210.40:3260 via sendtargets
- Podemos consultar también la información del target
PERSEFONE
iscsiadm -m node –targetname iqn.1995-05.com.seagate:persefone.iscsi6 -p 10.20.210.40
- RESULTADO EJEMPLO PERSEFONE
# BEGIN RECORD 2.0-874
node.name = iqn.1995-05.com.seagate:persefone.iscsi6
node.tpgt = 1
node.startup = automatic
node.leading_login = No
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.gateway = <empty>
iface.subnet_mask = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
iface.state = <empty>
iface.vlan_id = 0
iface.vlan_priority = 0
iface.vlan_state = <empty>
iface.iface_num = 0
iface.mtu = 0
iface.port = 0
iface.bootproto = <empty>
iface.dhcp_alt_client_id_state = <empty>
iface.dhcp_alt_client_id = <empty>
iface.dhcp_dns = <empty>
iface.dhcp_learn_iqn = <empty>
iface.dhcp_req_vendor_id_state = <empty>
iface.dhcp_vendor_id_state = <empty>
iface.dhcp_vendor_id = <empty>
iface.dhcp_slp_da = <empty>
iface.fragmentation = <empty>
iface.gratuitous_arp = <empty>
iface.incoming_forwarding = <empty>
iface.tos_state = <empty>
iface.tos = 0
iface.ttl = 0
iface.delayed_ack = <empty>
iface.tcp_nagle = <empty>
iface.tcp_wsf_state = <empty>
iface.tcp_wsf = 0
iface.tcp_timer_scale = 0
iface.tcp_timestamp = <empty>
iface.redirect = <empty>
iface.def_task_mgmt_timeout = 0
iface.header_digest = <empty>
iface.data_digest = <empty>
iface.immediate_data = <empty>
iface.initial_r2t = <empty>
iface.data_seq_inorder = <empty>
iface.data_pdu_inorder = <empty>
iface.erl = 0
iface.max_receive_data_len = 0
iface.first_burst_len = 0
iface.max_outstanding_r2t = 0
iface.max_burst_len = 0
iface.chap_auth = <empty>
iface.bidi_chap = <empty>
iface.strict_login_compliance = <empty>
iface.discovery_auth = <empty>
iface.discovery_logout = <empty>
node.discovery_address = 10.20.210.40
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.nr_sessions = 1
node.session.auth.authmethod = None
node.session.auth.username = <empty>
node.session.auth.password = <empty>
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 30
node.session.err_timeo.tgt_reset_timeout = 30
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 10.20.210.40
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD
- Paso 5: actualizamos el nombre de usuario y contraseña
PERSEFONE
iscsiadm -m node --targetname iqn.1995-05.com.seagate:persefone.iscsi6 -p 10.20.210.40 -o update -n node.session.auth.username -v ugit
iscsiadm -m node --targetname iqn.1995-05.com.seagate:persefone.iscsi6 -p 10.20.210.40 -o update -n node.session.auth.password -v CADM8000
- Paso 6: Logearnos en el NAS
PERSEFONE
iscsiadm -m node --targetname iqn.1995-05.com.seagate:persefone.iscsi6 -p 10.20.210.40 -l
- RESULTADO
Logging in to [iface: default, target: iqn.1995-05.com.seagate:persefone.iscsi6, portal: 10.20.210.40,3260] (multiple)
Login to [iface: default, target: iqn.1995-05.com.seagate:persefone.iscsi6, portal: 10.20.210.40,3260] successful.
- Podemos comprobar la conexión
dmesg
- RESULTADO:
[2329447.148837] sd 3:0:0:0: [sdb] Attached SCSI disk
- Paso 7: le indicamos que se arranque le servicio de forma automática
PERSEFONE
iscsiadm -m node --targetname iqn.1995-05.com.seagate:persefone.iscsi6 -p 10.20.210.40 -o update -n node.conn[0].startup -v automatic
- Paso 8: reiniciamos el servicio
/etc/init.d/open-iscsi restart
o
/etc/init.d/open-iscsi stop
/etc/init.d/open-iscsi start
- Paso 9: Creamos las reglas para que se monte automáticamente
nano /etc/udev/rules.d/z99_open-iSCSI.rules
- AGREGAMOS
ENV{ID_PATH}=="*iscsi*", RUN+="/bin/mount -a -O _netdev"
- Paso 10: creamos una carpeta para montar el disco
PERSEFONE
mkdir /media/PERSEFONE
- Paso 11: le damos permisos
chmod 777 -R /media/PERSEFONE
- Paso 12: formatear el disco
- Paso 12.1: consultamos los discos disponibles
fdisk -l
- RESULTADO:
Disk /dev/sdb: 14,4 TiB, 15824000000000 bytes, 30906250000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 8388608 bytes
Disklabel type: gpt
Disk identifier: A634D57E-540A-4660-888D-FE0043404F5F
- Paso 12.2: instalamos la herramienta «parted»
apt-get update && apt-get install parted -y
- Paso 12.3: Ingresamos a la herramienta parted para el disco sdb
parted /dev/sdb
- Paso 12.4: Le establecemos una tabla de particiones
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
- Paso 12.5: Establecemos el medida
(parted) unit TB
- Paso 12.6: Creamos la partición
(parted) mkpart primary 0TB 14.4TB
- Paso 12.7: Salimos
(parted) quit
- Paso 12.8: Ahora si volvemos a ejecutar fdisk, vemos que ya tenemos una partición «sdj1»
fdisk -l
- RESULTADO:
Disk /dev/sdb: 14,4 TiB, 15824000000000 bytes, 30906250000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 8388608 bytes
Disklabel type: gpt
Disk identifier: B3DD4117-F57B-486C-839D-94E0D651892B
Device Start End Sectors Size Type
/dev/sdb1 16384 27343749119 27343732736 12,8T Linux filesystem
- Paso 12.9: Establecemos un sistema de archivos (puede tardar un tiempo)
mkfs.ext4 /dev/sdb1
- RESULTADO:
mke2fs 1.44.1 (24-Mar-2018)
/dev/sdb1 contains a ext4 file system labelled 'PERSEFONE'
last mounted on Wed Oct 2 16:26:46 2019
Proceed anyway? (y,N) y
Creating filesystem with 3417966592 4k blocks and 427249664 inodes
Filesystem UUID: 38caaa9c-a048-4784-993a-763f361c76eb
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,
2560000000
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
- Paso 12.10: Le creamos una etiqueta
PERSEFONE
e2label /dev/sdb1 PERSEFONE
- Paso 13: Determinamos el UUID
blkid
- RESULTADO
/dev/sdb1: LABEL=»PERSEFONE» UUID=»38caaa9c-a048-4784-993a-763f361c76eb» TYPE=»ext4″ PARTLABEL=»primary» PARTUUID=»e680e48b-b92d-495d-a1a1-d90be05bcf1c»
- Paso 14: abrimos el «fstab»
nano /etc/fstab
- Paso 15: Agregamos
UUID=38caaa9c-a048-4784-993a-763f361c76eb /media/PERSEFONE ext4 _netdev 0 0
- Paso 16: reiniciamos
reboot
- Ahora podemos ejecutar el comando, para ver el espacio de alamcenamiento
df -h
- RESULTADO:
Filesystem Size Used Avail Use% Mounted on
udev 1,9G 0 1,9G 0% /dev
tmpfs 395M 988K 394M 1% /run
/dev/sda2 32G 28G 2,6G 92% /
tmpfs 2,0G 0 2,0G 0% /dev/shm
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 2,0G 0 2,0G 0% /sys/fs/cgroup
/dev/loop0 90M 90M 0 100% /snap/core/7713
/dev/loop1 90M 90M 0 100% /snap/core/7917
/dev/sdb1 13T 40M 12T 1% /media/PERSEFONE
tmpfs 395M 0 395M 0% /run/user/1000
- Con esto el NAs será montado automaticamente
Anexar disco Persefone a bluecherry
- Damos permisos
sudo chmod 770 /media/PERSEFONE;
sudo chown bluecherry:bluecherry -R /media/PERSEFONE
- Ingresamos a bluecherry «Almacenamiento->Agregar Almacenamiento»
- Agregamos el almacenamiento -> Guardar cambios
- Eliminamos el almacenamiento primario