Friday, 19 February 2021

faulty for solaris 11

-> start /SP/faultmgmt/shell Are you sure you want to start /SP/faultmgmt/shell (y/n)? y faultmgmtsp> fmadm faulty ------------------- ------------------------------------ -------------- ------- Time UUID msgid Severity ------------------- ------------------------------------ -------------- ------- 2015-01-16/17:55:26 f4ee56c-9fdd-ca19-efb5-ae39675dfee3 SPT-8000-PX Major Problem Status : open Diag Engine : fdd 1.0 System Manufacturer : Oracle Corporation Name : SPARC T8-2 Part_Number : 12345678+11+1 Serial_Number : 1238BDC0DF ---------------------------------------- Suspect 1 of 1 Fault class : fault.component.misconfigured Certainty : 100% Affects : /SYS/MB/CM1/CMP/MR3/BOB1/CH1/DIMM Status : faulted FRU Status : faulty Location : /SYS/MB/CM1/CMP/MR3/BOB1/CH1/DIMM Manufacturer : Hynix Semiconductor Inc. Name : 8192MB DDR4 SDRAM DIMM Part_Number : 70xx001,HMA4xxR7MFRxx-TFT8 Revision : 01 Serial_Number : 465769T+02xxx102WR Chassis Manufacturer : Oracle Corporation Name : SPARC T8-2 Part_Number : 12345678+13+2 Serial_Number : 1248DC140 Description : A FRU has been inserted into a location where it is not supported. Response : The service required LED on the chassis may be illuminated. Impact : The FRU may not be usable in its current location. Action : Please refer to the associated reference document at http://support.oracle.com/msg/SPT-8000-PX for the latest service procedures and policies regarding this diagnosis. faultmgmtsp> In this example, a fault is displayed that includes these

Monday, 28 December 2020

Virtual HBA in Oracle VM Server for SPARC

