Como configurar replicação DFSR com PowerShell

Olá amigos, tudo bem?

Recentemente me deparei com um problema na replicação do Windows Server 2012 R2 aonde no momento de criar um grupo de replicação ocorria o erro: “Value does not fall within the expected range”.  Este erro ocoria  no momento de selecionar os servidores que seriam utilizados na replicação.

Mas esse erro não será o tema abordado desta postagem, mas sim como foi feito para contornar esse problema de forma rápida para recriar a replicação.

Sempre é bom ter um diagrama bem definido de como sua replicação está configurada, segue um exemplo:

 

Configurar um grupo de replicação:

Conforme abaixo estamos primeiramente criando o grupo techpoligroup, informando que o nome da pasta a ser replicada será a pasta publico, e por ultimo informaremos o nome dos servidores que vao fazer parte da replicação,srv01 e srv02.

New-DfsReplicationGroup -GroupName techpoligroup | New-DfsReplicatedFolder -FolderName publico | Add-DfsrMember -ComputerName srv01,srv02

Definir conexões e associação:

Neste exemplo, vou configurar a replicação bidirecional entre os dois servidores de arquivos do grupo. Será criado uma parceria lógica entre os computadores de origem e de destino. As parcerias são sempre bidirecionais, a menos que o parâmetro -CreateOneWay seja especificado.

Add-DfsrConnection -GroupName techpoligroup -SourceComputerName srv01 -DestinationComputerName srv02

Definir diretórios da replicação:

Finalmente, ativarei a replicação para as pastas em ambos os servidores usando o cmdlet Set-DfsrMembership, definindo o parâmetro -PrimaryMember como $ true para srv01. Um servidor deve ser designado como o membro primário para cada grupo.

Set-DfsrMembership -GroupName techpoligroup -FolderName accounts -ComputerName srv01 -ContentPath ’C:\shares\publico’ –PrimaryMember $true
Set-DfsrMembership -GroupName techpoligroup -FolderName accounts -ComputerName srv02 -ContentPath ’C:\shares\publico’

Bom amigos, qualquer problema estou a disposição.

Continue Reading

Como determinar o tamanho mínimo de Quota para o Staging DFSR

Olá amigos, gostaria de compartilhar uma dica importante que acabei me deparando enquanto realizava a configuração de alguns servidores de arquivo. Durante a configuração de um ambiente de alta disponibilidade foi necessária a configuração do DFSR: (Distributed File System Replication), e tive vários problemas de replicação desde lentidão e até mesmo a não sincronização de diretórios. Pesquisando um pouco mais vi que a configuração de quota do staging deve estar bem configurada, caso contrario pode ocasionar problemas de performance na replicação.

Encontrei este artigo que trás a fórmula para o cálculo da quota do staging:

How to Determine the Minimum Staging Area DFSR Needs for a Replicated Folder

O artigo mostra que, somamos o tamanho dos maiores arquivos da pasta que será replicada e dividimos o resultado por 1 gigabyte. Porem a quantidade de arquivos a serem somados varia de acordo com a versão do Windows Server

  • Windows Server 2003 R2: 9 arquivos
  • Windows Server 2008 e 2008 R2: 32 arquivos

O artigo apenas fala das versões acima, porem durante minhas pesquisas não encontrei diferença para as versões abaixo:

  • Windows Server 2012 R2: 32 arquivos
  • Windows Server 2016: 32 arquivos

Nota: A replicação que configurei foi realizada entre 3 sites diferentes ambos com Windows Server 2012 R2 Standard somando o total de 4TB, levando em consideração a recomendação de calculo de 32 arquivos .
Os comandos a abaixo, devem ser executados dentro do ambiente do PowerShell com privilegio elevado.

Para somar o tamanho dos maiores arquivos, utilizamos o seguinte comando:

$big32 = Get-ChildItem c:\temp -recurse | Sort-Object length -descending | select-object -first 32 | measure-object -property length –sum

Mudamos a pasta c:\temp pela sua pasta de replicação. Note que foi passado o parâmetro -first 32 que indica que este comando está sendo executado em um computador rodando o Windows Server 2008 ou superior.

Será necessário aguardar a execução do comando que depende do tamanho da pasta cauculada. Então, divida o valor obtido por 1 gigabyte com o seguinte comando:

$big32.sum / 1gb

Do valor obtido, arredonde a parte fracionada para cima.Exemplo, se o valor obtido foi 19,8 arredonde para 20.

Basta agora multiplicar o valor obtido por 1024 e digitar o resultado no campo Quota da guia Staging na janela de Propriedades.

Qualquer duvida ou problema só avisar.

Abraços

Continue Reading

What’s the difference in provisioning disk on Vmware Vspher

When we are going to create a virtual machine, or when we add a new disk to an existing VM, we are forced to choose the type of virtual disk that we will make available to that machine.

There are currently three types of virtual disk that can be created and made available to virtual machines:

Thick Provision Lazy Zeroed – is a standard “thick” disk, meaning all space is allocated at the time of its creation. In this virtual disk format, any data that exists on the physical device is maintained at the time of creation, and are only “zeroed” as the virtual machine writes its data.

Thick Provision Eager Zeroed – is a “thick” disk that supports some cluster features, such as FT. It also allocates all the necessary space at the time of its creation. The difference to the “lazy” (or flat) format is that the data on the physical device is all zeroed at creation time. The creation time for this type of disc may take longer than the others.

Thin Provision – In this type of disk only a minimum space is used at the time of its creation. As more physical space is needed, the “thin” disk will increase in size, reaching the size initially allocated.

Raw Device Mapping

There is also the possibility of making a RDM (Raw Device Mapping) disk available to the virtual machine. An RDM disk allows a VM to access a storage LUN (Fiber Channel or iSCSI) directly. The RDM disk is actually a .vmdk file created in the datastore that maps to the LUN in storage. It only has some metadata information and notes for the physical disk.

RDM disks can be configured in two different ways: virtual compatibility mode and physical compatibility mode.

In virtual mode, the mapped LUN is presented to a virtual machine exactly as a virtual disk created in a VMFS datastore. The true hardware features of the LUN become invisible to the VM. In virtual mode you can benefit from some features of VMFS, such as “file locking” and “snapshots”.

In physical mode, the VMkernel transfers most of the SCSI commands to the mapped LUN, allowing greater integration of the VM with the LUN. The physical mode is useful in virtualizing machines that have SAN management agent and also in creating clusters between physical machines and virtual machines, or between virtual machines on different hosts.

Continue Reading

How to Enable Minimal Server Interface on Windows Server 2012 R2

Hello friends.

In the last weeks in my studies on Windows Server I found this feature in our servers Windows is in a cluster with medium to large can bring notes reductions of features such as memory and cpu.

What is affected when I uninstall the Graphical Server Shell?

In some cases, when you uninstall the Server Graphical Shell, Windows features that depend on Server Graphical Shell will also be uninstalled. In Server Manager, a pop-up dialog box will warn you about what will be uninstalled.

Methods of installation?

  1. Server Core – always installed and enabled; the baseline feature for all Windows Servers
  2. Server Graphical Management Tools & Infrastructure – functionality for Minimal Server Interface
  3. Server Graphical Shell – equivalent to Server with a GUI

How to enable the Minimal Server Interface in Windows Server 2012?

You can enable or disable the Minimal Server Interface through the GUI or from the command line using Windows PowerShell.

Using the Remove Roles and Features Wizard to Configure Windows Server Management Interfaces

Or to switch from a full GUI to a server interface using PowerShell, you must use the Remove-WindowsFeature cmdlet:

Remove-WindowsFeature -Name Server-GUI-Shell -Restart

To change the minimum server interface to a full GUI, you can use the Get-WindowsFeature and Install-WindowsFeature cmdlets:

Get-WindowsFeature Server-GUI-Shell |Install-WindowsFeature -Restart

Important to remember that after applying these options the server must be restarted to validate the configurations.

Any questions or problems just look for me.

Continue Reading

How to Enable Access-based enumeration in Windows Server 2012

First you need to add the File And Storage Services role to the server and reboot the server.
Then go to File And Storage Services in System Manager.

Press Shares, select your shared folder, right-click and press Properties.

Under Settings you will find the Enable access-based enumeration-setting.
Enable it and Apply your changes.

Or

To enable access-based enumeration by using a command line

1-Open a command prompt window on a server that has the Distributed File System role service or Distributed File System Tools feature installed.

2-Type the following command, where <namespace_root> is the root of the namespace:

dfsutil property abe enable \\
<namespace_root>

 

Thoughts and opinions here are mine.

 

Continue Reading