_--------------- ldm list-hba -l primary 505 fcinfo hba-port | grep online 506 fcinfo hba-port 507 cfgadm -alv 508 format 509 ldm list 510 ldm list -l ldm-test-db 511 ldm list-hba 512 ldm list-io 513 ldm list 514 ldm list -l | more 515 ldm list-hba -l primary 516 fcinfo hba-port 517 ldm add-vsan /SYS/MB/PCIE1/HBA0/PORT0,0 pci1_port0 primary 518 ldm list-hba -l primary 519 ldm add-vhba p0_pci1_port0 pci1_port0 stdisk 520 ldm list 521 ldm add-vhba id=0 timeout=120 p0_pci1_port0 pci1_port0 ldm-test-db 522 ldm list-hba -d primary 523 ldm list 524 telnet loghost 5000 525 ldm add-vhba id=1 timeout=120 p1_pci1_port0 pci1_port0 ldm-test-db-2 526 ldm list-domain -l 527 ldm list 528 ldm list -l ldm-test-db 529 ldm add-vhba id=1 timeout=120 p1_pci1_port0 pci1_port0 ldm-test-db-2 530 ldm add-vsan /SYS/MB/PCIE1/HBA0/PORT0,0 pci1_port1 primary 531 ldm add-vhba p0_pci1_port1 pci1_port1 stdisk1 532 ldm add-vhba id=1 timeout=120 p1_pci1_port1 pci1_port1 ldm-test-db-2 533 ldm list 534 telnet loghost 5001 535 ldm list 536 ldm list 537 ldm list -l ldm-test-db -------------------------- Oracle VM Server for SPARC 3.3 was released on October 26 during Oracle OpenWorld. This release added an important new feature, virtual HBA (vHBA), which adds flexibility and relieves prior limitations of virtual I/O without sacrificing performance. Important note: A lot of functionality has been added to vHBA support in Solaris 11.3 updates. It's very important to be on a recent Solaris 11.3 SRU to get the best results. Background Oracle VM Server for SPARC supports both virtual I/O and physical I/O Physical I/O, described in the Administration Guide chapter I/O domains, gives domains direct ownership and access to I/O devices via PCIe busses, a PCIe endpoint device, or a PCIe SR-IOV virtual function. This is ideal when native performance or full access to device features is needed, but comes with restrictions. In particular, it is limited to the number of physical devices that can be assigned to domains, and is incompatible with live migration. Virtual I/O is more commonly used, as it provides more operational flexibility for virtual networks and virtual disks. Virtual I/O supports live migration, and can provide near native performance when correctly configured. However, virtual I/O also has restrictions. It supports network and disk devices, but not tape or other device types. Virtual disks have good performance, but are limited to active-passive virtual disk multipathing using mpgroups, which cannot be used in conjunction with SCSI reservation. Ideally, a guest domain would be a "full participant" in the SAN infrastructure used by enterprise customers. Introducing vHBA Virtual HBA (vHBA) is a new capability of Oracle VM Server for SPARC that lets guest domains have virtual SCSI HBAs. In the vHBA model, a physical host bus adapter is mapped onto a virtual SAN (vsan) in the service domain, and a virtual HBA in the guest domain is associated with the vsan. SCSA protocol is used to communicate between the physical HBA, the virtual SAN, and the virtual HBA. The physical LUNs addressed by the physical HBA are visible within the guest as virtual LUNs, and are managed within the guest domain using the regular Solaris device drivers, just as in a non-virtual environment. vHBA provides multiple benefits: Device functionality: - Solaris in the domain uses native device drivers, and can use full functionality for SCSI reserveration and MPxIO for path management Device generality: - Any device Solaris supports on a physical HBA is supported in the virtual HBA. For example, the guest domain will be able to use tape devices for backup. Command scalability - instead of requiring two commands per virtual disk (an ldm add-vdsdev and an ldm add-vdisk, all of the devices on the physical HBA are presented to the guest in the same commands. This reduces the effort needed by the domain administrator. Logical Domain Channel scalability - Normally, a virtual device consumes an LDC in the guest and in the service domain, and since there are limits on the number of LDCs per system and per domain, this can be a constraint on the number of devices that domains can have. With vHBA, the entire HBA is represented by a single LDC in the guest and service domain, regardless of the number of LUNs. Implementing vHBA Let's show an example of vHBA. It requires Oracle VM Server for SPARC 3.3, which is delivered with Oracle Solaris 11.3 in the control domain. The guest domains using vHBA must run Solaris 11, as Solaris 10 does not have the SCSA interface described above. There are no special hardware requirements other than having a physical HBA with LUNs. It runs on any supported SPARC server - in this example on a SPARC T2. First, let's display the physical HBA that's available on the server: primary# ldm ls-hba primary # alias is ldm list-hba NAME VSAN ---- ---- MB/SASHBA/HBA0 MB/RISER2/PCIE2/HBA0/PORT0,0 MB/RISER2/PCIE2/HBA0,1/PORT0,0 primary# ldm ls-hba -p primary HBA |alias=MB/SASHBA/HBA0|dev=/pci@0/pci@0/pci@2/scsi@0|disks=2 |alias=MB/RISER2/PCIE2/HBA0/PORT0,0|dev=/pci@0/pci@0/pci@9/SUNW,emlxs@0/fp@0,0|disks=4 |alias=MB/RISER2/PCIE2/HBA0,1/PORT0,0|dev=/pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0|disks=4 primary# ldm ls-hba -t primary NAME VSAN ---- ---- MB/SASHBA/HBA0 init-port 50800200005ab000 Transport Protocol SAS MB/RISER2/PCIE2/HBA0/PORT0,0 init-port 10000000c9b09b3c Transport Protocol FABRIC MB/RISER2/PCIE2/HBA0,1/PORT0,0 init-port 10000000c9b09b3d Transport Protocol FABRIC We have a physical adapter, and can even see the LUNs under it. Let's show some output formats for details. # ldm ls-hba -d primary NAME VSAN ---- ---- MB/SASHBA/HBA0 c3t0d0s0 c3t1d0s0 MB/RISER2/PCIE2/HBA0/PORT0,0 c4t21000024FF2D4C83d2s0 c4t21000024FF2D4C83d0s0 c4t21000024FF2D4C82d2s0 c4t21000024FF2D4C82d0s0 MB/RISER2/PCIE2/HBA0,1/PORT0,0 c5t21000024FF2D4C83d2s0 c5t21000024FF2D4C83d0s0 c5t21000024FF2D4C82d2s0 c5t21000024FF2D4C82d0s0 # ldm ls-hba -l primary NAME VSAN ---- ---- MB/SASHBA/HBA0 [/pci@0/pci@0/pci@2/scsi@0] MB/RISER2/PCIE2/HBA0/PORT0,0 [/pci@0/pci@0/pci@9/SUNW,emlxs@0/fp@0,0] MB/RISER2/PCIE2/HBA0,1/PORT0,0 [/pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0] Now that I've identified the physical resource, I'll create the vsan against it, and the vHBA for my guest domain: primary# ldm add-vsan MB/RISER2/PCIE2/HBA0,1/PORT0,0 jeff-vsan primary MB/RISER2/PCIE2/HBA0,1/PORT0,0 resolved to device: /pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0 primary# ldm add-vhba jeff-vhba jeff-vsan ldom3 That was really all there was to it. The guest now has the vHBA and sees its LUNs. I'll show that in a bit.First, I'll show the virtual services created in the control domain: primary# ldm list-services ... snip ... VSAN NAME LDOM TYPE DEVICE IPORT jeff-vsan primary VSAN vsan@0 [/pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0] VHBA NAME VSAN DEVICE TOUT SERVER jeff-vhba jeff-vsan vhba@0 0 primary We now have a vsan and a vHBA I've creatively named for myself. I can inspect the configuration using the commands I used in the beginning: primary# ldm ls-hba -d primary NAME VSAN ---- ---- MB/SASHBA/HBA0 c3t0d0s0 c3t1d0s0 MB/RISER2/PCIE2/HBA0/PORT0,0 c4t21000024FF2D4C83d2s0 c4t21000024FF2D4C83d0s0 c4t21000024FF2D4C82d2s0 c4t21000024FF2D4C82d0s0 MB/RISER2/PCIE2/HBA0,1/PORT0,0 jeff-vsan c5t21000024FF2D4C83d2s0 jeff-vsan c5t21000024FF2D4C83d0s0 jeff-vsan c5t21000024FF2D4C82d2s0 jeff-vsan c5t21000024FF2D4C82d0s0 jeff-vsan primary# ldm ls-hba -l primary NAME VSAN ---- ---- MB/SASHBA/HBA0 [/pci@0/pci@0/pci@2/scsi@0] MB/RISER2/PCIE2/HBA0/PORT0,0 [/pci@0/pci@0/pci@9/SUNW,emlxs@0/fp@0,0] MB/RISER2/PCIE2/HBA0,1/PORT0,0 jeff-vsan [/pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0] primary# ldm ls-hba -t primary NAME VSAN ---- ---- MB/SASHBA/HBA0 init-port 50800200005ab000 Transport Protocol SAS MB/RISER2/PCIE2/HBA0/PORT0,0 init-port 10000000c9b09b3c Transport Protocol FABRIC MB/RISER2/PCIE2/HBA0,1/PORT0,0 jeff-vsan init-port 10000000c9b09b3d Transport Protocol FABRIC primary# ldm ls -o san,hba NAME primary VSAN NAME TYPE DEVICE IPORT jeff-vsan VSAN vsan@0 [/pci@0/pci@0/pci@9/SUNW,emlxs@0,1/fp@0,0] ... snip ... NAME ldom3 VHBA NAME VSAN DEVICE TOUT SERVER jeff-vhba jeff-vsan vhba@0 0 primary Not counting the commands to list the environment, it only took two commands in the control domain (ldm add-vsan, ldm add-vhba) to do the actual work. vHBA devices viewed from the guest domain The guest domain was running while the above commands were issues (showing that this works with guest domain dynamic reconfiguration). I thought it would be interesting to see what dmesg reported for the dynamic reconfiguration events, so I tailed it and saw the following interesting events: root@ldom3:/# dmesg|tail Jul 20 16:40:54 ldom3 scsi: [ID 583861 kern.info] sd10 at scsi_vhci0: unit-address g600144f0ede50676000055a815160019: f_tpgs Jul 20 16:40:54 ldom3 genunix: [ID 936769 kern.info] sd10 is /scsi_vhci/disk@g600144f0ede50676000055a815160019 Jul 20 16:40:54 ldom3 cmlb: [ID 107833 kern.warning] WARNING: /scsi_vhci/disk@g600144f0ede50676000055a815160019 (sd10): Jul 20 16:40:54 ldom3 Corrupt label; wrong magic number Jul 20 16:40:54 ldom3 genunix: [ID 408114 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a815160019 (sd10) online Jul 20 16:40:54 ldom3 genunix: [ID 483743 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a815160019 (sd10) multipath status: degraded: path 1 vhba1/disk@w21000024ff2d4c83,0 is online Jul 20 16:40:54 ldom3 genunix: [ID 530209 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a815160019 (sd10) multipath status: optimal: path 2 vhba1/disk@w21000024ff2d4c82,0 is online: Load balancing: round-robin Jul 20 16:40:54 ldom3 genunix: [ID 408114 kern.info] /virtual-devices@100/channel-devices@200/scsi@0/iport@0/probe@w21000024ff2d4c83,2 (nulldriver1) online Jul 20 16:40:55 ldom3 scsi: [ID 583861 kern.info] sd11 at scsi_vhci0: unit-address g600144f0ede50676000055a81bb2001a: f_tpgs Jul 20 16:40:55 ldom3 genunix: [ID 936769 kern.info] sd11 is /scsi_vhci/disk@g600144f0ede50676000055a81bb2001a Jul 20 16:40:55 ldom3 genunix: [ID 408114 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a81bb2001a (sd11) online Jul 20 16:40:55 ldom3 genunix: [ID 483743 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a81bb2001a (sd11) multipath status: degraded: path 3 vhba1/disk@w21000024ff2d4c83,2 is online Jul 20 16:40:55 ldom3 genunix: [ID 530209 kern.info] /scsi_vhci/disk@g600144f0ede50676000055a81bb2001a (sd11) multipath status: optimal: path 4 vhba1/disk@w21000024ff2d4c82,2 is online: Load balancing: round-robin Next, I used format to show the disk devices: root@ldom3:/# format Searching for disks...done c0t600144F0EDE50676000055A815160019d0: configured with capacity of 23.93GB AVAILABLE DISK SELECTIONS: 0. c0t600144F0EDE50676000055A81BB2001Ad0 /scsi_vhci/disk@g600144f0ede50676000055a81bb2001a 1. c0t600144F0EDE50676000055A815160019d0 /scsi_vhci/disk@g600144f0ede50676000055a815160019 2. c1d0 /virtual-devices@100/channel-devices@200/disk@0 Specify disk (enter its number): ^C Note the long device names for the LUNs coming from a ZFS storage appliance - those are the ones I've just picked up. You can see that it's using the native device driver, instead of the 'virtual-devices' driver used with a standard vdisk. I even created a ZFS pool on one of the LUNs on another host accessing the physical SAN, so I can now import it: root@ldom3:/# zpool import pool: aux36 id: 10749927192920141180 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: aux36 ONLINE c0t600144F0EDE50676000055A81BB2001Ad0 ONLINE root@ldom3:/# zpool import aux36 root@ldom3:/# zpool status -v pool: aux36 state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM aux36 ONLINE 0 0 0 c0t600144F0EDE50676000055A81BB2001Ad0 ONLINE 0 0 0 errors: No known data errors At this point, if I had more devices I could use them too, and I could use all the device features Solaris supports on bare-metal, like SCSI reservation or MPxIO. Now, before you ask: I did some trivial performance tests with I/O workload tools, and it seemed to perform as well as regular vdisks on LUNs.

Wednesday, 9 December 2020

EMC Recover Point – how to recreate repository volume

EMC Recover Point – how to recreate repository volume We have to recreate repository volume of our RP but I could not find any guidance from EMC site. So I’m documenting my steps here for further usage: Procedure overview: On EMC storage: Create about 6-8 GB LUN. Present that LUN to storage group of RP nodes. On RP appliances: On last cluster member: Detach RPA from cluster Format repository volume Reboot Attach RPA to cluster On each subsequent appliance: Detach RPA from cluster Select repository volume Reboot Attach RPA to cluster This is a transcript of console sessions: login as: ****** Using keyboard-interactive authentication. Password: Last login: Fri May 23 07:56:54 2014 from 10.*.*.* Initializing Installation Manager... done Installation Manager - RecoverPoint Version 4.0.SP2(m.24) Cluster RP-CLUSTER RPA 1 ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Detach RPA from cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to detach the RPA from the cluster (Note: RPA will be rebooted when re-attached) (y/n)? y Detach from cluster succeeded. ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 2 ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 2 1. Format a volume as a repository volume 2. Select an existing repository volume Select the operation for the volume (1 to 2): 2 |---------------------------------------------------------------------------| | | Size | Vndr | Product | Name | UID | Cluster | |----|-------|------|---------|--------------|--------------|---------------| | 1. | 8.0GB | DGC | RAID 5 | rp_repositor | 60,06,01,60, | 0x4 d | | | | | | y (3) | 3d,40,36,00, | 603d9 | |----|-------|------|---------|--------------|--------------|---------------| 1 volume was found. Do you want to continue? (y/n)? y Configure repository volume completed successfully. ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to attach the RPA to the cluster (Note: RPA will be rebooted) (y/n)? y RPA is going to be attached and reboot. Attach to cluster succeeded login as: ****** Using keyboard-interactive authentication. Password: Last login: Fri May 23 07:56:54 2014 from 10.*.*.* Initializing Installation Manager... done Installation Manager - RecoverPoint Version 4.0.SP2(m.24) Cluster RP-CLUSTER RPA 1 ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Detach RPA from cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to detach the RPA from the cluster (Note: RPA will be rebooted when re-attached) (y/n)? y Detach from cluster succeeded. ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 2 ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 2 1. Format a volume as a repository volume 2. Select an existing repository volume Select the operation for the volume (1 to 2): 2 |---------------------------------------------------------------------------| | | Size | Vndr | Product | Name | UID | Cluster | |----|-------|------|---------|--------------|--------------|---------------| | 1. | 8.0GB | DGC | RAID 5 | rp_repositor | 60,06,01,60, | 0x4 d | | | | | | y (3) | 3d,40,36,00, | 603d9 | |----|-------|------|---------|--------------|--------------|---------------| 1 volume was found. Do you want to continue? (y/n)? y Configure repository volume completed successfully. ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to attach the RPA to the cluster (Note: RPA will be rebooted) (y/n)? y RPA is going to be attached and reboot. Attach to cluster succeeded login as: ****** Using keyboard-interactive authentication. Password: Last login: Fri May 23 07:56:54 2014 from 10.*.*.* Initializing Installation Manager... done Installation Manager - RecoverPoint Version 4.0.SP2(m.24) Cluster RP-CLUSTER RPA 1 ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Detach RPA from cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to detach the RPA from the cluster (Note: RPA will be rebooted when re-attached) (y/n)? y Detach from cluster succeeded. ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 2 ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 2 1. Format a volume as a repository volume 2. Select an existing repository volume Select the operation for the volume (1 to 2): 2 |---------------------------------------------------------------------------| | | Size | Vndr | Product | Name | UID | Cluster | |----|-------|------|---------|--------------|--------------|---------------| | 1. | 8.0GB | DGC | RAID 5 | rp_repositor | 60,06,01,60, | 0x4 d | | | | | | y (3) | 3d,40,36,00, | 603d9 | |----|-------|------|---------|--------------|--------------|---------------| 1 volume was found. Do you want to continue? (y/n)? y Configure repository volume completed successfully. ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to attach the RPA to the cluster (Note: RPA will be rebooted) (y/n)? y RPA is going to be attached and reboot. Attach to cluster succeeded login as: ****** Using keyboard-interactive authentication. Password: Last login: Fri May 23 07:56:54 2014 from 10.*.*.* Initializing Installation Manager... done Installation Manager - RecoverPoint Version 4.0.SP2(m.24) Cluster RP-CLUSTER RPA 1 ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Detach RPA from cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to detach the RPA from the cluster (Note: RPA will be rebooted when re-attached) (y/n)? y Detach from cluster succeeded. ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 2 ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 2 1. Format a volume as a repository volume 2. Select an existing repository volume Select the operation for the volume (1 to 2): 2 |---------------------------------------------------------------------------| | | Size | Vndr | Product | Name | UID | Cluster | |----|-------|------|---------|--------------|--------------|---------------| | 1. | 8.0GB | DGC | RAID 5 | rp_repositor | 60,06,01,60, | 0x4 d | | | | | | y (3) | 3d,40,36,00, | 603d9 | |----|-------|------|---------|--------------|--------------|---------------| 1 volume was found. Do you want to continue? (y/n)? y Configure repository volume completed successfully. ** Setup ** [1] Modify settings [2] Configure repository volume [3] Get remote settings [4] Retrieve previous settings [5] Apply settings [6] View settings [7] Reset settings changes [8] Advanced options [9] Console configuration [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: b ** Main Menu ** [1] Installation [2] Setup [3] Diagnostics [4] Cluster operations [5] Shutdown / Reboot operations [Q] Quit RP-CLUSTER RPA 1: 4 ** Cluster operations ** [1] Attach RPA to cluster [2] Remove a cluster from this system [3] Configure connection types to other clusters in the system [M] Main Menu [B] Back [Q] Quit RP-CLUSTER RPA 1: 1 Do you want to attach the RPA to the cluster (Note: RPA will be rebooted) (y/n)? y RPA is going to be attached and reboot. Attach to cluster succeeded

Thursday, 10 September 2020

Swap Space Made Easy

Swap Space Made Easy Cutting through the exposition and explanation, we can create a new swap file as easily and quickly as this: sudo dd if=/dev/zero /of=/swapfile2 bs=1024 count=104857 sudo mkswap /swapfile2 sudo chmod 600 /swapfile2 sudo swapon /swapfile2 And let’s check that it worked: swapon --show sudo dd if=/dev/zero /of=/swapfile2 bs=1024 count=104857 in a terminal window If you want to make that permanent drop, it into your /etc/fstab file. The line we need to add to the bottom of the file is: /swapfile none swap sw 0 0 The operating system makes use of swap space when its available physical memory (RAM) is running out due to ever-demanding applications. In this situation, the operating system moves the inactive pages in physical memory to swap space. This freeing up of physical memory will be used for other applications. When the physical memory is available enough, the swap memory area will be brought back to the physical memory. The administrators ensure that sufficient swap space present in the system so that some free physical memory always available to the operating system. This article provides steps to create or increase swap space and also delete if you need it. Table of Contents ​Do I really need swap space? Partition or file? What is the recommended swap size? Creating swap space Disable and remove a swap file Limitation ​Conclusion ​Do I really need swap space? Not always, the provided system has a large amount of physical memory (RAM). But it is recommended to have swap space handy. The system may crash when the system is run out of physical memory when many applications are running with large memory footprint. When compared to RAM, disk space is relatively cheap! Partition or file? Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of both. By default, most of the Linux distributions create a dedicated swap partition or a file on the system partition during installation. Windows operating system generally has the swap space as a file. What is the recommended swap size? Though there is no hard and fast rule to have swap space, it is recommended to have at least 1.5 times the physical memory. In the case of hibernation, the swap partition should be at least as big as the RAM size. Creating swap space Following are the instructions to create swap space using a file: Login as root. sudo su get superuser ubuntu linux Create swap file in directory “/var” with name “swapfile”. At the shell, create the file and set root permissions as follows: cd /var touch swapfile chmod 600 swapfile ls -la swapfile create swap file Use “dd” command to fill the swap file with 1 GB size (as an example) as follows : dd if=/dev/zero of=/var/swapfile bs=1024k count=1000 create swap file with data Now setup the swap file: mkswap /var/swapfile Picture Enable the swap file: swapon /var/swapfile enable swap file To check whether the new swap file was successfully created, either of the below commands can be used.​ # cat /proc/swaps # swapon –show get all swap files Add below line to the “/etc/fstab” file so that next time when the system boots, it enables the newly created swap file: /var/swapfile none swap sw 0 0 Disable and remove a swap file Disable the swap file. # swapoff /var/swapfile Delete the swap file. # rm /var/swapfile Remove the entry from “/etc/fstab” file. /var/swapfile none swap sw 0 0 Limitation

Wednesday, 9 September 2020

Disable SELinux Permanently

Disable SELinux Permanently To permanently disable SELinux, use your favorite text editor to open the file /etc/sysconfig/selinux as follows: # vi /etc/sysconfig/selinux SELinux Enforcing Mode SELinux Enforcing Mode Then change the directive SELinux=enforcing to SELinux=disabled as shown in the below image. SELINUX=disabled Disable SELinux Permanently Disable SELinux Permanently Then, save and exit the file, for the changes to take effect, you need to reboot your system and then check the status of SELinux using sestatus command as shown: $ sestatus Check SELinux Status Check SELinux Status

Tuesday, 8 September 2020

Linux HTTP Server Configuration

Installation For a minimum HTTP server installation, issue the following command. # yum install httpd If you want a more complete installation, you can install the "Web Server" package group. # yum groupinstall "Web Server" Make sure the "/etc/hosts" file contains references for the loopback address and the hostname. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.122.89 rhce1.localdomain rhce1 Turn on the HTTP server and make sure it starts automatically on reboot. # service httpd start # chkconfig httpd on The HTTP server is now installed and running. The HTTP configuration files are located under the "/etc/httpd" directory, with the main configuration file being the "/etc/httpd/conf/httpd.conf" file. The default document root is "/var/www/html". Any files or directories below this point will be visible using a browser once you configure the firewall. Changes to the "/etc/httpd/conf/httpd.conf" file have to be followed by a reload or a restart of the httpd service. # service httpd reload # # OR # service httpd restart Firewall If you are using the Linux firewall, you need to punch a hole in the firewall for port 80 (and 443 for HTTPS) to make sure the HTTP server can be accessed from the network. There are several ways to do this: The "Firewall Configuration" dialog from the menu (System > Administration > Firewall) or initiated from the command line by running the system-config-firewall command. On the "Trusted Services" section, scroll down the list and check the "WWW (HTTP)" option, then click the "Apply" button. The text-based "Firewall Configuration" utility (system-config-firewall-tui). This is the text-based version of the above dialog. Using the iptables service directly, as described here. In this case we could need the following entry. iptables -A INPUT -p tcp --dport 80 -j ACCEPT You can read more about the Linux firewall here. SELinux If you are using SELinux, you will need to consider the following points. The SELinux booleans associated with the httpd service are displayed using the getsebool command. # getsebool -a | grep httpd allow_httpd_anon_write --> off allow_httpd_mod_auth_ntlm_winbind --> off allow_httpd_mod_auth_pam --> off allow_httpd_sys_script_anon_write --> off httpd_builtin_scripting --> on httpd_can_check_spam --> off httpd_can_network_connect --> off httpd_can_network_connect_cobbler --> off httpd_can_network_connect_db --> off httpd_can_network_memcache --> off httpd_can_network_relay --> off httpd_can_sendmail --> off httpd_dbus_avahi --> on httpd_enable_cgi --> on httpd_enable_ftp_server --> off httpd_enable_homedirs --> off httpd_execmem --> off httpd_manage_ipa --> off httpd_read_user_content --> off httpd_run_stickshift --> off httpd_setrlimit --> off httpd_ssi_exec --> off httpd_tmp_exec --> off httpd_tty_comm --> on httpd_unified --> on httpd_use_cifs --> off httpd_use_gpg --> off httpd_use_nfs --> off httpd_use_openstack --> off httpd_verify_dns --> off # The setsebool command is used to set a specific boolean value. # setsebool httpd_use_nfs on # setsebool httpd_use_nfs off The httpd_sys_content_t context should be assigned to all content. # semanage fcontext -a -t httpd_sys_content_t "/var/www/html(/.*)?" # restorecon -F -R -v /var/www/html You can check the current context setting on files and directories using the "ls -alZ" command. More information on SELinux can be found here. Virtual Hosts Virtual Hosts allow multiple websites to be hosts by a single physical machine, with each website being apparently independent of each other. The virtual hosts can be IP-based, but are typically name-based, meaning the domain name in the URL used to access the web server determines which virtual host the request is for. Create the following directories as locations for two virtual hosts. I've also created a test file in both document roots. # mkdir -p /www/mysite1.com/logs # mkdir -p /www/mysite1.com/html # echo "MySite1.com Test file" > /www/mysite1.com/html/test.txt # mkdir -p /www/mysite2.com/logs # mkdir -p /www/mysite2.com/html # echo "MySite2.com Test file" > /www/mysite2.com/html/test.txt If you are using SELinux, make sure the directories and their contents are assigned the correct context. # semanage fcontext -a -t httpd_sys_content_t "/www(/.*)?" # restorecon -F -R -v /www Virtual hosts are defined in the "/etc/httpd/conf/httpd.conf" file. The definition of the two virtual hosts are shown below. NameVirtualHost *:80 ServerName www.mysite1.com Serveralias mysite1.com DocumentRoot /www/mysite1.com/html ErrorLog /www/mysite1.com/logs/mysite1.com-error_log ServerName www.mysite2.com Serveralias mysite2.com DocumentRoot /www/mysite2.com/html ErrorLog /www/mysite2.com/logs/mysite2.com-error_log Reload or restart the httpd service for the changes to take effect. # service httpd reload # # OR # service httpd restart Provided the DNS, or hosts file, resolves the names "mysite1.com" and "mysite2.com" to the IP address of the web server, pages under the document roots will now display for each virtual host. To test this you can alter your hosts file with the following entries. 127.0.0.1 mysite1.com mysite1 127.0.0.1 mysite2.com mysite2 You should now see the correct test page under each of the following URLs on the web server. http://mysite1.com/test.txt http://mysite2.com/test.txt Private Directories Using the virtual hosts we created previous, create a new directory called "private" and place a file in it. # mkdir /www/mysite1.com/html/private # echo "MySite1.com Private Test file" > /www/mysite1.com/html/private/test.txt Create a ".htpasswd" file containing a username/password, then add a second entry. # cd /www/mysite1.com/html/private # htpasswd -cmb .htpasswd user1 password1 # htpasswd -mb .htpasswd user2 password2 Edit the "/etc/httpd/conf/httpd.conf" file with an entry such as the following. AuthType basic AuthName "Private Access" AuthUserFile "/www/mysite1.com/html/private/.htpasswd" Require valid-user Order allow,deny Allow from all Reload or restart the httpd service for the changes to take effect. # service httpd reload # # OR # service httpd restart You should now be prompted for a username/password when trying to access the following file. http://mysite1.com/private/test.txt Group Managed Content Using the virtual hosts defined previously, we will enable group managed content for "mysite1.com". Create a group that the users will be part of. # groupadd webdevs Add the necessary users to the group. # # Create new users. # useradd -g webdevs user1 # useradd -g webdevs user2 # # # Modify existing users. # usermod -g webdevs user1 # usermod -g webdevs user2 Change the ownership and permissions of the directories holding the group managed content. # chown -R apache.webdevs /www/mysite1.com/html # chmod -R 775 /www/mysite1.com/html # chmod -R g+s /www/mysite1.com/html Log in a the two users and check they can add and amend content. # su - user1 $ umask 002 $ echo "Test by user1" > /www/mysite1.com/html/group-test.txt $ exit logout # su - user2 $ umask 002 $ echo "Test by user2" >> /www/mysite1.com/html/group-test.txt $ exit logout # The file with both users content is visible using the following URL. http://mysite1.com/group-test.txt Notice the umask setting, which allows read/write permission for the group. This setting can be placed in the "~/.bashrc" or the "~/.bash_profile" file for each user. Deploy a Basic CGI Application Create a directory called "cgi-bin" under an existing virtual host. # mkdir /www/mysite2.com/html/gci-bin Create a simple CGI application in the directory, for example a file called "helloworld.pl" with the following contents. #!/usr/bin/perl print "Content-type: text/html\n\n"; print "helloWorld!"; Change the ownership and make sure the file is executable. # chown apache.apache helloworld.pl # chmod u+x helloworld.pl Edit the "/etc/httpd/conf/httpd.conf" file, adding the following entries to the virtual host definition. ScriptAlias /cgi-bin/ /www/mysite2.com/html/gci-bin/ Options +ExecCGI AddHandler cgi-script .pl .cgi So the complete definition looks like this. ServerName www.mysite2.com Serveralias mysite2.com DocumentRoot /www/mysite2.com/html ErrorLog /www/mysite2.com/logs/mysite2.com-error_log # Below added to support CGI applications ScriptAlias /cgi-bin/ /www/mysite2.com/html/gci-bin/ Options +ExecCGI AddHandler cgi-script .pl .cgi Reload or restart the httpd service for the changes to take effect. # service httpd reload # # OR # service httpd restart The CGI application can now be run will the following URL. http://mysite2.com/cgi-bin/helloworld.pl If you prefer the "cgi-bin" directory to be placed in a different location, simply alter the "ScriptAlias" entry to reflect the changed location. SSL Configuration (HTTPS) HTTPS configuration is not a requirement of the RHCE exam, but it is useful to know, so I included it. If they are not already installed, install the mod_ssl, openssl and crypto-utils packages. # yum install mod_ssl openssl crypto-utils The installation of the mod_ssl package creates the "/etc/httpd/conf.d/ssl.conf" configuration file, which includes references to the default self-signed localhost certificate and key. This is sufficient for testing SSL configuration. The httpd service must be restarted for the module to be loaded, but we will do that later. The genkey command can generate a certificate request or a new self-signed certificate. For this test I created a new self-signed certificate. Remember, if you encrypt the certificate with a passphrase, you will need to enter it every time you start the HTTP server. # genkey --makeca rhce1.localdomain Move the key and certificate to the relevant directories. # mv /etc/pki/CA/private/rhce1.localdomain /etc/pki/tls/private/rhce1.localdomain # mv /etc/pki/CA/rhce1.localdomain /etc/pki/tls/certs/rhce1.localdomain Add/modify the following lines in the "/etc/httpd/conf.d/ssl.conf" file. SSLProtocol ALL -SSLv2 -SSLv3 SSLHonorCipherOrder On SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!DES:!DHE:!RSA SSLCertificateFile /etc/pki/tls/certs/rhce1.localdomain SSLCertificateKeyFile /etc/pki/tls/private/rhce1.localdomain #SSLCACertificateFile /etc/pki/tls/certs/intermediate.crt Notice the "SSLCACertificateFile" entry is commented out. If you are using a real certificate, you will probably need to download the intermediate bundle from the CA and reference it using this tag. Restart the HTTP server. # service httpd restart Provided you have the correct firewall settings, you should now be able to access your applications using HTTPS. https://rhce1.localdomain