Quantcast
Channel: Tech Support
Viewing all 880 articles
Browse latest View live

Installing and configuring Citrix StoreFront 3.5

$
0
0

In this article I will walk you through the installation and configuration steps for setting up a Citrix StoreFront infrastructure.


Citrix StoreFront is the successor of old good Citrix Web Interface. With the release of StoreFront 3.5 together with XenDesktop 7.8 at the end of February 2016 also the administrator possibilities are on the same level as Web Interface. Personally I think there are (almost) no reasons more to migrate from Web Interface to StoreFront anymore.





Installation Method

First we need to determine how and on which system we would like to install StoreFront. StoreFront can be installed on Windows 2008R2, Windows 2012 and Windows 2012R2. StoreFront requires .Net Framework and Internet Information Services (IIS). Based on the last requirement (IIS) I personally prefer to install Citrix StoreFront on a separate machine.

However you also can install StoreFront on the Delivery Controller, this is even a default setting when you install a Delivery Controller as shown in figure 1. There is also a separate download available, but also the XenDesktop installer offers the possibility to install the StoreFront separately. For Proof of Concepts or small environments it’s doable to combine the StoreFront and Delivery Controller role.

For larger environments I recommend to install StoreFront on a different system. It can be combined with Citrix Directory for example.

Figure 1: Installation options Citrix StoreFront

 

Installation

For this article I will use the separate download for installing StoreFront. After selecting the single execution installation file the installation wizard is started. The installation is actually pretty simple and consists of a few steps only.

The first step is to accept the license agreement.

Figure 2: StoreFront License Agreement

If not installed already the prerequisites will be installed automatically. In my case IIS role is not already activated, so the installation will take care of that.

Figure 3: StoreFront Review Prerequisites

The next step is to actually confirm that StoreFront (with his prerequisites) may be installed on the machine.

Figure 4: StoreFront Ready to Install

After a while the installation is done, showing the status of each component.

Figure 5: Successfully installed StoreFront

After the installation the StoreFront console is automatically started, so you can start configuring StoreFront directly.

 

Configuration

When the StoreFront Console is started you have two options: Create a New Deployment and Join an existing server group. For the first initial server we need the option Create a New Deployment. Later on in this article I will discuss the Join an existing server group option.

Figure 6: Initial StoreFront configuration.

For production environment it’s recommended to use https. To accomplish this for StoreFront you need to add a certificate and bind it to the default website. If you don’t know the exact steps you can find good guides on the Internet for these steps. You can configure StoreFront with http, but logically it is not secure. For the actual configuration steps it does not matter if you are using http or https.

The first windows of the configuration wizard asks for the base URL. By default the wizard offers the computer name however it’s a good thing to change the URL to a more generic name, especially when you set-up a StoreFront infrastructure that exists of more StoreFront servers (more on that later on this article).

Figure 7: StoreFront configuration Base URL.

After entering the base URL the store is already created, this can take some time. After the actual creation, the wizard shows a diagram that shows the three possible connection methods to the StoreFront. This is just for information at this moment, we can continue using the Next button.

Figure 8: StoreFront configuration Getting Started

The wizard continues with asking for a Store name. The store name can be any name, but remember that the name is used in the URL for Receiver for Web Site. New in StoreFront 3.5 (compared with earlier StoreFront versions) is the option to set the Receiver for Web site, which is created out of the store and will be the default IIS web site. You can also allow unauthenticated access to this store.

Figure 9: StoreFront configuration Store Name and Access

To contact the XenDesktop/XenApp environment you need to specify the Delivery Controllers information, so StoreFront knows which servers to contact. Choose the Add button to add a XenDesktop/XenApp environment. If you have more environments you need to add those separately via the Add button.

Figure 10: StoreFront configuration Delivery Controllers.

In the pop-up window you provide a name for the group of delivery controllers. I normally use the same name as the XenDesktop/XenApp site. Secondly you need to choose the type of the environment. In this article I will use a XenDesktop/XenApp 7.x environment. StoreFront also supports XenApp 6.5 and XenApp 5.0. Next you specify the Delivery Controllers of the XenDesktop/XenApp site and preferable use those in a load balanced set-up, followed by specifing the communication port (default HTTP port 80).


Figure 11: StoreFront configuration Add Delivery Controller

After adding a XenDesktop/XenApp site it shows up in the wizard. If you have more environments you can add the following environment via the Add button till all environments are added.

Next you are asked to enable Remote Access for the StoreFront store. With Remote Access you configure the StoreFront to work together with a NetScaler Gateway allowing users to connect to the environment. When you would like to connect using a NetScaler Gateway you enable Remote Access and provide information about the NetScaler Gateway. For simplicity I skip this step in this article.

Figure 12: StoreFront configuration Remote Access

StoreFront supports several authentication methods. Most used are User Name and Password, Domain pass-through and Pass-through for NetScaler Gateway. Via the option Smart card, StoreFront can also be combined with smart card logons.


Figure 13: StoreFront configuration Authentication Methods

The last step is to enable the XenApp services URL. This option is better known as PN Agent in Web Interface. If you are using application shortcut publishing in the Start Menu using PN Agent, this option should be checked.


Figure 14: StoreFront configuration XenApp Services URL

After choosing the Create button in the previous step the configuration will be added to the Store and the Receiver for Web Site will be added to the StoreFront set-up. The same diagram will be shown as in the beginning of the wizard.

Figure 15: StoreFront configuration successfully

In the StoreFront console the Store is created. If you already worked with previous StoreFront version, you will notice that the GUI has been changed. Personally I like the new approach as it simplifies the administration and configuration of the environment.

Figure 16: StoreFront Console





In this new version many configuration options are (finally) available within the GUI. In previous versions you needed to edit the configuration (web.config) manually. Let’s go over the Store configuration options, available in the right pane:
  • Manage Delivery Controllers
Here you can add, remove or edit the XenDesktop/XenApp sites which will be contacted by the StoreFront servers. This is done via the same way as during the initial configuration wizard.
  • Configure Unified Experience
With StroreFront 3.1 the Unified Experience is introduced. The Unified Experience is a new look and feel of StoreFront, which Citrix will be extending to the other products as well. For example NetScaler Gateway also supports the Unified Experience already. Here you can enable or disable the new look and feel. In StoreFront 3.5 the new look and feel is enabled by default, I would recommend to reconsider disabling the new look and feel if you are migrating from a previous StoreFront.
  • Manage Authentication Methods
In this component you can add, change or edit the authentication methods. You should always (in my opinion) configure the additional options available for the User name and password. For this component you add trusted domains (so users don’t have to fill in the domain name when logging on). You can also enable the password options. This allows you to specify if users can change their password via Storefront and if the users should be warned that their password expires. Last you can specify how the password should be validated. This can be done via Active Directory or the Delivery Controller. By default StoreFront uses Active Directory, if there is no direct connection to Active Directory you can use the Delivery Controller for this validation step.

Figure 17: Authentication Methods

  • Manage Receiver for Web Sites
Within this component you can add, delete or configure the Receiver for Web Sites. Per Store you can have more Receiver for Web Sites. This can be necessary if you need a different look and feel or different settings are required. Adding a Receiver for Web Site asks for a path (which the users’ needs to enter to access the web site), the look and feel and the authentication methods. When the Receiver for Web site is already available you can edit the configuration. There are a lot of options available as shown in figure 1.

Figure 1: Customize Experience

First of all you can enable or disable the Unified Experience on this level. This makes it possible to configure two Receiver for Web sites, where you can both offer the old and new look and feel in a migration project for example. At Customize Appearance you can change the look and feel/branding. Within the GUI you can change logo and header and some basic colors. There are many more options via other methods. I will go into more detail about this topic in a separate article.

Another option is the Featured App Groups. Via this option you can group Published Applications in the Receiver for Web sites. This can be useful if users have a lot of Published Applications to find applications more quickly. The applications can be grouped based on keywords, which can be defined as one of the properties. The Featured Groups are shown in blocks above the overview of Published Applications.

Figure 2: Featured App Groups

At authentication methods you can enable or disable the authentication method on the Receiver for Web sites, while at Website shortcuts you can integrate the StoreFront functionality within your business website. Till now I did not use this option, so unfortunately I cannot share any experiences of this feature.

Figure 3: Deploy Citrix Receiver

At Deploy Citrix Receiver you can select the deployment options of the Citrix Receiver. By default, Install locally is selected, but this can be changed to Always use Receiver for HTML5 or Use Receiver for HTML 5 if the local Receiver is unavailable. When you select an option where the local Receiver is included you can also offer a download of the local Citrix Receiver. The client can be offered via the website of Citrix, local on the StoreFront server or on a remote server. When using the StoreFront Server you can also upload the client to the correct location. Also when you offer the client via the StoreFront server the plug-in can be upgraded when the users log in.

The next configuration option is labeled Session Settings. Here you can define several session time-outs for the StoreFront environment. The most important is the session time-out. With this setting you define when the Receiver for Web site logs off the user of the website. There is no correct setting for this one, it depends on the customer needs. For example an organization starting a desktop will use a shorter session time out than an organization that is using Published Applications.

Figure 4: Session Settings

Workspace Control is the feature that Citrix has already been promoting for years. Even at the last Citrix Synergy the roaming of sessions was used in one of the demos. That roaming of session is based on Workspace Control. On the tab Workspace Control you can enable or disable the roaming behavior and if enabled how Workspace Control should be responding including the option to show the option in the GUI of the Receiver for Web sites.

Figure 5: Workspace Control

Another important tab is Client Interface Settings. On this tab you can configure the behavior of the Receiver for Web sites. You can enable or disable the auto start of a XenApp/XenDesktop desktop when using a desktop. You can also enable or disable the Desktop Viewer (the black toolbar showing on top of the Citrix session). Also the time between multiple clicks can be configured on this tab (so users do not start a Published Application or Desktop multiple times). Also the view of StoreFront can be defined: showing or not showing the desktop or application view or both. The default view can also be configured. This comes into play if you both have a desktop(s) and applications published and want to set a view as default. Be careful with auto as this is dependent of the Receiver experience configured.

Figure 6: Client Interface Settings

The last tab is as the name applies for Advanced Settings. The most important one is probably enabling or disabling the folder view, this one was requested a lot. The other options I would not change from default.

Figure 7: Edit Receiver for Web Site
  • Configure Remote Access Settings
On this part you can configure the connection with the NetScaler Gateway for remote access. The options are the same as shown during the initial wizard.
  • Configure XenApp Services Support
Just as Configure Remote Access Settings this part is also available in the initial wizard. Here you can change configure or change the functionality formerly known as PNAgent. The options are exactly the same as during the initial wizard.
  • Configure Store Settings
Within Configure Store Settings, options can be found that are applied at the Store level. Several options are available. The first option is User Subscription. Within this option you can enable the User Subscription feature, which makes it possible for users to favorite their Desktops or Published Applications shown on the home screen of StoreFront.

Figure 8: Store Settings: User Subscriptions

Second option is Kerberos Delegation. Here you can enable or disable Kerberos delegation to the Delivery Controllers. I never used the Kerberos delegation part, so I cannot share experiences with this functionality.
New in StoreFront 3.5 is Optimal HDX Routing. Optimal HDX Routing works in combination with the Zones functionality introduced in XenDesktop 7.7. With Optimal HDX Routing Users can be routed to the NetScaler Gateway that is located in the same datacenter as the XenDesktop/XenApp server or VDI where the user is routed to. For each NetScaler Gateway you can specify the zone name(s) for which the Gateway is the primary access point.

Figure 9: Store Settings: Optimal HDX Routing

Next is the Citrix Online Integration. Here you can enable that icons are shown to the end-user of the Citrix Online products GoToMeeting, GoToWebinar and GoToTraining. Happily those icons are disabled by default, in previous versions they were enabled by default.

Within Advertise Store you can configure that the store is presented to the end user when using e-mail discovery, while the last option Advanced Settings is offering all kinds of settings that do not fit in the just discussed components. Within Advanced Settings some interesting options are available like Allow Font Smoothing, allow session reconnect, Enable socket spooling, Filter resources and override ICA client name. I advise only to change those settings, when support articles are pointing to changing those settings for issues you currently have.
  • Export Provisioning File
This is actually not a configuration option, but the option to generate a file that can be used to configure the Receiver to communicate with the Citrix infrastructure.
  • Manage NetScaler Gateways / Manage Beacons
The Manage NetScaler Gateways and Manage Beacons options are placed higher in the pane as those are not limited to one Store. Within Manage NetScaler Gateways you can add, delete or modify the NetScaler Gateway settings together with the Secure Ticket Authority options. The options are similar as shown in the initial configuration wizard and are also available at Configure Remote Access settings. Manage Beacons is a separate component. Within Beacons you add sites so StoreFront can determine if the connection is made from the internal network or is set-up from the Internet. This is required when using the same URL for internal as external sessions.

We went through all the configuration options available in StoreFront 3.5. As a last topic I will show you how to create a fault tolerant/load balanced StoreFront infrastructure.

 

Fault Tolerant Citrix StoreFront configuration

Till now we have worked with one StoreFront server. Citrix did a good job about publishing a document about the scalability of Citrix StoreFront. In one of the articles they mention that a 2 vCPU StoreFront server can handle 32000 user connections per hour and with more CPU’s added this number can go up to 75000 user connections per hour. For many organizations those numbers are high enough to use one server for handling the load. However for fault tolerance you want to have at least one additional server. In StoreFront servers can be easily combined to a so called Server Group.

Let’s take a look how to set-up a Server Group. The first step is to install a StoreFront server and configure those to your need (at least the initial configuration wizard). The second step is to install another StoreFront server via the installation steps described earlier.

When the installation is complete go to the StoreFront Console on the first server and choose Server Group in the left pane. Within the Server Group in the right pane there is the option Add Server. When using Add Server a window will pop-up showing the information to add a server to this server (group).

Figure 10: Adding a server to a Server Group

On the server you would like to add you choose Join existing Server Group in the StoreFront console. After that you need to fill in the provided information from the first server.





Figure 11: Join existing server group

Next the servers will be connected and the configuration is replicated to the new server. When the process is finished on both machines a message will be displayed about the join process. Do not forget that the servers are not replicating automatically. When you make changes to the configuration you always execute the task on the first server, when the changes are done you go to the server group part and choose Replicate changes from the right pane.

Now the configuration of StoreFront is replicated and available on both StoreFront servers. However StoreFront does not provide an option out of the product to load balance the users over the two servers automatically. For that we need to add a (hardware) load balancer. You can use a NetScaler appliance for example

 

Summary

In this article I described the steps to install and configure a Citrix StoreFront 3.5 server. In steps above we executed the installation, the initial configuration wizard and started with the configuration options and we continued with the configuration options and set-up a StoreFront Server Group for load balancing and fault tolerance.

How to Unify Your PC and Android Phone for Seamless Notifications, Sharing, and More

$
0
0

Sometimes you need to get stuff from your computer to your phone—pictures, files, links, text, etc. And most of the time, that’s way more of a pain than it should be. If you’re tired of uploading files to Dropbox or Drive, emailing links to yourself, or—worst of all—plugging your phone into your computer just to get your stuff from point A to B, stop. There’s an easier way. In fact, we’ve got three easier ways. Let’s get to it.






The Best All-Around Option: Pushbullet


If you’ve been using Android for any amount of time, then you’ve likely heard of Pushbullet. If you still haven’t given it a shot, I can tell you now: you’re missing out. Pushbullet is easily one of the most powerful and useful applications available for Android, especially when it comes to getting stuff to your phone without actually touching it. Here are just a few of things that Pushbullet can do:
  • SMS from a real keyboard: Send SMS directly from your computer without touching your phone.
  • Mirror notifications on your computer: Never miss another notification—Pushbullet will send all notificationss from your phone to your PC.
  • Send links directly to your phone: Skip emailing links to yourself, just push it directly to the phone.
And that goes without mentioning things like Universal Copy and Paste—a feature that allows you to copy text on your computer and paste it on your phone.

Of course, all this functionality comes with a cost. While the basic version of Pushbullet does offer some functionality—enough for many users, in fact—the best features are all tucked behind a paywall.

For example, you can only send files up to 25MB in size with the free version, where Pushbullet Pro allows files of up to 1GB to be pushed. Similarly, Pro allows for unlimited SMS messaging, where the free version is limited to 100 per month. For some users, this basic functionality may be more than enough, and for others, it may not. The nice part is that you can at the very least check out what Pushbullet has to offer to gauge whether or not it’s worth $4.99 per month (or $39.99 per year) for your specific needs.

To get started with Pusbullet, you’ll need to download the Android app, and browser extension or desktop application.

 

The Most Robust Option: AirDroid



What would a list about remotely managing your phone be without AirDroid? A list I want no part of, and certainly not one I’d create! Of the applications on this list, AirDroid is arguably the most powerful. Basically, it remotely connects to your Android device and offers a desktop-like interface on the PC right in your browser. The list of things AirDroid can do is massive, and it includes:
  • Manage calls and SMS: No need to grab your phone to respond to a message, just do it from the computer.
  • Mirror notifications: See all your phone’s notifications right on the desktop.
  • Send and receive files: Not only can you send files to your phone with AirDroid, but you can also pull files from it. It’s brilliant.
  • Edit contacts: Manage contacts from the comfort of a keyboard and mouse.
  • Manage music and videos: No need to plug up to manage music.
  • Set ringtones: Change your tones without ever touching the phone.
  • Clipboard share: Copy on the computer, paste on the phone.
  • Remote access the Camera: You can see both cameras on your computer screen. That’s neat.
The best part is that almost all of this functionality is offered for free, albeit in a limited quantity. For example, free users are limited to 200MB of data transfers per month, where Premium users have no restrictions on file transfers. Similarly, free users can only have two device connections at any given time, with the Premium account offering support for up to six devices.


That said, you can get a bit more out of AirDroid free just by sharing it on your social accounts. There’s an option called “Bonus” that removes the file transfer quota (normally 200MB), allows files of up to 200MB to be transferred, and offers other advanced features that are normally reserved for Premium users, like remote camera access, an ad-free experience, and the option to have AirDroid take pictures when someone tries to unlock your phone. And all you have to do is share it on Facebook, Twitter, or Google+ using “Bonus” method found in the app. It’s pretty simple.

If even the Bonus features aren’t enough for you, however, AirDroid Premium is very reasonably priced at $1.99 a month, $19.99 a year, or $38.99 for two years.

 

The Simplest Option: Portal


 






So, you like the idea of Pushbullet’s easy way of sharing files, but don’t really want the extra fluff? Good news: Portal is the answer. it’s made by the same guys who made Pushbullet, and is essentially just a super stripped-down version of their namesake app. It’s basically just a quick and easy way to get things from your PC to phone.

You can use Portal to transfer one file, a few files, or whole folders at one time, and even browse the files and folders you’ve transferred to your phone. Portal is simple, but so powerful. And best of all: it’s free. If you’re not a Pushbullet user, it’s definitely worth a shot.

Android is awesome, and being able to remotely manage your files, messages, and more from your PC is one of the things that makes it so great. Depending on how much functionality you’re looking for, you should be able to cover pretty much all your bases with one (or even two!) of these three.

How to Gain Full Permissions to Edit Protected Windows Registry Keys

$
0
0

We talk about a lot of cool things here at Tech Support that you can do by editing the Windows Registry. Occasionally, though, you will run into a Registry key or value that you don’t have permission to edit. When you try, you’ll see an error message saying “Cannot edit _____: Error writing the value’s new contents.” Fortunately, just like in the Windows file system, the Registry provides tools that let you take ownership of and edit permissions for keys. Here’s how to do it.






Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. So there’s a reason some of these Registry keys are protected. Editing a protected key can sometimes mess up Windows or the app the key relates to. We will never point you to any hacks that we haven’t tested ourselves, but it still pays to be careful. If you’ve never worked with the Registry before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

In Registry Editor, right-click the key that you can’t edit (or the key that contains the value you can’t edit) and then choose “Permissions” from the context menu.



In the Permissions window that appears, click the “Advanced” button.


Next, you’re going to take ownership of the Registry key. In the “Advanced Security Settings” window, next to the listed Owner, click the “Change” link.


In the “Select User or Group” window, in the “Enter the object name to select” box, type the name of your Windows user account (or your email address if you have a Microsoft account) and then click the “Check Names” button to validate the account name. When that’s done, click OK to close the “Select User or Group” window and then click OK again to close the “Advanced Security Settings” window.


Back at the regular Permissions window, select the Users group and then choose the “Allow” check box next to the “Full Control” permission. If you prefer, you can just give your user account full permissions rather than the Users group. To do that, click the Add button, walk through the steps to add your user account to the list, and then give that account the Full Control permission. Whichever method you choose, click OK when you’re done to return to Registry Editor.

 






Back in Registry Editor, you should now be able to make the changes to the key you’ve taken ownership of and given yourself full permissions to edit. You likely won’t run into protected keys that often when editing the Registry. We rarely come across them ourselves. Still, it’s good to know how to get around that protection when you need to.

How to Protect Your Linux Server Against the HTTPOXY Vulnerability

$
0
0
On July 18th, 2016, a CGI application vulnerability, referred to as HTTPoxy, was disclosed. An attacker can exploit vulnerable deployments by passing an HTTP Proxy header with their request, which will alter the URL used by the application when contacting backing services. This can be used to leak credentials, modify responses to the application, etc.





The vulnerability is caused by a name collision between the HTTP_PROXY environmental variable, frequently used to specify the location of a backend proxy service, and the Proxy HTTP client header. The CGI specification calls for client-provided headers to be passed to the environment with a HTTP_ prefix for namespacing. This mangling clashes with configuration variables like HTTP_PROXY, which also start with HTTP_. If a CGI application or a library uses this variable without additional processing, it could end up using the value provided by the client when attempting connections to the proxy service.

As this vulnerability impacts a variety of CGI-like implementations, a number of security vulnerability identifiers have been created: CVE-2016-5386, CVE-2016-5386, CVE-2016-5387, CVE-2016-5388, CVE-2016-1000109, and CVE-2016-1000110 (At the time of this writing, these are reserved, but not filled out).

The HTTPoxy vulnerability has been known in some forms since 2001, but never recognized as a widespread issue until recently. Although it may affect many deployments, mitigation is quite simple and straight forward.

Vulnerable Servers and Applications

HTTPoxy is a general vulnerability found by many CGI implementations. An application or server can correctly implement the CGI specification and still be vulnerable.

For a deployment to be vulnerable, it must:
  • Use the HTTP_PROXY environmental variable to configure proxy connections: Either in the application code itself or any libraries that are used leverages. This is a fairly standard method of configuring proxy servers using the environment.
  • Make requests to backend services using HTTP: Because the name collision is specific to the HTTP_ prefix, only requests made by the application using HTTP will be affected. Requests using HTTPS or any other protocols are not vulnerable.
  • Operate in a CGI or CGI-like environment: Deployments where client headers are translated into HTTP_ prefixed environmental variables are vulnerable. Any compliant implementation of CGI or related protocols like FastCGI will do this.
As you can see, a combination of deployment- and application-specific factors are necessary for a deployment to be vulnerable. To test whether your deployment is affected, Luke Rehmann has created a simple site to check publicly accessible sites for vulnerability.

 

Language Specific Information

PHP applications in particular should be audited, since CGI-like deployments are much more common in the PHP ecosystem than in other languages. Furthermore, the widespread usage of the getenv method in popular libraries amplifies this issue, as it is not immediately clear that this will return unsanitized user input, not just configuration variables. Specific libraries that are currently affected are Guzzle (version 4.0.0rc2 and greater), Artax, and Composer's StreamContextBuilder class.

Other languages that were found to be vulnerable when deployed using CGI were Python and Go. These languages are more commonly deployed using other, non-vulnerable methods. However, if CGI is used, libraries that naively read the HTTP_PROXY variable without modifying their behavior are vulnerable.

 

How to Defeat the Vulnerability

Fortunately, HTTPoxy is relatively simple to fix. The vulnerability can be addressed from the web server layer or the application or library:
  • Applications or libraries can ignore the HTTP_PROXY variable when they are in a CGI environment.
  • Applications or libraries can use a different environmental variable to configure proxy connections
  • Web servers or proxies can unset the Proxy header received in client requests
If you are using a vulnerable library, you should mitigate the threat on the server end until patches are available to address the issue. If you are a library or application author and your project relies on the HTTP_PROXY variable to configure a proxy backend, consider using an alternative variable that will not clash when running in a CGI-like environment. Ruby and some other projects use CGI_HTTP_PROXY for this purpose.

Since the Proxy header is not a standard HTTP header, it can be safely ignored in almost all cases. This can be done in the web server or load balancer used to direct requests to the application itself. Because the Proxy HTTP header does not have any standard legitimate purpose, it can almost always be dropped.
Any common web server, load balancer, or proxy can unset the appropriate headers.

 

Removing the HTTP Proxy Header with Apache

If you are running the Apache HTTP web server, the mod_headers module can be used to unset the header for all requests.

 

Ubuntu and Debian Servers

To enable mod_headers in Ubuntu or Debian servers, type:

  • sudo a2enmod headers


Afterwards, open the global configuration file:

  • sudo nano /etc/apache2/apache2.conf


Towards the bottom, add:
/etc/apache2/apache2.conf
. . .
RequestHeader unset Proxy early
Save and close the file.
Check the configuration for syntax errors:

  • sudo apache2ctl configtest


Restart the service if no syntax errors are reported:

  • sudo service apache2 restart



CentOS and Fedora Servers

The mod_headers module should be enabled by default for conventional installations. To unset the Proxy header, open the global configuration file:

  • sudo nano /etc/httpd/conf/httpd.conf


Towards the bottom, add:
/etc/httpd/conf/httpd.conf
. . .
RequestHeader unset Proxy early
Save and close the file when you are finished.
Check for syntax errors by typing:

  • sudo apachectl configtest


If no syntax errors are reported, restart the service by typing:

  • sudo service httpd restart


 

Removing the HTTP Proxy Header with Nginx

In Nginx, mitigation is similarly trivial. You can easily sanitize the environment for any CGI-like environment running on the server or upstream.

 

Ubuntu and Debian Servers

On Ubuntu and Debian servers, FastCGI parameters are typically included from either the fastcgi_params or fastcgi.conf files when setting up a FastCGI proxy. You can unset the HTTP_PROXY header in both of these files:

  • echo 'fastcgi_param HTTP_PROXY "";' | sudo tee -a /etc/nginx/fastcgi.conf

  • echo 'fastcgi_param HTTP_PROXY "";' | sudo tee -a /etc/nginx/fastcgi_params


If you are not sourcing one of files when configuring your FastCGI proxies, be sure to include this same line in the proxy location itself:
/etc/nginx/sites-enabled/some_site.conf
. . .
location ~ \.php$ {
. . .
fastcgi_param HTTP_PROXY "";
. . .
}
}
If you are using Nginx for conventional HTTP proxying, you should clear the HTTP Proxy header as well. HTTP proxying headers are set in the /etc/nginx/proxy_params file. You can add the rule to unset the Proxy header to that file by typing:

  • echo 'proxy_set_header Proxy "";' | sudo tee -a /etc/nginx/proxy_params


Again, if you are not sourcing this file from within your server block configuration, you'll have to add it in the proxy location itself:
/etc/nginx/sites-enabled/some_site.conf
. . .
location /application/ {
. . .
proxy_pass http://127.0.0.1;
proxy_set_header Proxy "";
. . .
}
}
Check for syntax errors by typing:

  • sudo nginx -t


If no errors are reported, restart the service:

  • sudo service nginx restart


 

CentOS and Fedora Servers

Nginx on CentOS and Fedora also uses the same fastcgi_params and fastcgi.conf files to configure FastCGI proxying. Unset the HTTP_PROXY header in both of these files by typing:

  • echo 'fastcgi_param HTTP_PROXY "";' | sudo tee -a /etc/nginx/fastcgi.conf

  • echo 'fastcgi_param HTTP_PROXY "";' | sudo tee -a /etc/nginx/fastcgi_params


If you are not sourcing one of these files when configuring your FastCGI proxies, be sure to include this same line in the proxy location itself:
/etc/nginx/nginx.conf
. . .
location ~ \.php$ {
. . .
fastcgi_param HTTP_PROXY "";
. . .
}
}
If you are using Nginx for conventional HTTP proxying, you should clear the HTTP Proxy header as well. You just need to add a rule to unset the Proxy header in any location where you are executing a proxy_pass. If you are unsure where proxy_pass is being used, you can easily search your configuration directory:

  • grep -r "proxy_pass" /etc/nginx



Output

/etc/nginx/nginx.conf.default: # proxy_pass http://127.0.0.1;
Any results that are not commented out (like the example above) should be edited to include proxy_set_header Proxy "";:
/etc/nginx/nginx.conf
. . .
location /application/ {
. . .
proxy_pass http://127.0.0.1;
proxy_set_header Proxy "";
. . .
}
}
Check for syntax errors by typing:

  • sudo nginx -t


If no errors are reported, restart the service:

  • sudo service nginx restart


 

Removing the HTTP Proxy Header with HAProxy

If you are using HAProxy to direct traffic to your application servers, you can drop the Proxy header before forwarding the traffic.
Open up the /etc/haproxy/haproxy.cfg file for editing:

  • sudo nano /etc/haproxy/haproxy.cfg


You can set the http-request directive in the frontend, backend, or listen sections of your configuration.
/etc/haproxy/haproxy.cfg
frontend www
http-request del-header Proxy
. . .

backend web-backend
http-request del-header Proxy
. . .

listen appname 0.0.0.0:80
http-request del-header Proxy
. . .





These do not need to be set in each of the sections, but it won't hurt to include them. Save and close the file when you are finished.
Check the syntax by typing:

  • sudo haproxy -c -f /etc/haproxy/haproxy.cfg


If no problems are found, restart the service by typing:

  • sudo service haproxy restart


 

Conclusion

The HTTPoxy vulnerability has been out in the open for quite a long time and may affect a large set of applications deployed on the web. Luckily, it is easy to fix using the header-altering capabilities native to any web server.

How To Install and Use BaasBox on Ubuntu 14.04

$
0
0

BaasBox is an application that acts as a database server and application server combined. Out of the box, BaasBox provides user sign-up, user management, role management, content management, file management, and database management with backups. 






Since all of this functionality is exposed via a standard HTTP REST API, developers of web and mobile applications can use BaasBox as a back-end to store data. Developers can also create micro services based on BaasBox which are consumed by other parts of their applications.

This article walks you through installing BaasBox, creating users, working with the administrative console, and exploring the REST API as you create a simple application backend.


Prerequisites

  • You have a Node running Ubuntu 14.04
  • You are logged in to your server as a non-root user with administrative privileges. See the tutorial Initial server setup guide for Ubuntu 14.04 to set this up.
  • You have installed the official Java 8 JRE from Oracle.

Installing and Running BaasBox

To install BaasBox, we download the latest stable version of BaasBox from the official website. You can do this using the wget command as follows:

  • wget http://www.baasbox.com/download/baasbox-stable.zip


We'll use the unzip command to extract BaasBox from the downloaded zip file. In case you don't have unzip, install it using the following command:

  • sudo apt-get install unzip


Now extract the contents of the zip file:

  • unzip baasbox-stable.zip


This command extracts the contents of the zip file into a directory named baasbox-X.Y.Z where X.Y.Z will be the latest version, for instance, 0.9.5. Enter the newly created directory.

  • cd baasbox-X.Y.Z


This directory contains a file named start which needs to be executed to start BaasBox. In order to do that, we first need to make it an executable using the following command:

  • chmod +x ./start


Then to start BaasBox, execute the following command:

  • ./start


You'll see some output, the end of which should look something like:



Output

2016-06-28 14:32:14,554 - [info] - BaasBox is Ready.
2016-06-28 14:32:14,558 - [info] - Application started (Prod)
2016-06-28 14:32:14,733 - [info] - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
2016-06-28 14:32:15,261 - [info] - Session Cleaner: started
2016-06-28 14:32:15,263 - [info] - Session cleaner: tokens: 0 - removed: 0
2016-06-28 14:32:15,263 - [info] - Session cleaner: finished

The highlighted part in the above output indicates that BaasBox is now running and can be accessed on port 9000 on the machine. The default BaasBox configuration listens on this port on all network interfaces. The means that BaasBox is now accessible at:
  • http://localhost:9000 and http://127.0.0.1:9000 from the server that it is installed on (or via an SSH tunnel)
  • http://your_internal_server_ip:9000 from the internal network that your server is on (if it is on an internal network)
  • http://your_ip_address:9000 from the internet if your_ip_address is a publicly accessible IP address.
You can have BaasBox listen on a specific network interface and on a different port, if required. To do this, use the following command:


  • ./start -Dhttp.port=target_port -Dhttp.address=target_interface


Visit http://your_ip_address:9000/console in your browser to access the BaasBox administration console, and you'll see an interface that looks like the following figure:

BaasBox Admin Console With BaasBox running, let's set up an application and some users.

Creating an Application with BaasBox

In this article, we will create a simple Todo List Manager which should:
  • Allow users to sign up
  • Allow users to log in
  • Allow users to create multiple todo lists
  • Allow users to retrieve their own todo lists
  • Allow users to modify their todo lists
  • Allow users to delete their todo lists
  • Allow users to share their todo list with another user
While following along, please note the following:
  • We will create two users with usernames user1 and user2
  • The passwords of these users will be referred to as user1_password and user2_password
  • The session IDs of these users will be referred to as user1_session_id and user2_session_id.
While you can manage BaasBox through the REST API, it is sometimes more convenient to do so using the admin console, which, as you saw in Step 2, is at http://your_ip_address:9000/console. Visit that link in your browser. Since this is your first time using it, log in with the default credentials:
  • Default Username: admin
  • Default Password: admin
  • Default App Code: 1234567890
BaasBox Admin Console Login

After logging in, you'll see the BaasBox dashboard:

BaasBox Dashboard


Let's use the admin console to create users for our application.

Creating Users

User management is one of the most helpful features of BaasBox. BaasBox has some built-in users which are private and cannot be edited. This includes the admin user which you use while logging in to the admin console.
BaasBox also allows you to define roles and assign them to users to implement fine grained access control. By default, BaasBox has the following 3 roles:
  • administrator - this role has complete, unrestricted access
  • backoffice - this role grants access to the content created by registered users
  • registered - this is the default role foe newly registered users
You can add your own roles in addition to these preconfigured ones. When a new role is created, it has the same permissions as the registered role mentioned above.

You can create users in BaasBox either through the admin console or through the REST API. Typically you'll use the REST API to create users programmatically, such as through the user signup process of your app.
When you add users through the admin console, you can set a custom role for them.

However, when using the built-in REST API to sign up, the newly created users are assigned the registered role.

To create a new user from BaasBox's admin console, open the USERS > Users menu in the admin console and click on the New User button.

BaasBox Admin Console - New User

This opens a form where you can fill in the details of the user you're creating:

BaasBox Admin Console - New User

The Username, Password, Retype Password and Role fields are required while every other field is optional. Note that you can scroll down in this form to fill in additional details if you need to.

Set the username for this user to user1. You can select any role but the most commonly used one is registered. Once you have entered all the details, click the Save changes button to complete the user creation process.

We'll create users using the REST API in a subsequent section. Now let's configure a place for our application's content.

Creating a Collection

BaasBox organizes your content into collections which are similar to collections offered by NoSQL databases like MongoDB. Collections hold documents of the same type. Users familiar with SQL databases can consider a collection to be roughly similar to a table. Similarly, a document is somewhat like a record.

Collections can only be created by administrators. While the most common way of creating a collection is from the admin console, it is also possible to do so using the REST API. In this section, we'll take a look at how to create a collection from the admin console.

All of the content management functionality is available in the admin console in the Collections and Documents menus in the DATA section.

Open the DATA > Collections menu. You'll see a page that lists all the current collections in your application.

BaasBox Admin Console - Collections

To create a new collection, click the New Collection button. This displays a form prompting you for the collection name.

BaasBox Admin Console - New Collection

Enter todos as the name of the collection and click Save changes to complete the collection creation process. The application's users can now access this collection and their documents in this collection using the REST API. Let's look at how that works.


Using the REST API

Now that we know how to use the admin console to perform various tasks, let's take a look at how to perform the same tasks using BaasBox's REST API.

The REST API can be consumed by various types of applications from web and mobile apps to console apps, we'll use curl to simulate requests in the examples that follow. You can adapt these examples to your needs depending on your front-end platform.

 

Creating a User Using the REST API

The general format of the curl command used to create a user is as follows:

  • curl http://your_ip_address:9000/user \

  • -d '{"username" : "username", "password" : "password"}' \

  • -H Content-type:application/json \

  • -H X-BAASBOX-APPCODE:baasbox_appcode


In our case, we will create a user with username user2. Choose any password you like. We will use the default value for the X-BAASBOX-APPCODE header which is 1234567890. Using these values, our command becomes:

  • curl http://your_ip_address:9000/user \

  • -d '{"username" : "user2", "password" : "user2_password"}' \

  • -H Content-type:application/json \

  • -H X-BAASBOX-APPCODE:1234567890


The output of executing this command should be similar to:

Output 
{"result":"ok","data":{"user":{"name":"user2","status":"ACTIVE","roles":[{"name":"registered","isrole":true}]},"id":"a4353548-501a-4c55-8acd-989590b2393c","visibleByAnonymousUsers":{},"visibleByTheUser":{},"visibleByFriends":{},"visibleByRegisteredUsers":{"_social":{}},"signUpDate":"2016-04-05T13:12:17.452-0400","generated_username":false,"X-BB-SESSION":"992330a3-4e2c-450c-8d83-8eaf2903188b"},"http_code":201}

Here's the formatted version of the above output:

Output

{
"result": "ok",
"data": {
"user": {
"name": "user2",
"status": "ACTIVE",
"roles": [
{
"name": "registered",
"isrole": true
}
]
},
"id": "a4353548-501a-4c55-8acd-989590b2393c",
"visibleByAnonymousUsers": {},
"visibleByTheUser": {},
"visibleByFriends": {},
"visibleByRegisteredUsers": {
"_social": {}
},
"signUpDate": "2016-04-05T13:12:17.452-0400",
"generated_username": false,
"X-BB-SESSION": "992330a3-4e2c-450c-8d83-8eaf2903188b"
},
"http_code": 201
}

Note the highlighted values in the above output. BaasBox generates a unique id for every user. You'll use this ID when you want to fetch, modify, or delete this particular user's document via the REST API.

The second highlighted value is the X-BB-SESSION which is the session ID that needs to be present in all future queries that user2 will make. We will refer to this value as user2_session_id in subsequent sections.

 

Logging the User In Using the REST API

Now that we have the session id for user2, let's obtain one for user1, the user we created earlier in the admin console. We'll do this by logging in as user1 using the REST API. The general format of the curl command used for logging in is:

  • curl http://your_ip_address:9000/login \

  • -d "username=username" \

  • -d "password=password" \

  • -d "appcode=baasbox_appcode"


In our case, the username is user1, the password is whatever was used while creating user1, and the BaasBox App Code is 1234567890. Using these values, our command becomes:

  • curl http://your_ip_address:9000/login \

  • -d "username=user1" \

  • -d "password=user1_password" \

  • -d "appcode=1234567890"


The output of executing this command should be similar to:

Output 
{"result":"ok","data":{"user":{"name":"user1","status":"ACTIVE","roles":[{"name":"registered","isrole":true}]},"id":"84191e4c-2471-48a7-98bb-ecdaf118285c","visibleByAnonymousUsers":{},"visibleByTheUser":{},"visibleByFriends":{},"visibleByRegisteredUsers":{"_social":{}},"signUpDate":"2016-04-05T13:06:35.750-0400","generated_username":false,"X-BB-SESSION":"74400b4b-d16c-45a2-ada3-1cd51cc202bb"},"http_code":200}

Here's the formatted version of the above output:

Output

{
"result": "ok",
"data": {
"user": {
"name": "user1",
"status": "ACTIVE",
"roles": [
{
"name": "registered",
"isrole": true
}
]
},
"id": "84191e4c-2471-48a7-98bb-ecdaf118285c",
"visibleByAnonymousUsers": {},
"visibleByTheUser": {},
"visibleByFriends": {},
"visibleByRegisteredUsers": {}
},
"signUpDate": "2016-04-05T13:06:35.750-0400",
"generated_username": false,
"X-BB-SESSION": "74400b4b-d16c-45a2-ada3-1cd51cc202bb"
},
"http_code": 200
}





The highlighted part of the response above shows the session ID for user1 that we need to use in all future queries that user1 will make. We will refer to this value as user1_session_id from now on.

 

Creating a Document Using the REST API

Let's create two documents in our application. We'll assign one document to user1, the user we created using the admin console, and we'll assign the other document to user2, the user we created through the REST API. The structure of the documents we'll create will look like the following example:

Sample Document Contents

{
"list_name": "Task List Name",
"tasks": [
{
"task": "Task Details",
"done": false
},
{
"task": "Task Details",
"done": false
}
]
}

Looking at the structure, we can see that a document will have two properties. One is the name of the task list and the other is the list of tasks in that list.

The general format of the curl command used to create a new document is:

  • curl -X POST http://your_ip_address:9000/document/collection_name \

  • -d 'json_formatted_document' \

  • -H Content-type:application/json \

  • -H X-BB-SESSION:session_id


Let's begin by creating a document for user1. In our case, the name of the collection is todos and the document we want to insert looks like:



Document Contents

{
"list_name": "User 1 - List 1",
"tasks": [
{
"task": "User1 List1 task 1",
"done": false
},
{
"task": "User1 List1 task 2",
"done": false
}
]
}

To ensure the document gets associated with user1, we use user1's session ID that we obtained when we logged that user into our system.

Enter the following command to create the document for user1:

  • curl -X POST http://your_ip_address:9000/document/todos \

  • -d '{"list_name":"User 1 - List 1","tasks":[{"task":"User1 List1 task 1","done":false},{"task":"User1 List1 task 2","done":false}]}' \

  • -H Content-type:application/json \

  • -H X-BB-SESSION:user1_session_id


Executing this command results in an output similar to the following:

Output 
{"result":"ok","data":{"@rid":"#24:1","@version":2,"@class":"todos","list_name":"User 1 - List 1","tasks":[{"task":"User1 List1 task 1","done":false},{"task":"User1 List1 task 2","done":false}],"id":"c83309e7-cbbd-49c8-a76b-9e8fadc72d6f","_creation_date":"2016-04-05T20:34:30.132-0400","_author":"user1"},"http_code":200}

Here's the formatted version of the above output:

Output

{
"result": "ok",
"data": {
"@rid": "#24:1",
"@version": 2,
"@class": "todos",
"list_name": "User 1 - List 1",
"tasks": [
{
"task": "User1 List1 task 1",
"done": false
},
{
"task": "User1 List1 task 2",
"done": false
}
],
"id": "c83309e7-cbbd-49c8-a76b-9e8fadc72d6f",
"_creation_date": "2016-04-05T20:34:30.132-0400",
"_author": "user1"
},
"http_code": 200
}

Just like it did for the new users, BaasBox creates an id, which is highlighted in the previous example, for all new documents. Make a note of this id as we'll use it later while giving user2 access to this list. In the subsequent sections, we'll refer to the id of this document as user1_list1_id.

Now, on your own, use the same method to do the following:
  • Create another list for user1
  • Create two lists for user2
After completing these steps, you'll have a total of 4 document in the todos collection. In subsequent sections, we'll refer to the IDs of these documents as:
  • user1list1id
  • user1list2id
  • user2list1id
  • user2list2id
Now we have some data we can use so we can investigate how we query data using the REST API.

 

Retrieving a Single Document Using the REST API

The general format of the curl command used to fetch a document by its id is:

  • curl http://your_ip_address:9000/document/collection_name/document_id \

  • -H X-BB-SESSION:session_id


If we want to fetch the first document created by user1 (with user1's credentials), the command should be:

  • curl http://your_ip_address:9000/document/todos/user1_list1_id \

  • -H X-BB-SESSION:user1_session_id


Executing this command gives us an output similar to the following:

Output
{"result":"ok","data":{"@rid":"#24:1","@version":2,"@class":"todos","list_name":"User 1 - List 1","tasks":[{"task":"User1 List1 task 1","done":false},{"task":"User1 List1 task 2","done":false}],"id":"c83309e7-cbbd-49c8-a76b-9e8fadc72d6f","_creation_date":"2016-04-05T20:34:30.132-0400","_author":"user1"},"http_code":200}

Here's the formatted version of the response:

Output

{
"result": "ok",
"data": {
"@rid": "#24:1",
"@version": 2,
"@class": "todos",
"list_name": "User 1 - List 1",
"tasks": [
{
"task": "User1 List1 task 1",
"done": false
},
{
"task": "User1 List1 task 2",
"done": false
}
],
"id": "c83309e7-cbbd-49c8-a76b-9e8fadc72d6f",
"_creation_date": "2016-04-05T20:34:30.132-0400",
"_author": "user1"
},
"http_code": 200
}

Now that you know how to retrieve a single document, try to do the same thing again, except this time fetch the document using user2's session id:

  • curl -X POST http://your_ip_address:9000/document/todos/user1_list1_id \

  • -H X-BB-SESSION:user2_session_id


Executing this command shows an output similar to the following:

Output 
{"result":"error","message":"c83309e7-cbbd-49c8-a76b-9e8fadc72d6f not found","resource":"/document/todos/c83309e7-cbbd-49c8-a76b-9e8fadc72d6f","method":"GET","request_header":{"Accept":["*/*"],"Host":["localhost:9000"],"User-Agent":["curl/7.35.0"],"X-BB-SESSION":["8f5a2e48-0f42-4478-bd1b-d28699158c4b"]},"API_version":"0.9.5","http_code":404}

Here's the same output, formatted for readability:

Output

{
"result": "error",
"message": "c83309e7-cbbd-49c8-a76b-9e8fadc72d6f not found",
"resource": "\/document\/todos\/c83309e7-cbbd-49c8-a76b-9e8fadc72d6f",
"method": "GET",
"request_header": {
"Accept": [
"*\/*"
],
"Host": [
"localhost:9000"
],
"User-Agent": [
"curl\/7.35.0"
],
"X-BB-SESSION": [
"8f5a2e48-0f42-4478-bd1b-d28699158c4b"
]
},
"API_version": "0.9.5",
"http_code": 404
}

As you can see, because user2 didn't create this document and didn't have access to this document, the fetch operation failed. If you try to execute the command as user2 but with the id of the document created by user2, you'll be able to fetch that document just fine.

 

Retrieving All Documents Using the REST API

The general format of the curl command used to fetch all accessible documents from a collection is:

  • curl http://your_ip_address:9000/document/collection_name \

  • -H X-BB-SESSION:session_id


Bear in mind that this command will only return the documents that the user has access to. For example, let's try to execute this command as user1:

  • curl http://your_ip_address:9000/document/todos \

  • -H X-BB-SESSION:user1_session_id


Executing this command gives us an output similar to the following:

Output 
{"result":"ok","data":[{"@rid":"#24:1","@version":2,"@class":"todos","list_name":"User 1 - List 1","tasks":[{"task":"User1 List1 task 1","done":false},{"task":"User1 List1 task 2","done":false}],"id":"c83309e7-cbbd-49c8-a76b-9e8fadc72d6f","_creation_date":"2016-04-05T20:34:30.132-0400","_author":"user1"},{"@rid":"#24:2","@version":1,"@class":"todos","list_name":"User 1 - List 2","tasks":[{"task":"User1 List2 task 1","done":false},{"task":"User1 List2 task 2","done":false}],"id":"7c99c877-d269-4281-8a22-ef72175085f4","_creation_date":"2016-04-05T20:46:14.338-0400","_author":"user1"}],"http_code":200}


Here's the formatted version of that output:

Output

{
"result": "ok",
"data": [
{
"@rid": "#24:1",
"@version": 2,
"@class": "todos",
"list_name": "User 1 - List 1",
"tasks": [
{
"task": "User1 List1 task 1",
"done": false
},
{
"task": "User1 List1 task 2",
"done": false
}
],
"id": "c83309e7-cbbd-49c8-a76b-9e8fadc72d6f",
"_creation_date": "2016-04-05T20:34:30.132-0400",
"_author": "user1"
},
{
"@rid": "#24:2",
"@version": 1,
"@class": "todos",
"list_name": "User 1 - List 2",
"tasks": [
{
"task": "User1 List2 task 1",
"done": false
},
{
"task": "User1 List2 task 2",
"done": false
}
],
"id": "7c99c877-d269-4281-8a22-ef72175085f4",
"_creation_date": "2016-04-05T20:46:14.338-0400",
"_author": "user1"
}
],
"http_code": 200
}

As you can see from the output, only the documents that user1 had access to were returned. If you were to perform the same query using the session id belonging to user2, you'll see a different set of documents.

 

Updating a Document Using the REST API

The general format of the curl command used to update a document is:

  • curl -X PUT http://your_ip_address:9000/document/collection_name/document_id \

  • -d 'new_json_formatted_document' \

  • -H Content-type:application/json \

  • -H X-BB-SESSION:session_id


There are two things to keep in mind while trying to update a document:
  • Only the document owner can modify a document
  • An update does not merge the old and the new documents. It replaces the old document with the new one. This means that if the update command includes a documents with some fields missing from the original version, these fields will be lost.
Let's use this command to update the document with id user1_list1_id with the following contents:



New Document Contents

{
"list_name": "User 1 - List 1 Updated",
"tasks": [
{
"task": "New User1 List1 task 1",
"done": false
}
]
}

The command to make this update is:

  • curl -X PUT http://your_ip_address:9000/document/todos/user1_list1_id \

  • -d '{"list_name":"User 1 - List 1 Updated","tasks":[{"task":"New User1 List1 task 1","done":false}]}' \

  • -H Content-type:application/json \

  • -H X-BB-SESSION:user1_session_id


Executing this command gives us an output similar to the following:

Output 
{"result":"ok","data":{"@rid":"#24:1","@version":4,"@class":"todos","list_name":"User 1 - List 1 Updated","tasks":[{"task":"New User1 List1 task 1","done":false}],"id":"c83309e7-cbbd-49c8-a76b-9e8fadc72d6f","_creation_date":"2016-04-05T20:34:30.132-0400","_author":"user1"},"http_code":200}

Here's that same output, formatted:

Output

{
"result": "ok",
"data": {
"@rid": "#24:1",
"@version": 4,
"@class": "todos",
"list_name": "User 1 - List 1 Updated",
"tasks": [
{
"task": "New User1 List1 task 1",
"done": false
}
],
"id": "c83309e7-cbbd-49c8-a76b-9e8fadc72d6f",
"_creation_date": "2016-04-05T20:34:30.132-0400",
"_author": "user1"
},
"http_code": 200
}

As you can see, the document has been updated with the new information.

 

Deleting a Document Using the REST API

The general format of the curl command used to delete a document is:

  • curl -X DELETE http://your_ip_address:9000/document/collection_name/document_id \

  • -H X-BB-SESSION:session_id


Only the document owner and users with delete permission on a document can delete that document.
Let's use this command to delete the document with id user1_list1_id as follows:

  • curl -X DELETE http://your_ip_address:9000/document/todos/user1_list1_id \

  • -H X-BB-SESSION:user1_session_id


Executing this command gives the following output:

Output

{"result":"ok","data":"","http_code":200}

This indicates that the document has been successfully deleted. Any future attempt to access this document by id will now fail.

 

Granting Access to Another User Using the REST API

We have seen how, by default, BaasBox prevents users from accessing documents not created by them. However, sometimes there's a requirement to give multiple users access to a document. Let's grant user2 access to the document with id user1_list1_id.

The general format of the curl command used to grant access to a document is:

  • curl -X PUT http://your_ip_address:9000/document/collection_name/document_id/access_type/user/username \

  • -H X-BB-SESSION:session_id


This command will only work if it is executed by a user who has complete access to this document. The access_type placeholder can have one of the following 4 values:
  • read
  • update
  • delete
  • all
To grant user2 read access to the document with id user1_list1_id, execute the following command using the session id of user1:

  • curl -X PUT http://your_ip_address:9000/document/todos/user1_list1_id/read/user/user2 \

  • -H X-BB-SESSION:user1_session_id


Executing this command gives the following output:



Output

{"result":"ok","data":"","http_code":200}

This indicates that user2 now has access to document user1_list1_id. If you try to access this document as user2, you'll now see the document details instead of an error response


Using Supervisor to Keep the Application Running

Whenever you have a long running application, there is always a risk that it could stop running. This could happen due to a variety of reasons such as application error, system reboot, etc. It's good practice to configure the application to restart in case of an unexpected shutdown. This minimizes the administrative overhead of maintaining the application.

For this application, we will use Supervisor which makes it easy to manage long running applications.

First, install Supervisor:

  • sudo apt-get install supervisor


To make Supervisor manage our application, we need to create a configuration file. We will name this file baasbox.conf and place it in the /etc/supervisor/conf.d directory.

  • sudo nano /etc/supervisor/conf.d/baasbox.conf







Enter the following into the file, replacing the highlighted sections as appropriate.
/etc/supervisor/conf.d/baasbox.conf
[program:Baasbox]
directory = /home/sammy/baasbox-0.9.5
command = /home/sammy/baasbox-0.9.5/start
autostart = true
autorestart = true
startsecs = 5
user = sammy
stdout_logfile = /var/log/supervisor/baasbox.log

We now need to notify Supervisor of these changes and get it to use these changes. Execute the following command:

  • supervisorctl reread


Then run this command:

  • supervisorctl update


Now whenever your application shuts down for any reason, Supervisor will ensure that it restarts without requiring any manual intervention.

 

Conclusion

In this article, we saw how to use BaasBox to manage content, users and permissions using the admin console and using the REST API. There are is a lot more that BaasBox offers in addition to the topics covered in this article.

You can explore the BaasBox admin console further to get familiar with sections that allow you to manage files, take and restore database backups and configure the availability of API end points. More importantly, you are now well set to start using BaasBox in your next application.

How To Create a Multi-Node MySQL Cluster on Ubuntu 16.04

$
0
0
MySQL cluster is a software technology which provides high availability and throughput. If you are already familiar with other cluster technologies, you will find MySQL cluster similar to them. In short, there is one or more management nodes which control the data nodes (where data is stored). After consulting with the management node, clients (MySQL clients, servers, or native APIs) connect directly to the data nodes.






You may wonder how MySQL replication is related to MySQL cluster. With the cluster there is no typical replication of data, but instead there is synchronization of the data nodes. For this purpose a special data engine must be used — NDBCluster (NDB). Think of the cluster as a single logical MySQL environment with redundant components. Thus, a MySQL cluster can participate in replication with other MySQL clusters.

MySQL cluster works best in a shared-nothing environment. Ideally, no two components should share the same hardware. For simplicity, and demonstration purposes, we'll limit ourselves to using only three Nodes.

There will be two Nodes acting as data nodes which are syncing data between themselves. The third Node will be used for the cluster manager and at the same time for the MySQL server/client. If you have more Nodes, you can add more data nodes, separate the cluster manager from the MySQL server/client, and even add more Nodes as cluster managers and MySQL servers/clients.

A simple MySQL cluster


Prerequisites

You will need a total of three Nodes — one Node for the MySQL cluster manager and the MySQL server/client and two Nodes for the redundant MySQL data nodes.

  • Three Ubuntu 16.04 Nodes with a minimum of 1 GB RAM and private networking enabled
  • Non-root user with sudo privileges for each Node (Initial Server Setup with Ubuntu 16.04 explains how to set this up.)
MySQL cluster stores a lot of information in RAM. Each Node should have at least 1GB of RAM.
As mentioned earlier be sure to setup custom records for the 3 Nodes. For the sake of simplicity and convenience, we'll use the following custom records for each Node in the  

/etc/hosts file:
10.XXX.XX.X node1.mysql.cluster
10.YYY.YY.Y node2.mysql.cluster
10.ZZZ.ZZ.Z manager.mysql.cluster

Please replace the highlighted IPs with the private IPs of your Nodes correspondingly.

Except otherwise noted, all of the commands that require root privileges in this tutorial should be run as a non-root user with sudo privileges.

Downloading and Installing MySQL Cluster

At the time of writing this tutorial, the latest GPL version of the MySQL cluster is 7.4.11. The product is built on top of MySQL 5.6 and it includes:
  • Cluster manager software
  • Data node manager software
  • MySQL 5.6 server and client binaries
You can download the free, Generally Available (GA) MySQL cluster release from the official MySQL cluster download page. From this page, choose the Debian Linux platform package, which is also suitable for Ubuntu. Also make sure to select the 32-bit or the 64-bit version depending on the architecture of your Nodes. Upload the installation package to each of your Nodes.

The installation instructions will be the same for all Nodes, so complete these steps on all 3 Nodes.
Before you start the installation, the libaio1 package must be installed since it is a dependency:

  • sudo apt-get install libaio1


After that, install the MySQL cluster package:

  • sudo dpkg -i mysql-cluster-gpl-7.4.11-debian7-x86_64.deb


Now you can find the MySQL cluster installation in the directory /opt/mysql/server-5.6/. We'll be working especially with the bin directory (/opt/mysql/server-5.6/bin/) where all the binaries are.

The same installation steps should be performed on all three Nodes regardless of the fact that each will have different function — manager or data node.

Next, we will configure the MySQL cluster manager on each Node.

Configuring and Starting the Cluster Manager

In this step we'll configure the MySQL cluster manager (manager.mysql.cluster).

Its proper configuration will ensure correct synchronization and load distribution among the data nodes. All commands should be executed on Node manager.mysql.cluster.

The cluster manager is the first component which has to be started in any cluster. It needs a configuration file which is passed as an argument to its binary file. For convenience, we'll use the file /var/lib/mysql-cluster/config.ini for its configuration.

On the manager.mysql.cluster Node, first create the directory where this file will reside (/var/lib/mysql-cluster):

  • sudo mkdir /var/lib/mysql-cluster


Then create a file and start editing it with nano:

  • sudo nano /var/lib/mysql-cluster/config.ini


This file should contain the following code:

/var/lib/mysql-cluster/config.ini
[ndb_mgmd]
# Management process options:
hostname=manager.mysql.cluster # Hostname of the manager
datadir=/var/lib/mysql-cluster # Directory for the log files

[ndbd]
hostname=node1.mysql.cluster # Hostname of the first data node
datadir=/usr/local/mysql/data # Remote directory for the data files

[ndbd]
hostname=node2.mysql.cluster # Hostname of the second data node
datadir=/usr/local/mysql/data # Remote directory for the data files

[mysqld]
# SQL node options:
hostname=manager.mysql.cluster # In our case the MySQL server/client 
is on the same Node as the cluster manager

For each of the above components we have defined a hostname parameter. This is an important security measure because only the specified hostname will be allowed to connect to the manager and participate in the cluster as per their designated role.

Furthermore, the hostname parameters specify on which interface the service will run. This matters, and is important for security, because in our case the above hostnames point to private IPs which we have specified in the /etc/hosts files. Thus, you cannot access any of the above services from outside of the private network.

In the above file you can add more redundant components such as data nodes (ndbd) or MySQL servers (mysqld) by just defining additional instances in the exactly the same manner.

Now you can start the manager for the first time by executing the ndb_mgmd binary and specifying the config file with the -f argument like this:

  • sudo /opt/mysql/server-5.6/bin/ndb_mgmd -f /var/lib/mysql-cluster/config.ini


You should see a message about successful start similar to this:

Output of ndb_mgmd

MySQL Cluster Management Server mysql-5.6.29 ndb-7.4.11

You would probably like to have the management service started automatically with the server.

The GA cluster release doesn't come with a suitable startup script, but there are a few available online. For the beginning you can just add the start command to the /etc/rc.local file and the service will be automatically started during boot.

First, though, you will have to make sure that /etc/rc.local is executed during the server startup. In Ubuntu 16.04 this requires running an additional command:

  • sudo systemctl enable rc-local.service


Then open the file /etc/rc.local for editing:

  • sudo nano /etc/rc.local


There add the start command before the exit line like this:
/etc/rc.local
...
/opt/mysql/server-5.6/bin/ndb_mgmd -f /var/lib/mysql-cluster/config.ini
exit 0

Save and exit the file.





The cluster manager does not have to run all the time. It can be started, stopped, and restarted without downtime for the cluster. It is required only during the initial startup of the cluster nodes and the MySQL server/client.


Configuring and Starting the Data Nodes

Next we'll configure the data nodes (node1.mysql.cluster and node2.mysql.cluster) to store the data files and support properly the NDB engine. All commands should be executed on both nodes. You can start first with node1.mysql.cluster and then repeat exactly the same steps on node2.mysql.cluster.

The data nodes read the configuration from the standard MySQL configuration file /etc/my.cnf and more specifically the part after the line [mysql_cluster]. Create this file with nano and start editing it:

  • sudo nano /etc/my.cnf


Specify the hostname of the manager like this:
/etc/my.cnf
[mysql_cluster]
ndb-connectstring=manager.mysql.cluster
Save and exit the file.

Specifying the location of the manager is the only configuration needed for the node engine to start. The rest of the configuration will be taken from manager directly. In our example the data node will find out that its data directory is /usr/local/mysql/data as per the manager's configuration. This directory has to be created on the node. You can do it with the command:

  • sudo mkdir -p /usr/local/mysql/data


After that you can start the data node for the first time with the command:

  • sudo /opt/mysql/server-5.6/bin/ndbd


After a successful start you should see a similar output:

Output of ndbd

2016-05-11 16:12:23 [ndbd] INFO -- Angel connected to 'manager.mysql.cluster:1186'
2016-05-11 16:12:23 [ndbd] INFO -- Angel allocated nodeid: 2

You should have the ndbd service started automatically with the server. The GA cluster release doesn't come with a suitable startup script for this either. Just as we did for the cluster manager, let's add the startup command to the /etc/rc.local file. Again, you will have to make sure that /etc/rc.local is executed during the server startup with the command:

  • sudo systemctl enable rc-local.service


Then open the file /etc/rc.local for editing:

  • sudo nano /etc/rc.local


Add the start command before the exit line like this:
/etc/rc.local
...
/opt/mysql/server-5.6/bin/ndbd
exit 0
Save and exit the file.

Once you are finished with the first node, repeat exactly the same steps on the other node , which is node2.mysql.cluster in our example.


Configuring and Starting the MySQL Server and Client

A standard MySQL server, such as the one that is available in Ubuntu's default apt repository, does not support the MySQL cluster engine NDB. That's why you need a custom MySQL server installation. The cluster package which we already installed on the three Nodes comes with a MySQL server and a client too. As already mentioned, we'll use the MySQL server and client on the management node (manager.mysql.cluster).

The configuration is stored again the default /etc/my.cnf file. On manager.mysql.cluster, open the configuration file:

  • sudo nano /etc/my.cnf


Then add the following to it:
/etc/my.cnf
[mysqld]
ndbcluster # run NDB storage engine
...
Save and exit the file.
As per the best practices, the MySQL server should run under its own user (mysql) which belongs to its own group (again mysql). So let's create first the group:

  • sudo groupadd mysql


Then create the mysql user belonging to this group and make sure it cannot use shell by setting its shell path to /bin/false like this:

  • sudo useradd -r -g mysql -s /bin/false mysql


The last requirement for the custom MySQL server installation is to create the default database. You can do it with the command:

  • sudo /opt/mysql/server-5.6/scripts/mysql_install_db --user=mysql


For starting the MySQL server we'll use the startup script from /opt/mysql/server-5.6/support-files/mysql.server. Copy it to the default init scripts directory under the name mysqld like this:

  • sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysqld


Enable the startup script and add it to the default runlevels with the command:

  • sudo systemctl enable mysqld.service


Now we can start the MySQL server for the first time manually with the command:

  • sudo systemctl start mysqld


As a MySQL client we'll use again the custom binary which comes with the cluster installation. It has the following path: /opt/mysql/server-5.6/bin/mysql. For convenience let's create a symbolic link to it in the default /usr/bin path:

  • sudo ln -s /opt/mysql/server-5.6/bin/mysql /usr/bin/


Now you can start the client from the command line by simply typing mysql like this:

  • mysql


You should see an output similar to:



Output of ndb_mgmd

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.29-ndb-7.4.11-cluster-gpl MySQL Cluster Community Server (GPL)

To exit the MySQL prompt, simply type quit or press simultaneously CTRL-D.
The above is the first check to show that the MySQL cluster, server, and client are working. Next we'll go through more detailed tests to confirm the cluster is working properly.

 

Testing the Cluster

At this point our simple MySQL cluster with one client, one server, one manager, and two data nodes should be complete. From the cluster manager Node (manager.mysql.cluster) open the management console with the command:

  • sudo /opt/mysql/server-5.6/bin/ndb_mgm


Now the prompt should change to the cluster management console. It looks like this:



Inside the ndb_mgm console

-- NDB Cluster -- Management Client --
ndb_mgm>

Once inside the console execute the command SHOW like this:

  • SHOW


You should see output similar to this one:



Output of ndb_mgm

Connected to Management Server at: manager.mysql.cluster:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @10.135.27.42 (mysql-5.6.29 ndb-7.4.11, Nodegroup: 0, *)
id=3 @10.135.27.43 (mysql-5.6.29 ndb-7.4.11, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.135.27.51 (mysql-5.6.29 ndb-7.4.11)

[mysqld(API)] 1 node(s)
id=4 @10.135.27.51 (mysql-5.6.29 ndb-7.4.11)

The above shows that there are two data nodes with ids 2 and 3. They are active and connected. There is also one management node with id 1 and one MySQL server with id 4. You can find more information about each id by typing its number with the command STATUS like this:

  • 2 STATUS


The above command would show you the status of node 2 along with its MySQL and NDB versions:



Output of ndb_mgm

Node 2: started (mysql-5.6.29 ndb-7.4.11)

To exit the management console type quit.

The management console is very powerful and gives you many other options for managing the cluster and its data, including creating an online backup. For more information check the official documentation.

Let's have a test with the MySQL client now. From the same Node, start the client with the mysql command for the MySQL root user. Please recall that we have created a symlink to it earlier.

  • mysql -u root


\Your console will change to the MySQL client console. Once inside the MySQL client, run the command:

  • SHOW ENGINE NDB STATUS \G


Now you should see all the information about the NDB cluster engine starting with the connection details:

Output of mysql

*************************** 1. row ***************************
Type: ndbcluster
Name: connection
Status: cluster_node_id=4, connected_host=manager.mysql.cluster, 
connected_port=1186, number_of_data_nodes=2, number_of_ready_data_nodes=2
connect_count=0
...

The most important information from above is the number of ready nodes — 2. This redundancy will allow your MySQL cluster to continue operating even if one of the data nodes fails while. At the same time your SQL queries will be load balanced to the two nodes.

You can try shutting down one of the data nodes in order to test the cluster stability. The simplest thing would be just to restart the whole Node in order to have a full test of the recovery process. You will see the value of number_of_ready_data_nodes change to 1 and back to 2 again as the node is restarted.

 

Working with the NDB Engine

To see how the cluster really works, let's create a new table with the NDB engine and insert some data into it. Please note that in order to use the cluster functionality, the engine must be NDB. If you use InnoDB (default) or any other engine other than NDB, you will not make use of the cluster.
First, let's create a database called cluster with the command:

  • CREATE DATABASE cluster;


Next, switch to the new database:

  • USE cluster;


Now, create a simple table called cluster_test like this:

  • CREATE TABLE cluster_test (name VARCHAR(20), value VARCHAR(20)) ENGINE=ndbcluster;







We have explicitly specified above the engine ndbcluster in order to make use of the cluster. Next, we can start inserting data with a query like this:

  • INSERT INTO cluster_test (name,value) VALUES('some_name','some_value');


To verify the data has been inserted, run a select query like this:

  • SELECT * FROM cluster_test;


When you are inserting and selecting data like this, you are load-balancing your queries between all the available data node, which are two in our example. With this scaling out you benefit both in terms of stability and performance.

 

Conclusion

As we have seen in this article, setting up a MySQL cluster can be simple and easy. Of course, there are many more advanced options and features which are worth mastering before bringing the cluster to your production environment. As always, make sure to have an adequate testing process because some problems could be very hard to solve later. For more information and further reading please go to the official documentation for MySQL cluster.

What Are The Remote Domains in Exchange 2013 And How They Are Used

$
0
0
In the world of Microsoft Exchange, there are two types of domains that the administrator must understand and configure accordingly: accepted domains and remote domains. Accepted domains are SMTP namespaces for which Exchange is allowed to send or receive email. In the case of receiving email, accepted domains also include those SMTP namespaces for which Exchange will receive a message yet continue to send it onwards to other external email systems. Remote domains are simply those SMTP namespaces that are external to Exchange.







Remote Domain Purpose

Broadly speaking, remote domains are used to control various aspects of messages sent to recipients in domains that are external to the local Exchange organization. Application of remote domain settings permit the following configurations to be applied to messages sent to the domain specified in the remote domain entry:
  • The types of messages that are to be sent to that domain. The typical configuration items here are where an administrator chooses whether to send Out of Office and automatic forwards to the remote domain, but there are other configuration options here as will be explained later in this article series
  • The message format. Remote domains offer several different configurable parameters that affect the message format, such as the Transport Neutral Encapsulation Format (TNEF) conversion settings and message encoding options that affect areas such as the MIME and non-MIME character sets and the line wrap size
  • Whether simple display names are sent or not. This is where the recipient sees the sender’s display name versus only seeing the sender’s SMTP address


The Default Remote Domain

By default, when Exchange 2013 is first installed, a single default remote domain is created. To view the properties of this remote domain, the Exchange Management Shell command to use is the Get-RemoteDomain command and as can be seen from Figure 1-1, the output of this command reveals that the default remote domain has a domain name parameter value of *. This value specifies all remote domains rather than any specific remote domain.

Image
Figure 1-1: The Default Remote Domain

One important rule for Exchange administrators to remember here is that the default remote domain settings will always be used unless other specific remote domains have been configured. For example, the administrator may create a new remote domain for contoso.com in addition to the default remote domain. In this scenario, the settings configured in the contoso.com remote domain will be used for messages that are sent to recipients with contoso.com SMTP addresses, rather than the settings configured in the default remote domain. However, since no other specific remote domains have been created, the settings configured in the default remote domain will still be used for messages that are sent to recipients with SMTP addresses other than contoso.com, such as tailspintoys.com SMTP addresses for example.


Remote Domain Commands

There are only four Exchange Management Shell commands that are used for remote domain administration. They are:
  • Get-RemoteDomain. As seen in the previous section, this command is used to retrieve the settings of any existing remote domains
  • Set-RemoteDomain. This command is used to alter the parameters of any existing remote domains. Examples of using this command will be seen throughout this article series
  • New-RemoteDomain. The New-RemoteDomain command is used to create a new remote domain
  • Remove-RemoteDomain. This command is used to remove an existing remote domain entry
In the previous section, the example given was where an administrator created a new remote domain for contoso.com. To do this, it’s simply a case of running the New-RemoteDomain command and the required parameters. In fact, the only required parameters are the Name and DomainName parameters, as all other parameters are optional. For example, to create a new remote domain for contoso.com, the administrator could run the following command:

New-RemoteDomain -Name “Contoso” -DomainName contoso.com

To remove a remote domain, the administrator just needs to use the Remove-RemoteDomain command with the Identity parameter to identify the relevant remote domain to remove. Note that the value of the Identity parameter will correspond to the value of the Name parameter used to create the remote domain. It should also be noted that the default remote domain cannot be removed.


Controlling Out of Office Replies

Exchange 2013 supports both the internal and external types of Out of Office messages. Users get the option to specify whether their Out of Office message is sent to internal, external or both types of recipients, but the success of this Out of Office message transfer depends on what is permitted by the Exchange configuration. In Outlook Web App, the Out of Office message configuration choice is presented to users via the screen that can be seen below in Figure 1-2.

Image
Figure 1-2: Setting Internal and External Out of Office Replies

An organization may choose to empower the users themselves with the decision of whether to send Out of Office messages to external recipients, or the remote domain may be configured by the administrator to block the sending of Out of Office messages to external recipients at that domain. External recipients in this scenario means recipients that have addresses from domains that are not configured as an accepted domain within the Exchange configuration. For example, consider the scenario where users in the Exchange organization for Fabrikam ordinarily have fabrikam.com SMTP addresses, but contoso.com has also been configured as an accepted domain to provide SMTP addresses for some users as part of a different brand requirement. External recipients in this scenario would be any recipients that have SMTP addresses other than fabrikam.com or contoso.com, such as tailspintoys.com for example.

To permit Out of Office replies to be sent to recipients from the tailspintoys.com domain, the Exchange administrator for Fabrikam would need to ensure that the remote domain applicable to tailspintoys.com would need to permit external Out of Office messages. The remote domain that applies to tailspintoys.com could be either the default * remote domain or a specific remote domain for tailspintoys.com. The remote domain parameter to view is the AllowedOOFType parameter, and this has a default value of External as can be seen from Figure 1-3. Here it can be seen that the Exchange administrator uses the following command to view the properties of the default * domain and filter for the AllowedOOFType parameter:

Get-RemoteDomain -Identity Default | fl *AllowedOOFType*

Image
Figure 1-3: Default External Setting of AllowedOOFType

It may also be noticed that the AllowedOOFType parameter is displayed by default when viewing the properties of a remote domain, as can be seen earlier in Figure 1-1. Essentially, there is no real need to filter on the AllowedOOFType parameter when using the Get-RemoteDomain command.

A value of External means that the external Out of Office message will be sent to the specific remote domain. If an organization wants to send the internal Out of Office messages to remote domains, a value of Internal must be specified on that remote domain object. To block all Out of Office messages to the specific remote domain, the Exchange administrator can set the AllowedOOFType parameter to a value of None.

There are two other values for the AllowedOOFType parameter that reference legacy clients. The values of External and Internal relate to newer versions of the Outlook client. To consider Out of Office messages sent by clients running Outlook 2003 or earlier, the values of ExternalLegacy and InternalLegacy can be used. For example, suppose Fabrikam determines the requirement to send Out of Office messages from all versions of clients, including Outlook 2003, to all recipients in a specific remote domain. To permit this, the Exchange administrator for Fabrikam configures the specific remote domain such that the AllowedOOFType parameter is set to a value of ExternalLegacy. This is achieved using the following command:

Set-RemoteDomain -Identity Default -AllowedOOFType ExternalLegacy


Controlling Delivery / Non-Delivery Reports

Delivery and non-delivery reports can contain information about the recipients that are referenced in that report.  Perhaps due to security, privacy or other reasons, organizations may desire to prevent this information from being sent to one or more remote domains.  With the remote domain configuration, organizations have the ability to prevent delivery and non-delivery reports, and hence the information they contain, from being sent to recipients that are not part of the local Exchange organization.  The remote domain parameters that control these settings are:
  • DeliveryReportEnabled
  • NDREnabled
Both of these parameters are enabled by default and hence both delivery and non-delivery reports will be sent to remote domain recipients.  To disable either delivery or non-delivery reports from being sent to remote domain recipients, the Exchange administrator simply sets the required parameter to a value of $false.  For example, to disable sending non-delivery reports to a remote domain for neilhobson.com recipients the Exchange administrator could use the following command:

Set-RemoteDomain -Identity neilhobson.com -NDREnabled $false

This example assumes that the actual name of the remote domain object is neilhobson.com, in addition to neilhobson.com being the value of the RemoteDomain parameter.

 As well as preventing the sending of non-delivery reports to remote domain recipients, Exchange 2013 permits another level of configuration on remote domains.  There is another remote domain parameter that is useful for those organizations that want to continue to send non-delivery reports but want to restrict the amount of diagnostic information sent with those reports.  This parameter is called NDRDiagnosticInfoEnabled and is enabled by default.

 For example, consider the non-delivery report shown below.  As can be seen at the bottom of the non-delivery report, the start of the diagnostic information is shown.  This information includes details such as the original message headers.  If the NDRDiagnosticInfoEnabled parameter is set to $false for that remote domain, Exchange limits the amount of diagnostic information sent with the non-delivery report.  Specifically, although the ‘received’ message headers are still present in the non-delivery report, the elements of the headers that can contain details such as server names and IP addresses are stripped.

 Image


Controlling Automatic Replies and Forwards

Not to be confused with Out of Office messages, remote domains can also be used to control automatic replies sent by clients in the local Exchange organization.  In addition, remote domains also support the ability to control automatic forwarding of messages to remote domain recipients.

 Sometimes an organization may choose to send automatic replies to messages, perhaps from a shared mailbox such as a customer enquiry mailbox for example.  Typically, the requirement is to send an automated response to customer messages to acknowledge the request and perhaps state an expected response time to the enquiry.  One way of configuring these automatic replies is to use Outlook rules with the ‘have server reply with a specific message’ action applied to incoming messages.  However, there may also be a requirement to prevent automatic replies from being sent to one or more remote domains.  These options can be controlled via the AutoReplyEnabled parameter of the remote domain object.  Like many parameters already discussed in this article, this parameter has a simple Boolean value, hence an example command to disable automatic replies to the neilhobson.com remote domain could be:

 Set-RemoteDomain -Identity neilhobson.com -AutoReplyEnabled $false

Also, an organization may choose to disable automatic forwards for one or more remote domains, perhaps to prevent users from automatically forwarding messages outside of the organization’s messaging system.  Interestingly, it was noted that the AutoForwardEnabled parameter is set to $false by default for the default remote domain, yet is set to $true by default when creating a new remote domain as shown below.

Image

Exchange administrators may need to watch for this when creating a new remote domain as it could produce unexpected results.  For example, consider the scenario where an Exchange administrator has previously used the default remote domain’s AutoForwardEnabled parameter value of $false to prevent automatic forwards from being sent to any remote domain.  The administrator may discover that automatic forwards are now sent to specific remote domain recipients after creation of that remote domain object in Exchange, unless the administrator remembers that the AutoForwardEnabled parameter for that specific remote domain must also be set to $false.


Controlling Display Name Sending

Another interesting aspect of remote domain configuration is the ability to control sending display names to recipients in remote domains.  The display name is the recipient name that is seen in the Global Address List (GAL).  The two configuration options for remote domain recipients are either to send the user’s display name as seen in the GAL, together with the SMTP address or just send a ‘simple’ display name.  The simple display name option actually means remote domain recipients will only see the sender’s SMTP address rather than the SMTP address and GAL display name.  Why might an organization need to disable sending display names to remote domain recipients?  If an organization uses sensitive or private information in user’s display names, there may be a requirement for preventing that sensitive or private information from being sent externally.

 The ability to disable the sending of display names to remote domain recipients is controlled by the UseSimpleDisplayName parameter on the remote domain settings.  Display names are sent externally by default whereas simple display names are not, meaning that the default value of the UseSimpleDisplayName parameter is $false.  Therefore, the alternative is to enable simple display names by setting the UseSimpleDisplayName parameter to a value of $true.  An example of doing this is shown below, where it can be seen that the ‘simple’ display name is just the sender’s SMTP address rather than the full display name and SMTP address.

 Image


Controlling Message Formats and Their Per-User Settings

Remote domains permit the configuration of a wide variety of message format and encoding options, as well as Transport Neutral Encapsulation Format (TNEF) conversion options.  This is a complex area that likely warrants a dedicated article, but a brief description of the options available follows.  However, the administrator should take the time to research these configuration options further if they are not familiar with them.

 The ContentType parameter of the Set-RemoteDomain cmdlet controls whether messages for remote domain recipients are converted to text or HTML formatted MIME messages and hence it’s possible that an administrator may need to configure a specific remote domain for MIME messages that use text formatting only.  The CharacterSet parameter controls MIME message character sets used for messages that do not already have a character set applied, while the NonMimeCharacterSet parameter controls character sets for messages that do not have a MIME character set applied.

 One key configuration area that an Exchange administrator should be aware of with regards to remote domains and message formats is that several message format configuration elements can be applied on a per-user basis.  In these cases, these per-user settings override the corresponding values that are applied to the remote domain.  When the term ‘per-user’ is used here, it means settings that are configured against mail-enabled contacts or mail-enabled user objects.

 For example, when examining the properties of a mail-enabled contact by using the Get-MailContact cmdlet, it can be seen that there are four parameters that deal with the application of message formatting options for that contact.  These parameters are MacAttachmentFormat, MessageBodyFormat, MessageFormat and UsePreferMessageFormat.  It’s the UsePreferMessageFormat Boolean value parameter that specifies whether the message format settings to be used should be those specified in the remote domain ($false) or those specified in the mail-enabled contact ($true).  The MessageBodyFormat parameter controls whether text, HTML or both can be used to send to the remote recipient.  

Therefore, if the administrator wants to ensure that messages to a particular remote recipient are always sent using text rather than HTML, the administrator would set the following two configuration options using the Set-MailContact cmdlet:
  • UsePreferMessageFormat to $true
  • MessageBodyFormat to ‘text’
The MessageFormat parameter is used to control whether text or MIME is used as the message format, while the MacAttachmentFormat is used to control the attachment format of messages in the Apple Mac operating system.  For full details of all parameter settings, see the Set-MailContact documentation on TechNet.








Summary

Remote domains are one of those essential configuration elements for Exchange 2013 that administrators may need to review and/or change from time to time.  Not all configuration options will necessarily be used but nevertheless, administrators should be fully aware of the available options for possible future use.

Monitoring NSX with vRealize Operations Manager

$
0
0
The existence of VMware vRealize® Operations Management Pack™ for NSX is a known fact. Until a couple of weeks ago, I hadn’t seen a demo of the integration between these two products, and my assumption was that there are “some stats” that can be analyzed in the vRealize Operations Management Pack GUI.







The demo that was given to me was more than impressive. vRealize Operations Management Pack definitely saves a lot of time when your VMware NSX® environment needs to be understood and analyzed to find misconfiguration or malfunctioning components.

After discussing powerful vRealize Operations Manager functionality with my NSX customers, I realized that I’m not alone and that a blog post would be an eye opener for many NSX administrators.

The vRealize Operations Management Pack can be found on VMware Solution Exchange; go to https://solutionexchange.vmware.com/store/products/management-pack-for-nsx-for-vsphere-3-0-x?src=vmw_so_vex_pmcas_1152 and hit the Try button. The install is done from the vRealize Operations Manager interface and is pretty straightforward.

PMcAllister Solutions Exchange

You can find two vRealize Operations Management Packs on Solution Exchange. VMware publishes NSX MP v2.x and v3.x simultaneously. This write is based on version 3.x. The recommendation is to use NSX MP 2.x only if NSX-V is at the level below 6.1.X version.

We’ll cover just a few screens to give you a taste of what can be done.

Let’s look at packet flow first. In the physical world, we can clearly understand when firewall and routing rules are applied as we follow wires that connect these devices. But how can we see this in an abstract virtual world? It can be easily done by going to vRealize Operations Manager, selecting NSX-vSphere Troubleshooting dashboard, specifying the source and destination of your packet, and clicking Run Traceflow.

PMcAllister NSX vSphere Environments

Here is output that is provided to us within the same dashboard.

PMcAllister NSX vSphereOutput

On the output screen above, it’s clear when the packet hits the firewall, firewall rules are applied to it, and then the packet is released (or dropped). It’s very easy to see when the packet enters and exits the logical firewall and when (for a short time) the packet is actually on physical wire before returning to the virtual network and being check against firewall rules associated with the target VM.

In the NSX environment, rules can be applied to the object. This flexibility allows micro-segmentation and is the reason why firewall rules applied on the packet leaving the source VM’s vNIC and other set is applied on the packet arriving at the destination VM.

Let’s look at two more screens. Everyone who has had to troubleshoot an NSX configuration knows that VMware NSX Manager™ has all necessary information for troubleshooting routing and switching decisions. Basically, it’s the MAC and VTEP tables that need to be inspected. The most forward way to display these tables is to run crafted commands through NSX Manager Universal Console, which is not difficult but does require some basic experience of running these commands. VMware vRealize Orchestrator™ is a wonderful tool that comes with VMware vCenter Server® at no additional cost and can help to automate these commands. But look at what can be done in vRealize Operations Manager with NSX MP 3.x by a simple selection of virtual wire.

PMcAllister vSphere Tables

It’s pretty much all you need in a very easy-to-read format. But wait. Some experienced network engineers might want to see just routing tables and check how dynamic routing works. And, again, it’s just a couple of simple clicks for all this info.

Dynamic Routing configuration displayed by vRealize Operations Manager with NSX MP 3.x

PMcAllister Dynamic Routing






And now we can examine the routing tables as shown below through the same NSX-vSphere Troubleshooting dashboard.

PMcAllister Routing Tables List

Such easy and simple access to NSX routing and state information can save me hours working with a customer with an average size NSX deployment. Hopefully, showing these examples will help other NSX customers and administrators save time on fixing configuration mistakes, so they can get to the exciting IT work: showing technology use cases that can help your business to grow.

How to Install Microsoft PowerShell on Linux or Mac OS X

$
0
0

PowerShell is now open source, and available for Linux and Mac. You can download official packages from Microsoft for the 64-bit versions of Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Red Hat Enterprise Linux 7, and Mac OS X 10.11.





 

Download the Packages from Microsoft

Visit the PowerShell project’s Releases page on GitHub to find the packages. Download the appropriate one for your operating system:
  • Ubuntu 16.04: Download the package ending in “16.04.1_amd64.deb”.
  • Ubuntu 14.04: Download the package ending in “14.04.1_amd64.deb”.
  • CentOS 7 and Red Hat Enterprise Linux 7: Download the package ending in “el7.centos.x86_64.rpm”.
  • Mac: Download the package ending in “.pkg”.

 

How to Install PowerShell on Linux

With the package downloaded, launch a terminal window on your Linux desktop. You’ll now need to install the package’s dependencies and the package itself.

On Ubuntu 16.04, run the following commands:
 
sudo apt-get install libunwind8 libicu55
sudo dpkg -i /path/to/powershell.deb

So, if you downloaded the package “powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb” to the Downloads folder in your home folder, you’d run the following commands:
 
sudo apt-get install libunwind8 libicu55
sudo dpkg -i ~/Downloads/powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb

Note that you can use tab completion to speed up this process. For example, if the file was in your Downloads folder, you’d type ~/Downloads/powershell and then press Tab. Bash will automatically complete the file name if it’s the only file that starts with “powershell” in that directory.



On Ubuntu 14.04, run the following commands:
sudo apt-get install libunwind8 libicu52
sudo dpkg -i /path/to/powershell.deb

On CentOS 7, run the following commands:
sudo yum install /path/to/powershell.rpm

If all goes well, PowerShell should now be installed on your system.

 

How to Install PowerShell on a Mac

To install PowerShell on a Mac, just double-click the downloaded .pkg file. It will launch a package installer and install PowerShell like any other application.

At the moment, the package doesn’t appear to be signed, so you’ll have to bypass Gatekeeper to install it.

To do so, right-click or Ctrl-click the file .pkg, select “Open”, and agree to run the installer.







 

How to Launch PowerShell on Linux or Mac

Open a terminal and run the “powershell” command to access a PowerShell shell environment. This works on both Linux and Mac–whichever you’re using.

You’ll see a PowerShell prompt beginning with “PS”, and you can run PowerShell cmdlets just as you would on Windows.



To leave the PowerShell prompt, just type “exit” and press Enter or close the terminal window.

For more detailed information, visit the PowerShell project’s GitHub page. You can download the source code, report issues, and view more official documentation there.

Python 2 vs Python 3: Practical Considerations

$
0
0
Python is an extremely readable and versatile programming language. With a name inspired by the British comedy group Monty Python, it was an important foundational goal of the Python development team to make the language fun to use. Easy to set up, and written in a relatively straightforward style with immediate feedback on errors, Python is a great choice for beginners.







As Python is a multiparadigm language — that is, it supports multiple programming styles including scripting and object-oriented — it is good for general purpose use. Increasingly used in industry by organizations such as United Space Alliance (NASA’s main shuttle support contractor), and Industrial Light & Magic (the VFX and animation studio of Lucasfilm), Python offers a lot of potential for those looking to pick up an additional programming language.

Developed in the late 1980s and first published in 1991, Python was authored by Guido van Rossum, who is still very active in the community. Conceived as a successor to the ABC programming language, Python’s first iteration already included exception handling, functions, and classes with inheritance. When an important Usenet newsgroup discussion forum called comp.lang.python was formed in 1994, Python’s user base grew, paving the way for Python to become one of the most popular programming languages for open source development.

 

General Overview

Before looking into potential opportunities related to — and the key programmatic differences between — Python 2 and Python 3, let’s take a look into the background of the more recent major releases of Python.

 

Python 2

Published in late 2000, Python 2 signalled a more transparent and inclusive language development process than earlier versions of Python with the implementation of PEP (Python Enhancement Proposal), a technical specification that either provides information to Python community members or describes a new feature of the language.

Additionally, Python 2 included many more programmatic features including a cycle-detecting garbage collector to automate memory management, increased Unicode support to standardize characters, and list comprehensions to create a list based on existing lists. As Python 2 continued to develop, more features were added, including unifying Python’s types and classes into one hierarchy in Python version 2.2.

 

Python 3

Python 3 is regarded as the future of Python and is the version of the language that is currently in development. A major overhaul, Python 3 was released in late 2008 to address and amend intrinsic design flaws of previous versions of the language. The focus of Python 3 development was to clean up the codebase and remove redundancy, making it clear that there was only one way to perform a given task.

Major modifications to Python 3.0 included changing the print statement into a built-in function, improve the way integers are divided, and providing more Unicode support.

At first, Python 3 was slowly adopted due to the language not being backwards compatible with Python 2, requiring people to make a decision as to which version of the language to use. Additionally, many package libraries were only available for Python 2, but as the development team behind Python 3 has reiterated that there is an end of life for Python 2 support, more libraries have been ported to Python 3. The increased adoption of Python 3 can be shown by the number of Python packages that now provide Python 3 support, which at the time of writing includes 339 of the 360 most popular Python packages.

 

Python 2.7

Following the 2008 release of Python 3.0, Python 2.7 was published on July 3, 2010 and planned as the last of the 2.x releases. The intention behind Python 2.7 was to make it easier for Python 2.x users to port features over to Python 3 by providing some measure of compatibility between the two. This compatibility support included enhanced modules for version 2.7 like unittest to support test automation, argparse for parsing command-line options, and more convenient classes in collections.

Because of Python 2.7’s unique position as a version in between the earlier iterations of Python 2 and Python 3.0, it has persisted as a very popular choice for programmers due to its compatibility with many robust libraries. When we talk about Python 2 today, we are typically referring to the Python 2.7 release as that is the most frequently used version.

Python 2.7, however, is considered to be a legacy language and its continued development, which today mostly consists of bug fixes, will cease completely in 2020.

 

Key Differences

While Python 2.7 and Python 3 share many similar capabilities, they should not be thought of as entirely interchangeable. Though you can write good code and useful programs in either version, it is worth understanding that there will be some considerable differences in code syntax and handling.

Below are a few examples, but you should keep in mind that you will likely encounter more syntactical differences as you continue to learn Python.

 

Print

In Python 2, print is treated as a statement instead of a function, which was a typical area of confusion as many other actions in Python require arguments inside of parentheses to execute. If you want your console to print out Sammy the Shark is my favorite sea creature in Python 2 you can do so with the following print statement:
 
print"Sammy the Shark is my favorite sea creature"

With Python 3, print() is now explicitly treated as a function, so to print out the same string above, you can do so simply and easily using the syntax of a function:
 
print("Sammy the Shark is my favorite sea creature")

This change made Python’s syntax more consistent and also made it easier to change between different print functions. Conveniently, the print() syntax is also backwards-compatible with Python 2.7, so your Python 3 print() functions can run in either version.

 

Division with Integers

In Python 2, any number that you type without decimals is treated as the programming type called integer. While at first glance this seems like an easy way to handle programming types, when you try to divide integers together sometimes you expect to get an answer with decimal places (called a float), as in:
 
5 / 2 = 2.5

However, in Python 2 integers were strongly typed and would not change to a float with decimal places even in cases when that would make intuitive sense.

When the two numbers on either side of the division / symbol are integers, Python 2 does floor division so that for the quotient x the number returned is the largest integer less than or equal to x. This means that when you write 5 / 2 to divide the two numbers, Python 2.7 returns the largest integer less than or equal to 2.5, in this case 2:
 
a = 5 / 2
print a



Output

2

To override this, you could add decimal places as in 5.0 / 2.0 to get the expected answer 2.5.

In Python 3, integer division became more intuitive, as in:
 
a = 5 / 2
print(a)



Output

2.5

You can still use 5.0 / 2.0 to return 2.5, but if you want to do floor division you should use the Python 3 syntax of //, like this:
 
b = 5 // 2
print(b)



Output

2

This modification in Python 3 made dividing by integers much more intuitive and is a feature that is not backwards compatible with Python 2.7.

 

Unicode Support

When programming languages handle the string type — that is, a sequence of characters — they can do so in a few different ways so that computers can convert numbers to letters and other symbols.

Python 2 uses the ASCII alphabet by default, so when you type "Hello, Sammy!" Python 2 will handle the string as ASCII. Limited to a couple of hundred characters at best in various extended forms, ASCII is not a very flexible method for encoding characters, especially non-English characters.

To use the more versatile and robust Unicode character encoding, which supports over 128,000 characters across contemporary and historic scripts and symbol sets, you would have to type u"Hello, Sammy!", with the u prefix standing for Unicode.

Python 3 uses Unicode by default, which saves programmers extra development time, and you can easily type and display many more characters directly into your program. Because Unicode supports greater linguistic character diversity as well as the display of emojis, using it as the default character encoding ensures that mobile devices around the world are readily supported in your development projects.

If you would like your Python 3 code to be backwards-compatible with Python 2, though, you can keep the u before your string.

 

Continued Development

The biggest difference between Python 3 and Python 2 is not a syntactical one, but the fact that Python 2.7 will lose continued support in 2020 and Python 3 will continue to be developed with more features and more bug fixes.

Recent developments have included formatted string literals, simpler customization of class creation, and a cleaner syntactical way to handle matrix multiplication.

Continued development of Python 3 means that developers can rely on having issues fixed in a timely manner, and programs can be more effective with increased functionality being built in over time.

 

Additional Points to Consider

As someone starting Python as a new programmer, or an experienced programmer new to the Python language, you will want to consider what you are hoping to achieve in learning the language.

If you are hoping just to learn without a set project in mind, you will likely most want to take into account that Python 3 will continue to be supported and developed, while Python 2.7 will not.

If, however, you are planning to join an existing project, you will likely most want to see what version of Python the team is using, how a different version may interact with the legacy codebase, if the packages the project uses are supported in a different version, and what the implementation details of the project are.

If you are beginning a project that you have in mind, it would be worthwhile to investigate what packages are available to use and with which version of Python they are compatible. As noted above, though earlier versions of Python 3 had less compatibility with libraries built for versions of Python 2, many have ported over to Python 3 or are committed to doing so in the next four years.

 

,br/>




Conclusion

Python is a versatile and well-documented programming language to learn, and whether you choose to work with Python 2 or Python 3, you will be able to work on exciting software projects.

Though there are several key differences, it is not too difficult to move from Python 3 to Python 2 with a few tweaks, and you will often find that Python 2.7 can easily run Python 3 code, especially when you are starting out.

It is important to keep in mind that as more developer and community attention focuses on Python 3, the language will become more refined and in-line with the evolving needs of programmers, and less support will be given to Python 2.7.

How To Configure a Galera Cluster with MariaDB 10.1 on Ubuntu 16.04 Servers

$
0
0
Clustering adds high availability to your database by distributing changes to different servers, potentially in different data centers. In the event that one of the instances fails, others are quickly available to continue serving.







Clusters come in two general configurations, active-passive and active-active. In active-passive clusters, all writes are done on a single active server and then copied to one or more passive servers that are poised to take over only in the event of an active server failure. Some active-passive clusters also allow SELECT operations on passive nodes. In an active-active cluster, every node is read-write and a change made to one is replicated to all.

In this guide, we will configure an active-active MariaDB Galera cluster. For demonstration purposes, we will configure and test three nodes, the smallest configurable cluster.

 

Prerequisites

To follow along, you will need:
  • Three Ubuntu 16.04 servers, each with a non-root user with sudo privileges and private networking, if it’s available to you.
Once all of these prerequisites are in place, we’re ready to install MariaDB.

 

Step 1 — Adding the MariaDB 10.1 Repositories to All Servers

MariaDB 10.1 isn't included in the default Ubuntu repositories, so we'll start by adding the external Ubuntu repository maintained by the MariaDB project to all three of our servers.

Note: MariaDB is a well-respected provider, but not all external repositories are reliable. Be sure to install only from trusted sources.

First, we'll add the MariaDB repository key with the apt-key command, which apt will use to verify that the package is authentic.
  • sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
Once we have the trusted key in the database, we can add the repository. We'll need to run apt-get update afterward in order to include package manifests from the new repository:
  • sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu xenial main'

  • sudo apt-get update


Note: You must run updateafter adding the repository. Otherwise, you'll install version 10.0 from the Ubuntu packages, which does not contain the Galera package.

Once the repositories are updated on all three servers, we're ready to install MariaDB. One thing to note about MariaDB is that it originated as a drop-in replacement for MySQL, so in many configuration files and startup scripts, you'll see mysql rather than mariadb. For consistency's sake, we use mysql in this guide where either could work.

 

Step 2 — Installing MariaDB on All Servers

Beginning with version 10.1, the MariaDB Server and MariaDB Galera Server packages are combined, so installing mariadb-serverwill automatically install Galera and several dependencies:

  • sudo apt-get install mariadb-server


During the installation, you will be asked to set a password for the MariaDB administrative user. No matter what you choose, this root password will be overwritten with the password from the first node once replication begins.

We should have all of the pieces necessary to begin configuring the cluster, but since we'll be relying on rsync in later steps, let's make sure it's installed.

  • sudo apt-get install rsync


This will confirm that the newest version of rsync is already available or prompt you to upgrade or install it.
Once we have installed MariaDB on each of the three servers, we can begin configuration.

 

Step 3 — Configuring the First Node

Each node in the cluster needs to have a nearly identical configuration. Because of this, we will do all of the configuration on our first machine, and then copy it to the other nodes.

By default, MariaDB is configured to check the /etc/mysql/conf.d directory to get additional configuration settings for from ending in .cnf. We will create a file in this directory with all of our cluster-specific directives:

  • sudo nano /etc/mysql/conf.d/galera.cnf


Copy and paste the following configuration into the file. You will need to change the settings highlighted in red. We’ll explain what each section means below.

/etc/mysql/conf.d/galera.cnf
[mysqld]
query_cache_size=0
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
query_cache_type=0
bind-address=0.0.0.0

# Galera Provider Configuration
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so

# Galera Cluster Configuration
wsrep_cluster_name="test_cluster"
wsrep_cluster_address="gcomm://first_ip,second_ip,third_ip"

# Galera Synchronization Configuration
wsrep_sst_method=rsync

# Galera Node Configuration
wsrep_node_address="this_node_ip"
wsrep_node_name="this_node_name"
  • The first section modifies or re-asserts MariaDB/MySQL settings that will allow the cluster to function correctly. For example, Galera Cluster won’t work with MyISAM or similar non-transactional storage engines, and mysqld must not be bound to the IP address for localhost. You can learn about the settings in more detail on the Galera Cluster system configuration page.
  • The "Galera Provider Configuration" section configures the MariaDB components that provide a WriteSet replication API. This means Galera in our case, since Galera is a wsrep (WriteSet Replication) provider. We specify the general parameters to configure the initial replication environment. This doesn't require any customization, but you can learn more about Galera configuration options.
  • The "Galera Cluster Configuration" section defines the cluster, identifying the cluster members by IP address or resolvable domain name and creating a name for the cluster to ensure that members join the correct group. You can change the wsrep_cluster_name to something more meaningful than test_cluster or leave it as-is, but you must update wsrep_cluster_address with the addresses of your three servers. If your servers have private IP addresses, use them here.
  • The "Galera Synchronization Configuration" section defines how the cluster will communicate and synchronize data between members. This is used only for the state transfer that happens when a node comes online. For our initial setup, we are using rsync, because it's commonly available and does what we need for now.
  • The "Galera Node Configuration" section clarifies the IP address and the name of the current server. This is helpful when trying to diagnose problems in logs and for referencing each server in multiple ways. The wsrep_node_address must match the address of the machine you're on, but you can choose any name you want in order to help you identify the node in log files.
When you are satisfied with your cluster configuration file, copy the contents into your clipboard, save and close the file.

 

Step 4 — Configuring the Remaining Nodes

On each of the remaining nodes, open the configuration file:

  • sudo nano /etc/mysql/conf.d/galera.cnf


Paste in the configuration you copied from the first node, then update the "Galera Node Configuration" to use the IP address or resolvable domain name for the specific node you're setting up. Finally, update its name, which you can set to whatever helps you identify the node in your log files:
/etc/mysql/conf.d/galera.cnf
. . .
# Galera Node Configuration
wsrep_node_address="this_node_ip"
wsrep_node_name="this_node_name"
. . .
Save and exit the file on each server. We're almost ready to bring up the cluster, but before we do, we'll want to make sure that the appropriate ports are open.

 

Step 5 — Opening the Firewall on Every Server

On every server, let's check the status of the firewall:

  • sudo ufw status


In our case, we see the following:

Output

Status: active

To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)

You may have other rules in place or no firewall rules at all. In this example, only ssh traffic is permitted. If we tried to start the cluster, we would fail because of firewall rules.

Galera can make use of four ports:
  • 3306 For MySQL client connections and State Snapshot Transfer that use the mysqldump method.
  • 4567 For Galera Cluster replication traffic, multicast replication uses both UDP transport and TCP on this port.
  • 4568 For Incremental State Transfer.
  • 4444 For all other State Snapshot Transfer.
In our example, we’ll open all four ports while we do our setup. Once we've confirmed that replication is working, we'd want to close any ports we're not actually using and restrict traffic to just servers in the cluster.

Open the ports with the following command:

  • sudo ufw allow 3306,4567,4568,4444/tcp

  • sudo ufw allow 4567/udp


Note: Depending on what else is running on your servers you might want restrict access right away.

 

Step 6 — Starting the Cluster

To begin, we need to stop the running MariaDB service so that our cluster can be brought online.

 

Stop MariaDB on all Three Servers:

Use the command below on all three servers to stop mysql so that we can bring them back up in a cluster:

  • sudo systemctl stop mysql


systemctl doesn't display the outcome of all service management commands, so to be sure we succeeded, we'll use the following command:

  • sudo systemctl status mysql


If the last line looks something like the following, the command was successful.

Output

. . .
Aug 19 02:55:15 galera-01 systemd[1]: Stopped MariaDB database server.

Once we've shut down mysql on all of the servers, we're ready to proceed.

 

Bring up the First Node:

To bring up the first node, we'll need to use a special startup script. The way we've configured our cluster, each node that comes online tries to connect to at least one other node specified in its galera.cnf file to get its initial state.

Without using the galera_new_cluster script that allows systemd to pass the the --wsrep-new-cluster parameter, a normal systemctl start mysql would fail because there are no nodes running for the first node to connect with.

  • sudo galera_new_cluster


When this script succeeds, the node is registered as part of the cluster, and we can see it with the following command:

  • mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"



Output

+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 1 |
+--------------------+-------+

On the remaining nodes, we can start mysql normally. They will search for any member of the cluster list that is online, so when they find one, they will join the cluster.

 

Bring up the Second Node:

Start mysql:

  • sudo systemctl start mysql


We should see our cluster size increase as each node comes online:

  • mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"



Output

+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 2 |
+--------------------+-------+

 

Bring up the Third Node:

Start mysql:

  • sudo systemctl start mysql


If everything is working well, the cluster size should be set to three:

  • mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"



Output

+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 3 |
+--------------------+-------+

At this point, the entire cluster should be online and communicating. Before we test replication, however, there's one more configuration detail to attend to.

 

Step 7 — Configuring the Debian Maintenance User

Currently, Ubuntu and Debian's MariaDB servers do routine maintenance such as log rotation as a special maintenance user. When we installed MariaDB, the credentials for that user were randomly generated, stored in /etc/mysql/debian.cnf, and inserted into the MariaDB's mysql database.

As soon as we brought up our cluster, the password from the first node was replicated to the other nodes, so the value in debian.cnf no longer matches the password in the database. This means anything that uses the maintenance account will try to connect to the database with the password in the configuration file and will fail on all but the first node.

To correct this, we'll copy our first node's debian.cnf to the remaining nodes.

 

Copy from the First Node:

Open the debian.cnf file with your text editor:

  • sudo nano /etc/mysql/debian.cnf


The file should look something like:
[client]
host = localhost
user = debian-sys-maint
password = 03P8rdlknkXr1upf
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = 03P8rdlknkXr1upf
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
Copy the information into your clipboard.

 

Update the Second Node:

On your second node, open the same file:

  • sudo nano /etc/mysql/debian.cnf


Despite the warning at the top of the file that says “DO NOT TOUCH!” we need to make the change for the cluster to work. You can confidently delete the current information and paste the contents from the first node's configuration. They should be exactly the same now. Save and close the file.

 

Update the Third Node:

On your third node, open the same file:

  • sudo nano /etc/mysql/debian.cnf


Delete the current information and paste the contents from the first node's configuration. Save and close the file.

The mismatch wouldn't have affected our ability to test replication, but it's best to take care of early on to avoid failures later.

Note: After you're done, you can test that the maintenance account is able to connect by supplying the password from the local debian.conf as follows:


  • sudo cat /etc/mysql/debian.cnf


Copy the password from the output. Then connect to mysql:

  • mysql -u debian-sys-maint -p


At the prompt, supply the password that you copied. If you can connect, all is well.

If not, verify the password in the file is the same as the first node, then substitute below:

  • Update mysql.user set password=PASSWORD('password_from_debian.cnf') where User='debian-sys-maint';


Repeat to test remaining nodes.

 

Step 8 — Testing Replication

We've gone through the steps up to this point so that our cluster can perform replication from any node to any other node, known as active-active or master-master replication. Let's test to see if the replication is working as expected.

 

Write to the First Node:

We'll start by making database changes on our first node. The following commands will create a database called playground and a table inside of this called equipment.

  • mysql -u root -p -e 'CREATE DATABASE playground;
  • CREATE TABLE playground.equipment ( id INT NOT NULL AUTO_INCREMENT, type VARCHAR(50), quant INT, color VARCHAR(25), PRIMARY KEY(id)); 
  • INSERT INTO playground.equipment (type, quant, color) VALUES ("slide", 2, "blue");'



We now have one value in our table.

 

Read and Write on the Second Node:

Next, we'll look at the second node to verify that replication is working:

  • mysql -u root -p -e 'SELECT * FROM playground.equipment;'


If replication is working, the data we entered on the first node will be visible here on the second:



Output

+----+-------+-------+-------+
| id | type | quant | color |
+----+-------+-------+-------+
| 1 | slide | 2 | blue |
+----+-------+-------+-------+

From this same node, we can write data to the cluster:
  • mysql -u root -p -e 'INSERT INTO playground.equipment (type, quant, color) VALUES ("swing", 10, "yellow");'

 

Read and Write on the Third Node:

From the third node, we can read all of this data by querying the again:

  • mysql -u root -p -e 'SELECT * FROM playground.equipment;'



Output

+----+-------+-------+--------+
| id | type | quant | color |
+----+-------+-------+--------+
| 1 | slide | 2 | blue |
| 2 | swing | 10 | yellow |
+----+-------+-------+--------+

Again, we can add another value from this node:
  • mysql -u root -p -e 'INSERT INTO playground.equipment (type, quant, color) VALUES ("seesaw", 3, "green");'

 

Read on the First Node:

Back on the first node, we can verify that our data is available everywhere:

  • mysql -u root -p -e 'SELECT * FROM playground.equipment;'



Output

+----+--------+-------+--------+
| id | type | quant | color |
+----+--------+-------+--------+
| 1 | slide | 2 | blue |
| 2 | swing | 10 | yellow |
| 3 | seesaw | 3 | green |
+----+--------+-------+--------+

We've tested we can write to all of the nodes and that replication is being performed properly.

 







Conclusion

At this point, you should have a working three-node Galera test cluster configured. If you plan on using a Galera cluster in a production situation, it’s recommended that you begin with no fewer than five nodes.

Before production use, you may want to take a look at some of the other state snapshot transfer (sst) agents like “xtrabackup" which allows you to set up new nodes very quickly and without large interruptions to your active nodes. This does not affect the actual replication, but is a concern when nodes are being initialized.

Finally, if your cluster members are not on a private network, you will also need to set up SSL to protect your data as it moves between servers.

How to Add New Cortana Search File Locations on Windows 10

$
0
0

If some files are not showing up on search results, it's probably because Cortana doesn't know where to look. Here's how to add alternative search locations on Windows 10. In this Windows 10 guide, we'll walk you through the steps to enable Cortana to search all your drives connected to your computer, and how to remove those locations you want to prevent from indexing.






Cortana is your personal digital assistant in Windows 10. It's a feature designed to help you accomplish many tasks, including reminding you of important appointments, track packages and flights, and sync notifications between devices.

In addition, Cortana shares a deep integration with Windows Search and search on the web using Bing. If there is anything you need (e.g., image, document, or another type of file), you simply enter the query in the search box in the taskbar, and Cortana will return the best results based on local and online searches.

However, if you store files on an external hard drive or in different folders other than the defaults (Downloads, Documents, Music, Pictures, etc.), you'll notice that the digital assistant will never bring up those files in the results.

The reason is that Cortana relies on Windows Search for local files, and Windows Search uses a set of default configurations that specify which folders are indexed for search. And these default settings don't include additional storage locations you may have added to your computer or alternative folder paths.

 

How to add new storage locations for indexing on Windows 10

Use the following steps to modify the default local search configurations, which Cortana can use respond accordingly to your search queries.
  • Use the Windows key + X to open the Power User menu and select Control Panel.
  • Change the view to Large Icons.


  • Click on Indexing Options.


  • Click Modify.

  • Click Show all locations .
  • On Indexed Locations, select the folders and drives you want to give Cortana permission to search.


  • Quick Tip: If you have sensitive files (or videos), in this step, you can also exclude the locations you don't want Cortana to use to show search results.
  • Getting Granular: If you want to index a folder, but you don't want a subfolder to be indexed, expand the folder and remove the checkmark for those files and folders inside it you don't want Cortana to consider during a search.
  • Click the OK button to complete the task.
Once you completed the task, Windows 10 will automatically begin indexing the new files, but it may take some time. If you don't want to wait, or it's been too long and search isn't working correctly, while in the Indexing Options settings page do the following.
  • Click Advanced.
  • Click Rebuild.

  • Click OK to confirm.
If you have encrypted files stored on your computer, you always want to check the Index encrypted files option under Advanced Options.

You can even go to the File Types tab and configure which files extensions you want to see in search results.


Once you completed your new customization, click the OK button to commit the changes.





 

Wrapping things up

As you can see, Cortana may know many nifty tricks, but when it comes to search certain options have to be customized manually before getting the best results. If you have been wondering why certain files didn't show in search -- well, this is why.

How to Use Your Free Windows 10 License After Changing Your PC’s Hardware

$
0
0


The free Windows 10 license you receive is tied to your PC’s hardware. You’re still allowed to use Windows 10 on that same PC even after changing its hardware. Activating that license is easier than ever in Windows 10’s Anniversary Update.







 

How to Associate Your Windows 10 License with a Microsoft Account

In Windows 10’s Anniversary Update, it’s now possible to associate your free Windows 10 license with your Microsoft account so you can more easily reactivate your PC after hardware changes in the future. This happens automatically when you sign into your PC with a Microsoft account.

If you haven’t yet signed in with a Microsoft account, head to Settings > System & Security > Activation and you’ll be prompted to add a Microsoft account to make reactivation easier.


Once you’ve added a Microsoft account, you’ll see the “Windows 10 is activated with a digital license linked to your Microsoft account” message here.



How to Activate Your Windows 10 License After a Hardware Change

When reinstalling Windows 10 after a hardware change–especially a motherboard change–be sure to skip the “enter your product key” prompts while installing it.

Microsoft has never actually wanted to explain exactly how the hardware-based Windows activation process works. Just replacing your hard drive or upgrading your graphics card shouldn’t cause a problem. If you’ve just changed a few peripherals, Windows 10 may just automatically activate itself after you clean-install it. But, if you’ve changed the motherboard or just a lot of other components, Windows 10 may see your computer as a new PC and may not automatically activate itself.

Head to Settings > Update & Security > Activation and you’ll see a “Troubleshoot” option if activation failed. Click that option and sign in with the Microsoft account you associated your license with. You’ll be able to tell Windows that you “changed hardware on this device recently” and select your PC from a list of devices associated with your Microsoft account. Microsoft’s documentation now explains exactly how this works.

 

Why You Can’t Just Use a Simple Product Key


The free Windows 10 license works very differently from previous Windows licensing systems. These all required a product key. Even modern Windows 8 and 8.1 PCs–and new PCs that come with Windows 10–have a Windows product key embedded in their UEFI firmware. If you buy a new copy of Windows 10–for example, to install it on a PC you’re building yourself–you’ll also have a product key.

In this case, the product key would always serve to activate Windows. But Microsoft hasn’t been handing out Windows 10 product keys to upgraders. There’s no way to find your Windows 10 product key if you’ve upgraded for free–you just don’t have one.



The free Windows 10 license Microsoft is providing to upgraders works differently. Microsoft won’t issue you a Windows 10 product key. Instead, when you perform an upgrade from within Windows 7 Service Pack 1 or Windows 8.1, the upgrade process registers a unique ID associated with your PC’s hardware on Microsoft’s Windows activation servers.

In the future, whenever you install Windows 10 on that same PC, it will automatically report to Microsoft’s activation servers. Microsoft will confirm that the PC with that specific hardware configuration is allowed to use Windows 10, and it’ll automatically be activated.

This isn’t actually made clear in the installation process itself. To clean-install Windows 10 on a machine activated in this way, you have to continually skip all the product key prompts while installing it.
This automatic process only works if your PC has the same hardware it had when you upgraded to Windows 10.

 

You Can’t Move a Free Windows 10 License to Another PC

Bear in mind that this will only work on the same PC. This does create some an inconvenient situation for people who bought a full retail license–not an OEM license–of Windows 7, 8, or 8.1. Most people don’t do this, though–even people building their own PCs usually seem to buy OEM copies of Windows.

Those retail licenses are portable between different PCs, so you can take them with you from PC to PC. You might have purchased a Windows 7 license and built your own PC. Build a new PC a few years later and you can take that Windows 7 license with you as long as you remove it from the first machine. Rinse and repeat over and over–as long as you’d like to continue using Windows 7.

However, that free Windows 10 license you get as part of the upgrade process is tied to an individual PC. Even if you upgraded from a retail copy of Windows 7, 8, or 8.1, you won’t be given a retail copy of Windows 10. You just can’t move that free Windows 10 license to another PC. Now that the free Windows 10 upgrade offer is over, you’ll have to buy a new copy of Windows 10 if you want to move it to an entirely different PC.

This may feel a bit inconvenient. But, on the other hand, that Windows 10 license was just a free bonus in the first place. Retail licenses of Windows 10 you purchase can be moved between PCs in the same way.






In the past, Microsoft told people to contact its support staff. Gabriel Aul, Vice President of Engineering for the Windows & Devices group at Microsoft, tweeted that you could contact support from within Windows 10, explain the situation, and they’ll activate Windows 10 for you. This is no longer the officially encouraged way to reactivate Windows 10 after a hardware change now that the automatic troubleshooter is here.

The Best New Features in Latest Android 7.0 Nougat

$
0
0
latest-pokemon-go-update-brings-android-7-0-nougat-support-506277-2

Android 7.0 Nougat is finally here, and Nexus users will start getting the updates very soon. Here are the coolest features in the latest version of Android.

Right now, the update should be rolling out to the Nexus 6, Nexus 5X, Nexus 6P, and Nexus 9, as well as the Nexus Player, Pixel C and General Mobile 4G. We’ve been using the preview since it first came out, and we’ll be discussing how to use some of its best features in greater detail soon, but for now, here’s a taste of the best things in Android 7.0.






 

Split-Screen Mode



Undoubtedly the biggest new feature is split-screen multitasking, which allows you to use two apps at once side-by-side. This exists on many devices already (Samsung phones come to mind), but it’s finally coming to all Android phones with Nougat. Just enter the recent apps view, tap and hold an app, and drag it to the top or bottom of the screen (or left and right sides, depending on the orientation of your device). It seems that developers will have to add this ability to their apps, though, the final version of N may not allow it in all apps.

Nougat also contains a “picture-in-picture” mode, so you can watch video in a small window while using your phone. Google’s documentation notes that this is for Android TV, however, and does not mention phones and tablets. (Bring this feature to the YouTube app on phones, Google!)

 

More Powerful Notifications

N-notifications

The notification shade looks a bit different in Nougat, but it comes with a few new features, too. Developers can now include “direct reply” feature in their apps, so you can reply to a message without opening the app itself–much like Google’s own apps can already do.

More interesting, though, are “bundled notifications”. This allows Android to group notifications from the same app together, then be expanded into individual notifications so you can see more details on the ones that interest you. We can see this being particularly useful for chat and messaging apps, which can get a lot of notifications at once before you get a chance to read them and see which are important. Plus, it’ll make that direct reply feature even nicer, since you can split notifications up and reply to them one-by-one from the notification shade.

 

A Better Doze for Longer Battery Life

N-doze

Doze was arguably one of Marshmallow’s most interesting features, putting your phone into a deeper sleep to conserve battery life after a period of inactivity. The only problem: your phone would only doze when you let it sit, unmoving and untouched, for a specified period of time. But most of us walk around with our phones in our pockets, not sitting on a table all day, which means it won’t doze very often. There were ways to improve this feature, but they didn’t do what we all really wanted.

Nougat does: It’ll go into a “lighter” doze mode whenever the screen is off, then go into the normal “deep” doze when the phone has been stationary for awhile. Knowing how well Doze works on Marshmallow, we’re very excited to try out Nougat’s doze in real-world situations.

 

An Easier, More Customizable Quick Settings Menu

N-quicksettings

Android’s Quick Settings dropdown is incredibly convenient, letting you toggle Wi-Fi, turn on Do Not Disturb, or use your phone as a flashlight with one tap. Unfortunately, the menu itself is two drags away on most phones.

In Nougat, one drag opens the notification drawer, as usual–but your first five Quick Settings are available along the top, without having to drag down a second time. That’s mighty convenient. You can drag a second time to show the full drawer, as usual. But, in Nougat, you can edit which Quick Settings show up in the drawer–removing ones you don’t want, or rearranging them to suit your tastes.

This was possible in Marshmallow using a secret menu, but it seems this may be the default in Nougat.

 

New Secret Features in the System UI Tuner

Screenshot_20160803-140200 Screenshot_20160803-140221

Customizable Quick Settings graduated from a secret menu called the “System UI Tuner”, and that secret menu has a few new options in Nougat. This includes a more customizable Do Not Disturb, the option to remove icons from the status bar, and color calibration for your screen–plus a swipe up gesture that makes it even easier to enter Nougat’s new split-screen mode.

 

Data Saver, Call Blocking, and More

N-settingsUI

These are some of the banner features right now, as well as a few things we found after playing with the preview for ourselves. There’s a lot more in there, though–like a Data Saver mode similar to Android’s existing Battery Saver mode, designed to save you data if you get too close to your data cap.

There’s also a new number blocking feature that spans across multiple apps–so if you block a number in the Dialer, it also blocks that number in Hangouts. Google’s documentation also mentions call screening, faster boot times, and a number of other under-the-hood improvements.






And, as always, the latest version of Android contains a lot of small UI tweaks across the operating system, from the new notification appearance to more emoji to a more detailed Settings screen, with useful information added throughout the main menu (shown above).

We’ll be writing guides on all of these features and more now that Nougat’s officially here, so stay tuned. For now, consider this a tease of what’s to come. If you have a Nexus device, it should update soon, though keep an eye on the official images page if you want to update it manually yourself.

How to prevent Windows 10 Insider builds from accidentally installing on your PC

$
0
0

When your PC is ready to install a Windows 10 Insider Preview that you don't want, use this trick to cancel the installation. In this Windows 10 guide, we'll walk you through the steps to cancel an installation of a new Windows 10 Insider preview build after it downloaded to your computer.







If you've been testing pre-releases of Windows 10, you're probably familiar with the Windows Insider Preview program. The program let you get early access to releases of the operating system to test new features and changes that will be part of a new major update.

The caveat using early versions of Windows 10 are potential bugs and problems running unstable code, as builds available through the Insider program are heavily under development.

Although many times Microsoft releases great Windows 10 previews with a lot of changes and features, other times (usually at the beginning of a new development) builds may include a lot of bugs and things not working correctly, which could make you think twice before installing them.

Of course, you can always change your Windows Insider Preview preferences to stop getting new flights. However, if you forget to change your settings, new versions of Windows 10, regardless of how stable they might be, will download automatically to your PC without an option to cancel the installation.

How to prevent Insider builds from installing on your Windows 10 PC

If there is a new version of Windows 10 Insider preview available through the Fast ring, which it's known to be significantly buggy, and it's ready to install on your computer, you can use these instructions to stop the installation.

Important: Do not restart your computer while going through this process.

 

1. Change your Active Hours settings

To prevent the operating system from automatically restarting while you're making these changes, you want to change the Active Hours settings to postpone the restart as much as you can.
  1. Open Settings.
  2. Click on Update & security.
  3. Click on Windows Update.
  4. Click the Change active hours link.

  5. Set the Start time and End time to postpone the restart the maximum period of time (12 hours).
  6. Click Save.


 

2. Change your Windows Insider Preference

In the following steps, you'll change your Windows Insider Preview settings to opt out of the current branch and stop getting further builds.
  1. Open Settings.
  2. Click on Update & security.
  3. Click on Windows Insider Program.
  4. Lower your ring level to Slow or Release Preview (if available).


Quick Tip: If you change your settings while the build is downloading, it will also stop the download.

 

3. Remove the installation files from your computer

Although you changed your settings to stop getting new flights, you will notice that Windows Update will still show the preview as an update ready to install during the next restart.
Now what you need to do is to use the Disk Cleanup tool to delete the installation files correctly and quickly remove the update from list on Windows Update.
  1. Use the Windows key + R keyboard shortcut to open the Run command.
  2. Type cleanmgr and click OK to launch the Disk Cleanup tool.
  3. Make sure you're selecting the drive C: and click OK.
  4. Click the Clean up system files button.

  5. Make sure you're selecting the drive C: and click OK.
  6. Select the Temporary Windows installation files option.
  7. Make sure to remove the checkmark for anything you don't want to delete.
  8. Click OK.

  9. Click Delete files.







Once you go through these instructions, wait several minutes, and go back to Windows Update, and you'll notice that as Windows 10 checks for new updates, the installation files for the new build downloaded to your computer will magically disappear from the list.

If there are available new cumulative updates, you can now go ahead and restart your computer to install them.

After preventing a new build from installing to your PC, if you're not planning to test new versions of Windows 10, make sure to unenroll your device from the program.

How to get Android 7.0 Nougat on your Nexus Phone right now?

$
0
0
Android 7.0 Nougat is officially available for the Nexus 6, Nexus 5X, Nexus 6P, Nexus 9, Nexus Player and Pixel C (and the General Mobile 4G Android One), but your phone may not get the OTA (over-the-air) update for another couple of weeks. If you don't have a Nexus, you can get a feel for when (or if) your phone will get Nougat based on our expectations.







If you know your way around a command line, you can skip the waiting game by downloading the factory image for your particular device and flashing it on top of your software. But there are some caveats you need to know about when flashing a factory image, so read on to find out what you need to know.

 

How to get Nougat through the Android Beta program



Another way to get Android 7.0 Nougat right now is by opting into the Android Beta program, which has been extended beyond the initial release of Nougat.

Any Nexus device eligible for the receiving Nougat can also opt into the Beta program — Nexus 6P, Nexus 5X, Nexus 6, Nexus 9, Nexus Player, Pixel C — any continue receiving updates past the stable version.

That is because Google has announced that it will continue offering preview versions of Nougat as it prepares the first of its Maintenance Releases, which is expected later this fall.

Devices that are currently enrolled in the Beta program are the first to receive the stable version of Android 7.0, and the opt-in process is fairly easy.
  1. Head to Android Beta programme portal on your Nexus phone or Pixel C tablet.
  2. Sign into the Google account associated with that phone.
  3. Scroll down to Your eligible devices.
  4. Find the device you want to enrol in the Beta programme and tap Enrol device.
  5. Follow the prompts to accept the over-the-air download.

 

How to get Nougat by flashing a factory image

 

Get the right tools to flash a factory image

Note: This portion is performed on your computer.

The first thing you need to know about flashing a factory image on top of your Nexus phone is that you need to have a portion of Android SDK installed on your computer. Specifically, you need adb and fastboot, which you can download from the Android Studio portal.
  1. Go to Android Studio webpage
  2. Scroll to the bottom of the page.
  3. Find command line tools for your platform — Windows, Mac, or Linux.
  4. Extract the accompanying file (.exe, .zip, .tgz)
The next thing you need to do after downloading the command line tools is to make sure that your phone is ready for flashing. This is a two-step process: you need to enable USB Debugging; and you need to unlock your bootloader. If you have already unlocked your bootloader, you can skip to flashing.

 

Enable developer settings and USB debugging

Note: This portion is performed on your device.
  1. Go to your Nexus'Settings.
  2. Scroll down to About Phone/Tablet.
  3. Tap on the Build number seven times until the dialog box says you are now a developer.
  4. Open Settings and you should find a new option called Developer options.
  5. Click into the Developer options.
  6. Make sure that the developer options are turned on and that USB debugging is checked on.
  7. Check Enable OEM unlock.
  8. Plug your Nexus device into your computer.
  9. Tap OK on the dialog box asking you to Allow USB debugging while connected to the computer.
If done correctly, this will be everything you will need to do on your phone or tablet for the moment. After this, you need to unlock your phone's bootloader.

 

Unlocking your bootloader

Note: This portion is performed on your device and computer .

Unlocking your bootloader is relatively simple, but you must know one thing: Your phone will factory reset, and you will lose all of your apps and personal data stored on the phone. Make sure that you back up your device before this process.
  1. Turn off your phone or tablet.
  2. Hold down the power button and the volume down button.
  3. On your computer, open Command Prompt (Windows) or Terminal (Mac). Navigate to folder with Platform tools.
  4. On your computer, type: ./fastboot flashing unlock in a terminal or command prompt.
  5. Press volume up button and the power button on your device to confirm bootloader unlock.
  6. On your computer, type: ./fastboot reboot
Now your bootloader is unlocked and ready to flash the Android 7.0 factory image for your device.



Flashing the Android 7.0 factory image

Note: The Android 7.0 factory images are not yet available, but these steps will apply when they go live. This portion is performed on your computer.
  1. Visit Nexus Factory Images page.
  2. Scroll down to your phone and find the Android 7.0 image for your phone.
  3. Once downloaded, extract the file in your Platform tools folder.
  4. Put your phone into bootloader mode (see above) and plug it into your computer.
  5. Open Command Prompt (Windows) or Terminal (Mac). Navigate to folder with Platform tools.
  6. On the command line, type:./adb devices to ensure your phone is seen by your computer.
  7. Type the flash-all command.
    On Windows, that will be flash-all.bat
    On Mac, that will be flash-all.sh

 







Learning about Nougat

Once you flash the Android 7.0 Nougat factory image onto your Nexus phone, you should reboot into the operating system. Depending on whether you unlocked your bootloader (and wiped your phone in the process), or kept your data intact by flashing the images manually, Nougat should look considerably different to Marshmallow. Now you have to learn what's new in Nougat.

How to Fix Wi-Fi Problems on Galaxy S7?

$
0
0
The Samsung Galaxy S7 might be one of the best phones of the year, but it sometimes it suffers from Wi-Fi problems that mess with your experience. If your Galaxy S7 is suffering from some Wi-Fi woes, here are a few things you can try to get reconnected.







 

Have you tried turning it off and on again?

Yup, it sounds like I'm joking, but I'm not. Try turning off Wi-Fi, then turn off the phone. Turn your phone back on and then turn on Wi-Fi again.

Sometimes it just needs a quick kick in the but to get going again and turning it off and on might be the hoof it needs.

 

Reset your router

Sometimes your router may get a bit sluggish and it just needs a refresh. Unplug it or power it down for at least 30 seconds, then fire it back up again.

 

Forget and re-learn

Sometimes your Wi-Fi problem could be to do with how your Galaxy S7 connects to your network. Try forgetting the network, then reconnect to it.
Here's how:
  1. Launch Settings from your home screen, the Notification Shade, or the app drawer.
  2. Tap Wi-Fi.
  3. Tap the network you're connected to.
  4. Tap Forget.
    tap Wi-Fi, tap the network, tap Forget
  5. Tap the network again to reconnect to it.
  6. Enter the password if there is one.
  7. Tap Connect.
    Tap the network again, enter the password, tap Connect

 

Is your software up to date?

Sometimes, if you haven't updated to the latest software version on both your Galaxy S7 and your router, you may have problems connecting.
Here's how to make sure you're up-to-date on your Galaxy S7:
  1. Launch Settings from your home screen, the Notification Shade, or the app drawer.
  2. Tap About device.
  3. Tap Download updates manually. Your phone will then check for and download any updates.
  4. Tap Later, Install overnight, or Install now to choose when you want the update installed.
    Launch Settings, tap About device, tap Download updates manually, tap an option

 

Try another network

It could just be that the network you're trying to connect to has rather poor coverage. Try connecting to a different Wi-Fi network and see if that makes a difference.

The best way to test this would be to try a network outside your home, just in case your router is the real problem.

 

Get closer

This is another obvious one, but here it is: get closer to the physical router. If you are experiencing connectivity issues, try moving closer to the router itself. This is especially true if you are connected on the 5Ghz frequency, since it travels shorter distances than the more ubiquitous (and more prone to interference) 2.4Ghz frequency.

 

Check your router settings

Sometimes it's just a matter of switching to the other band on your dual band router. Try switching to 2.4GHz in your router's software settings. It has a wider range and may connect better to your Galaxy S7.

 

Make sure Wi-Fi is always on

In the Wi-Fi settings on your Galaxy S7, you have three options that control when Wi-Fi is on. If your connection is spotty, you'll want to make sure that Wi-Fi is always connected, even when your phone is asleep (i.e. the screen is off). Here's how!
  1. Launch Settings from your home screen, the Notification Shade, or the app drawer.
  2. Tap Wi-Fi.
  3. Tap More in the top right corner of your screen.
    Launch Settings, tap Wi-Fi, tap More
  4. Tap Advanced.
  5. Tap Keep Wi-Fi on during sleep.
  6. Tap Always.
    tap Advanced, tap Keep Wi-Fi on during sleep, tap Always

This will stop your Galaxy S7 from disconnecting from your Wi-Fi network every time the screen turns off.

 

Turn off Power Saving Mode

Power Saving Mode slows your Galaxy S7's performance in order to conserve battery, which may be hindering your Wi-Fi connectivity.

Turn it off in the Notification Shade. If you have it on for a reason, then charge your phone and worry about Wi-Fi later!

 

Change the encryption settings on your router

We're getting into more technical territory now and this should be one of the last things you try. Remove the encryption from your router (refer to your router's instruction manual, since every brand will be different).

This will create an "open" network, which means you won't need a password to connect. If this clears up your Wi-Fi issues, there may be a problem with your router's software. While we always recommend maintaining strong encryption between your phone and your router, look into enabling a different protocol when you re-enable encryption. If you were using AES, try changing it to TKIP (though we strongly encourage you to stick with WPA2-PSK (AES) once the problems have been resolved).

 

Get a new router!

If you're having no luck at all and you know your Galaxy S7 isn't the problem, then you likely need to upgrade your router.

 







If all else fails

If you have a new router and you know your Galaxy S7 isn't the problem and everything's tested properly with your internet service provider, then maybe your home just isn't Wi-Fi friendly. It's OK, many aren't.
As a last-ditch effort, you might want to try a Wi-Fi range extender/repeater. These usually just plug into a power outlet somewhere in your home in a Barrel of Monkeys fashion in that they pick up the Wi-Fi signal and then broadcast it, adding more range to your signal.

If you find that Wi-Fi works great near the router but sucks elsewhere in your home, strategically place an extender and your problems may be solved. Some extenders even help you pinpoint dead spots.
There are many to choose from, so check out Window Central's roundup to make sure you get what you need.

Veeam Backup & Replication 9.0 User Guide for Microsoft Hyper-V

$
0
0
Veeam Backup & Replication provides a set of features for building and maintaining a flexible backup infrastructure, performing data protection tasks (such as VM backup, replication, copying backup files), and carrying out disaster recovery procedures. This article contains a high-level step by step guide of Veeam Backup & Replication, its architecture, features, data protection and disaster recovery concepts necessary to understand Veeam Backup & Replication background operations and processes.







 

Solution Architecture

Veeam Backup & Replication is a modular solution that lets you build a scalable backup infrastructure for environments of different sizes and configuration. The installation package of Veeam Backup & Replication includes a set of components that you can use to configure the backup infrastructure. Some components are mandatory and provide core functionality; some components are optional and can be installed to provide additional functionality for your business and deployment needs. 

You can co-install Veeam Backup & Replication components on the same machine, physical or virtual, or you can set them up separately for a more scalable approach.

 

Components

The Veeam backup infrastructure comprises a set of components. Some components can be deployed with the help of the setup file. Other components can be deployed via the Veeam Backup & Replication console.

 

Backup Server

The backup server is a Windows-based physical or virtual machine on which Veeam Backup & Replication is installed. It is the core component in the backup infrastructure that fills the role of the “configuration and control center”. The backup server performs all types of administrative activities:
  • Coordinates backup, replication, recovery verification and restore tasks
  • Controls job scheduling and resource allocation
  • Is used to set up and manage backup infrastructure components as well as specify global settings for the backup infrastructure
    In addition to its primary functions, a newly deployed backup server also performs the role of the default backup repository, storing backups locally.

    The backup server uses the following services and components:
    • Veeam Backup Service is a Windows service that coordinates all operations performed by Veeam Backup & Replication such as backup, replication, recovery verification and restore tasks. The Veeam Backup Service runs under the Local System account or account that has the Local Administrator permissions on the backup server.
    • Veeam Backup & Replication Console provides the application user interface and allows user access to the application's functionality.
    • Veeam Guest Catalog Service is a Windows service that manages guest OS file system indexing for VMs and replicates system index data files to enable search through guest OS files. Index data is stored in the Veeam Backup Catalog — a folder on the backup server. The Veeam Guest Catalog Service running on the backup server works in conjunction with search components installed on Veeam Backup Enterprise Manager and (optionally) a dedicated Microsoft Search Server.
    • Veeam Backup & Replication Configuration Database is used to store data about the backup infrastructure, jobs, sessions and so on. The database instance can be located on a SQL Server installed either locally (on the same machine where the backup server is running) or remotely.
    • Veeam Backup PowerShell Snap-In is an extension for Microsoft Windows PowerShell 2.0. Veeam Backup PowerShell adds a set of cmdlets to allow users to perform backup, replication and recovery tasks through the command-line interface of PowerShell or run custom scripts to fully automate operation of Veeam Backup & Replication.
    • Mount server is a component required for browsing the VM guest file system and restoring VM guest OS files and application items to the original location.

Backup & Replication Console

The Veeam Backup & Replication console is a separate client-side component that provides access to the backup server. The console is installed locally on the backup server by default. You can also use it in a standalone mode — install the console on a dedicated machine and access Veeam Backup & Replication remotely over the network. The console lets you log in to Veeam Backup & Replication and perform all kind of data protection and disaster recovery operations as if you work on the backup server.

To log in to Veeam Backup & Replication via the console, the user must be added to the Local Users group on the backup server or a group of domain users who have access to the backup server. The user can perform the scope of operations permitted by his or her role in Veeam Backup & Replication.

You can install as many remote consoles as you need so that multiple users can access Veeam Backup & Replication simultaneously. Veeam Backup & Replication prevents concurrent modifications on the backup server. If several users are working with Veeam Backup & Replication at the same time, the user who saves the changes first has the priority. Other users will be prompted to reload the wizard or window to get the most recent information about the changes in the configuration database.

If you have multiple backup servers in the infrastructure, you can connect to any of them from the same console. For convenience, you can save several shortcuts for these connections.

To make users' work as uninterrupted as possible, the remote console maintains the session for 5 minutes if the connection is lost. If the connection is re-established within this period, you can continue working without re-logging to the console.

When you install a remote console on a machine, Veeam Backup & Replication installs the following components:
  • Veeam Backup PowerShell Snap-In
  • Veeam Explorer for Microsoft Active Directory
  • Veeam Explorer for Microsoft Exchange
  • Veeam Explorer for Oracle
  • Veeam Explorer for Microsoft SQL
  • Veeam Explorer for Microsoft SharePoint
  • Mount server
The console does not have a direct access to the backup infrastructure components and configuration database. Such data as user credentials, passwords, roles and permissions are stored on the backup server side. To access this data, the console needs to connect to the backup server and query this information periodically during the work session. 

Backup & Replication Console
Requirements and Limitations for Remote Console

The machine on which you install the Veeam Backup & Replication console must meet the following requirements:
  • The remote console can be installed on a Microsoft Windows machine (physical or virtual).
  • If you install the console remotely, you can deploy it outside NAT. However, the backup server must be behind NAT. The opposite type of deployment is not supported: if the backup server is deployed outside NAT and the remote console is deployed behind NAT, you will not be able to connect to the backup server.
The Veeam Backup & Replication console has the following limitations:
  • You cannot perform restore from the configuration backup via the remote console.
  • The machines on which the remote console is installed are not added to the list of managed servers automatically. For this reason, you cannot perform some operations, for example, import backup files that reside on the remote console machine or assign roles of backup infrastructure components to this machine. To perform these operations, you must add the remote console machine as a managed server to Veeam Backup & Replication.

 

Off-Host Backup Proxy

By default, when you perform backup and replication jobs in the Hyper-V environment, VM data is processed directly on the source Hyper-V host where VMs reside, and then moved to the target, bypassing the backup server.

VM data processing can produce unwanted overhead on the production Hyper-V host and impact performance of VMs running on this host. To take data processing off the production Hyper-V host, you can use the off-host backup mode.

The off-host mode shifts the backup and replication load to a dedicated machine — an off-host backup proxy. The off-host backup proxy functions as a “data mover” which retrieves VM data from the source datastore, processes it and transfers to the destination.

The machine performing the role of an off-host backup proxy must meet the following requirements:
  • The role of an off-host backup proxy can be assigned only to a physical Microsoft Windows 2008 Server R2 machine with the Hyper-V role enabled, Windows Server 2012 machine with the Hyper-V role enabled or Windows Server 2012 R2 machine with the Hyper-V role enabled.
For evaluation and testing purposes, you can assign the off-host backup proxy role to a VM. To do this, you must enable the Hyper-V role on this VM (use nested virtualization). However, it is not recommended that you use such off-host backup proxies in the production environment.
  • The off-host backup proxy must have access to the shared storage where VMs to be backed up, replicated or copied are hosted.
  • To create and manage volume shadow copies on the shared storage, you must install a VSS hardware provider that supports transportable shadow copies on the off-host proxy and the Hyper-V host. The VSS hardware provider is usually distributed as a part of client components supplied by the storage vendor.

When you assign the role of an off-host backup proxy to the selected machine, Veeam Backup & Replication automatically installs on it light-weight components and services required for backup proxy functioning. Unlike the backup server, backup proxies do not require a dedicated SQL database — all settings are stored centrally, within the configuration database used by Veeam Backup & Replication.

To enable a Hyper-V host or a Windows machine to act as an off-host backup proxy,

Veeam Backup & Replication installs the following services on it:
  • Veeam Installer Service is an auxiliary service that is installed and started on any Windows (or Hyper-V) server once it is added to the list of managed servers in the Veeam Backup & Replication console. This service analyzes the system, installs and upgrades necessary components and services.
  • Veeam Transportis responsible for deploying and coordinating executable modules that act as "data movers" and perform main job activities on behalf of Veeam Backup & Replication, such as performing data deduplication, compression and so on.
  • Veeam Hyper-V Integration Service is responsible for communicating with the VSS framework during backup, replication and other jobs, and performing recovery tasks. The service also deploys a driver that handles changed block tracking for Hyper-V.

Guest Interaction Proxy

To interact with the VM guest OS during the backup or replication job, Veeam Backup & Replication needs to deploy a runtime process in each VM. Guest OS interaction is performed if you enable the following options in the job:
  • Application-aware processing
  • Guest file system indexing
  • Transaction logs processing
Previously, the runtime process on all VMs was deployed by the backup server. This could cause the following problems:
  • The load on the backup server was high.
  • If a connection between two sites was slow, the job performance decreased.
  • If the backup server had no network connection to VMs, application-aware processing tasks were not accomplished for these VMs.
Guest Interaction Proxy

Starting from Veeam Backup & Replication 9.0, the task of deploying the runtime process in a Microsoft Windows VM is performed by the guest interaction proxy. The guest interaction proxy is a backup infrastructure component that sits between the backup server and processed VM. The guest interaction proxy deploys the runtime process in the VM and sends commands from the backup server to the VM.

The guest interaction proxy allows you to communicate with the VM guest OS even if the backup server and processed VM run in different networks. As the task of runtime process deployment is assigned to the guest interaction proxy, the backup server only has to coordinate job activities.

Guest Interaction ProxyImportant!
The guest interaction proxy deploys the runtime process only in Microsoft Windows VMs. In VMs with another guest OS, the runtime process is deployed by the backup server.

Guest Interaction Proxy

You can use multiple guest interaction proxies to improve performance. Multiple guest interaction proxies will deploy runtime processes in VMs faster compared to the same operation performed by one guest interaction proxy.

In a backup infrastructure with multiple remote sites, you can deploy a guest interaction proxy in each site. This can reduce load on the backup server and produce less traffic between the backup server and remote site. The backup server will only have to send commands to the guest interaction proxies.

Requirements for Guest Interaction Proxy
To perform the role of guest interaction proxy, the machine must meet the following requirements:
  • It must be a Microsoft Windows machine (physical or virtual).
  • You must add it to the Veeam Backup & Replication console as a managed server.
  • It must have a LAN connection to the VM that will be backed up or replicated.
The guest interaction proxy role can be performed by any machine that meets the requirements, including backup proxy, backup repository, WAN accelerator, Microsoft Hyper-V host or backup server.
Guest Interaction ProxyNote:
The guest interaction proxy functionality is available in the Enterprise and Enterprise Plus Editions of Veeam Backup & Replication.

Guest Interaction Proxy Selection
When you add a Microsoft Windows machine to the backup infrastructure, Veeam Backup & Replication deploys the Data Mover Service on it. The Data Mover Service includes the components responsible for runtime process deployment during guest OS interaction.

To assign a guest interaction proxy for the job, you must select a Microsoft Windows machine that will perform the role of the guest interaction proxy at the Guest Processing step of the backup or replication job wizard. You can assign the guest interaction proxy manually, or let Veeam Backup & Replication do it automatically. Veeam Backup & Replication uses the following priority rules to select the guest interaction proxy:
  1. A machine in the same network as the protected VM that does not perform the backup server role.
  2. A machine in the same network as the protected VM that performs the backup server role.
  3. A machine in another network that does not perform the backup server role.
  4. A machine in another network that performs the backup server role.
If Veeam Backup & Replication finds several available machines of equal priority, it selects the less loaded machine. The load is defined by the number of tasks that the machine already performs.

Guest Interaction Proxy 
Failover from Guest Interaction Proxy to Backup Server

If the guest interaction proxy fails to connect to a Microsoft Windows VM, the guest interaction proxy will not be able to access the VM and deploy a runtime process in it. In this case, the backup server will take over the role of guest interaction proxy and deploy the runtime process in the VM.

 

Backup Repository

A backup repository is a storage location where you can keep backup files and metadata for replicated VMs. You can configure the following types of backup repositories in the backup infrastructure: 

Simple Backup Repository

A backup repository is a location used by Veeam Backup & Replication jobs to store backup files. 

Technically, a backup repository is a folder on the backup storage. By assigning different repositories to jobs and limiting the number of parallel jobs for each one, you can balance the load across your backup infrastructure.

In the Veeam backup infrastructure, you can use one of the following repository types:
  • Microsoft Windows server with local or directly attached storage. The storage can be a local disk, directly attached disk-based storage (such as a USB hard drive), or iSCSI/FC SAN LUN in case the server is connected into the SAN fabric.
    On a Windows repository, Veeam Backup & Replication deploys a local Veeam Data Mover Service (when you add a Windows-based server to the product console, Veeam Backup & Replication installs a set of components including the Veeam Data Mover Service on that server). When any job addresses the backup repository, the Veeam Data Mover Service on the backup repository establishes a connection with the source-side Veeam Data Mover Service on the backup proxy, enabling efficient data transfer over LAN or WAN.
  • Linux server with local, directly attached storage or mounted NFS. The storage can be a local disk, directly attached disk-based storage (such as a USB hard drive), NFS share, or iSCSI/FC SAN LUN in case the server is connected into the SAN fabric.
When any task addresses a Linux repository, Veeam Backup & Replication deploys and starts the Veeam Data Mover Service on the backup repository. The Data Mover Service establishes a connection with the source-side Data Mover Service on the backup proxy, enabling efficient data transfer over LAN or WAN.
  • CIFS (SMB) share. SMB share cannot host Veeam Data Mover Services. For this reason, data to the SMB share is written from the gateway server. By default, this role performs an on-host or off-host backup proxy that is used by the job for data transport.
However, if you plan to move VM data to an offsite SMB repository over a WAN link, it is recommended that you deploy an additional gateway server in the remote site, closer to the SMB repository.

Veeam Backup & Replication will deploy a Veeam Data Mover Service on this gateway server, which will improve data transfer performance.
  • Deduplicating storage appliance. Veeam Backup & Replication supports the following deduplicating storage appliances:
  • EMC Data Domain
  • ExaGrid
  • HPE StoreOnce

Scale-Out Backup Repository

You can configure a scale-out backup repository in the backup infrastructure.

The scale-out backup repository is a logical entity. It groups several simple backup repositories, or extents. When you configure the scale-out backup repository, you actually create a pool of storage devices and systems, summarizing their capacity.

You can expand the scale-out backup repository at any moment. For example, if backup data grows and the backup repository reaches the storage limit, you can add a new storage system to the scale-out backup repository. The free space on this storage system will be added to the capacity of the scale-out backup repository. As a result, you will not have to move backups to a backup repository of a larger size.

To deploy a scale-out backup repository, you must configure a number of simple backup repositories and include them into the scale-out backup repository as extents. You can mix backup repositories of different types in one scale-out backup repository:
  • Microsoft Windows backup repositories
  • Linux backup repositories
  • Shared folders
  • Deduplicating storage appliances
For example, you can add a Microsoft Windows server and deduplicating storage appliance to the same scale-out backup repository.

You can use the scale-out backup repository for the following types of jobs and tasks:
  • Backup jobs.
  • Backup copy jobs. You can copy backups that reside on scale-out backup repositories and store backup copies on scale-out backup repositories.
  • VeeamZIP tasks.
Backup files stored on the scale-out repository can be used for all types of restores, replication from backup and backup copy jobs. You can verify such backups with SureBackup jobs. The scale-out backup repository can be used as a staging backup repository for restore from tape media. Files restored from the tape media are placed to the extents according to data placement policy configured for the scale-out backup repository.

Limitations for Scale-out Backup Repositories

The scale-out backup repository has the following limitations:
  • The scale-out backup repository functionality is available only in Enterprise and Enterprise Plus editions of Veeam Backup & Replication.
If you configure a scale-out backup repository and then downgrade to the Standard license, you will not be able to run jobs targeted at the scale-out backup repository. However, you will be able to perform restore from the scale-out backup repository.
  • You cannot use the scale-out backup repository as a target for the following types of jobs:
  • Configuration backup job
  • Replication jobs
  • Endpoint backup jobs
  • You cannot add a backup repository as an extent to the scale-out backup repository if any job of unsupported type is targeted at this backup repository or if the backup repository contains data produced by jobs of unsupported types (for example, replica metadata). To add such backup repository as an extent, you must first target unsupported jobs to another backup repository and remove the job data from the backup repository.
  • You cannot use a scale-out backup repository as a cloud repository. You cannot add a cloud repository as an extent to the scale-out backup repository.
  • You cannot use a backup repository with rotated drives as an extent to a scale-out backup repository. Even you enable the This repository is backed up by rotated hard drives setting for an extent, Veeam Backup & Replication will ignore this setting and use an extent as a simple backup repository.
  • If a backup repository is added as an extent to the scale-out backup repository, you cannot use it as a regular backup repository.
  • You cannot add a scale-out backup repository as an extent to another scale-out backup repository.
  • You cannot add a backup repository as an extent if this backup repository is already added as an extent to another scale-out backup repository.
  • You cannot add a backup repository on which some activity is being performed (for example, a backup job or restore task) as an extent to the scale-out backup repository.
  • If you use Enterprise Edition of Veeam Backup & Replication, you can create 1 scale-out backup repository with 3 extents for this scale-out backup repository. Enterprise Plus Edition has no limitations on the number of scale-out backup repositories or extents.

 

Extents

The scale-out backup repository can comprise one or more extents. The extent is a standard backup repository configured in the backup infrastructure. You can add any simple backup repository, except the cloud repository, as an extent to the scale-out backup repository.

The backup repository added to the scale-out backup repository ceases to exist as a simple backup repository. You cannot target jobs to this backup repository. Instead, you have to target jobs at the configured scale-out backup repository.

On every extent, Veeam Backup & Replication creates the definition.erm file. This file contains a description of the scale-out backup repository and information about its extents. 

Extents inherit most configuration settings from the underlying backup repositories. The following settings are inherited:
  • Number of tasks that can be performed simultaneously
  • Read and write data rate limit
  • Data decompression settings
  • Block alignment settings
The following settings are not inherited:
  • Rotated drive settings. Rotated drive settings are ignored and cannot be configured at the level of the scale-out backup repository.
  • Per-VM backup file settings. Per-VM settings can be configured at the level of the scale-out backup repository.
Limitations, specific for certain types of backup repositories, apply to extents. For example, if you add EMC Data Domain as an extent to the scale-out backup repository, you will not be able to create a backup chain longer than 60 points on this scale-out backup repository.

Extents of the scale-out backup repository should be located in the same site. Technically, you can add extents that reside in different sites to the scale-out backup repository. However, in this case Veeam Backup & Replication will have to access VM backup files on storage devices in different locations, and the backup performance will degrade.

 

Backup File Placement

Veeam Backup & Replication stores backup files on all extents of the scale-out backup repository.

When you configure a scale-out backup repository, you must set the backup file placement policy for it. The backup file placement policy describes how backup files are distributed between extents. You can choose one of two policies:
  • Data locality— all backup files that belong to the same backup chain are stored on the same extent of the scale-out backup repository.
The Data locality policy does not put any limitations to backup chains. A new backup chain may be stored on the same extent or another extent. For example, if you create an active full backup, Veeam Backup & Replication may store the full backup file to another extent, and all dependent incremental backup files will be stored together with this full backup file. 

However, if you use a deduplicating storage appliance as an extent to the scale-out backup repository, Veeam Backup & Replication will attempt to place a new full backup to the extent where the full backup from the previous backup chain resides. Such behavior will help increase the data deduplication ratio.
  • Performance— full backup files and incremental backup files that belong to the same backup chain are stored on different extents of the scale-out backup repository. If necessary, you can explicitly specify on which extents full backup files and incremental backup files must be stored.
The Performance policy can improve performance of transform operations if you use raw data devices as extents. When Veeam Backup & Replication performs transform operations, it needs to access a number of backup files in the backup repository. If these files are located on different storages, the I/O load on the storages hosting backup files will be lower.

If you set the Performance policy, you must make sure that the network connection between extents is fast and reliable. You must also make sure all extents are online when the backup job, backup copy job or a restore task starts. If any extent hosting backup files in the current backup chain is not available, the backup chain will be broken, and Veeam Backup & Replication will not be able to complete the task. To avoid data loss in this situation, you can enable the Perform full backup when required extent is offline option for the scale-out backup repository. With this option enabled, Veeam Backup & Replication will create a full backup instead of incremental backup if some files are missing from the backup chain.

The backup file placement policy is not strict. If the necessary extent is not accessible, Veeam Backup & Replication will disregard the policy limitations and attempt to place the backup file to the extent that has enough free space for the backup file.

For example, you have set the Performance policy for the scale-out backup repository and specified that full backup files must be stored on Extent 1 and incremental backup files must be stored on Extent 2. If before an incremental backup job session Extent 2 goes offline, the new incremental backup file will be placed to Extent 1.

Extent Selection
To select an extent for backup file placement, Veeam Backup & Replication checks the following conditions:
  1. Availability of extents on which backup files reside. If some extent with backup files from the current backup chain is not accessible, Veeam Backup & Replication will trigger a full backup instead of incremental (if this option is enabled).
  2. Backup placement policy set for the scale-out backup repository.
  3. Load control settings — maximum number of tasks that the extent can process simultaneously.
  4. Amount of free space available on the extent — the backup file is placed to the extent with the most amount of free space.
  5. Availability of files from the current backup chain — extents that host incremental backup files from the current backup chain (or current VM) have a higher priority than extents that do not host such files.
At the beginning of the job session, Veeam Backup & Replication estimates how much space the backup file requires and checks the amount of free space on extents. Veeam Backup & Replication assumes that the following amount of space is required for backup files:
  • For per-VM backup chains: the size of the full backup file is equal to 50% of source VM data. The size of an incremental backup file is equal to 10% of source VM data.
This mechanism is also applied to backup files created with backup copy jobs.
  • For single file backup chains: the size of the full backup file is equal to 50% of source data for all VMs in the job. For the first incremental job session, the size of an incremental backup file is equal to 10% the full backup file. For subsequent incremental job sessions, the size of an incremental backup file is equal to 100% of the previous incremental backup file.
Extent Selection for Backup Repositories with Performance Policy

If you set the Performance policy for the scale-out backup repository, Veeam Backup & Replication always stores full backup files and incremental backup files that belong to the same backup chain on different extents. To choose the extent to which a backup file can be stored, Veeam Backup & Replication applies this policy and policies mentioned above.

For example, a scale-out backup repository has 2 extents that have 100 GB and 200 GB of free space. You set the Performance policy for the scale-out backup repository and define that all types of backup files (full and incremental) can be placed on both extents.

When a backup job runs, Veeam Backup & Replication picks the target extent in the following manner:
  1. During the first job session, Veeam Backup & Replication checks to which extent a full backup file can be stored. As both extents can host the full backup file, Veeam Backup & Replication checks which extent has more free space, and picks the extent that has 200 GB of free space.
  2. During incremental job session, Veeam Backup & Replication checks to which extent an incremental backup file can be stored. As both extents can host the incremental backup file, Veeam Backup & Replication picks the extent that does not store the full backup file — the extent that has 100 GB of free space.

 

Service Actions with Scale-Out Backup Repositories

You can perform service actions with extents of scale-out backup repositories:
  • Put extents to the Maintenance mode
  • Evacuate backups from extents

 

Maintenance Mode

In some cases, you may want to perform service actions with extents of the scale-out backup repository. For example, you need to upgrade the backup repository server and add more memory to it. Or you want to replace a storage device backing the extent and need to relocate backup files. Before you start service actions, you must put the extent to the Maintenance mode.

An extent in the Maintenance mode operates with the limited functionality:
  • Veeam Backup & Replication does not start new tasks targeted at this extent.
  • You cannot restore VM data from backup files residing on the extent. You also cannot restore VM data from backup files residing on other extents if a part of the backup chain resides on the extent in the Maintenance mode.
When you switch the Maintenance mode, Veeam Backup & Replication launches the Repository Maintenance job. The Repository Maintenance job checks the status of jobs and tasks targeted at the extent and puts the extent to one of the following modes:
  • If no tasks using the extent are currently running, the job puts the extent to the Maintenance mode immediately.
  • If the extent is busy with any task, for example, a backup job, the job puts the extent to the Maintenance pending state and waits for the task to complete. When the task is complete, the extent is put to the Maintenance mode.

 

Backup Files Evacuation

If you want to exclude an extent from the scale-out backup repository, you first need to evacuate backup files from this extent. When you evacuate backups, Veeam Backup & Replication moves backup files from the extent to other extents that belong to the same scale-out backup repository. As a result, the backup chains remain consistent and you can work with them in a usual way.

The extent must be put to the Maintenance mode before you evacuate backups from it. If the extent is in the normal operational mode, the Evacuate option will not be available for this extent.

When selecting the target extent for evacuated files, Veeam Backup & Replication attempts to keep to the backup placement settings specified for remaining extents. For example, you have 3 extents in the scale-out backup repository with the following backup file placement settings:
  • On Extent 1, full backup files are stored.
  • On Extent 2 and Extent 3, incremental backup files are stored.
If you evacuate backup files from Extent 2, Veeam Backup & Replication will relocate them to Extent 3.

Backup Repositories with Rotated Drives

You can configure a backup repository to use rotated drives. This scenario can be helpful if you want to store backups on several external hard drives (for example, USB or eSATA) and plan to regularly swap these drives between different locations.

To use rotated drives, you must enable the This repository is backed up by rotated hard drives option in the advanced settings of the backup repository. When this option is enabled, Veeam Backup & Replication recognizes the backup target as a backup repository with rotated drives and uses a specific algorithm to make sure that the backup chain created on these drives is not broken.

Microsoft Windows Backup Repository
A job targeted at a backup repository with rotated drives is performed in the following way:
  1. Veeam Backup & Replication creates a regular backup chain on the currently attached drive.
  2. When a new job session starts, Veeam Backup & Replication checks if the backup chain on the currently attached drive is consistent. The consistent backup chain must contain a full backup and all incremental backups that have been produced by the job. This requirement applies to all types of backup chains: forever forward incremental, forward incremental and reverse incremental.
If external drives have been swapped, and the full backup or any incremental backups are missing from the currently attached drive, Veeam Backup & Replication behaves in the following way:
  • [For backup jobs] Veeam Backup & Replication starts the backup chain anew. It creates a new full backup file on the drive, and this full backup is used as a starting point for subsequent incremental backups.
  • [For backup copy jobs] If the attached drive is empty, Veeam Backup & Replication creates a full backup on it. If there is a backup chain on the drive,Veeam Backup & Replication creates a new incremental backup and adds it to the backup chain. The latest incremental backup existing in the backup chain is used as a starting point for the new incremental backup.
  1. [For external drives attached to Microsoft Windows servers] Veeam Backup & Replication checks the retention policy set for the job. If some backup files in the backup chain are outdated, Veeam Backup & Replication removes them from the backup chain.
  2. When you swap drives again, Veeam Backup & Replication behaves in the following way:
  • [For backup jobs] Veeam Backup & Replication checks the backup chain for consistency and creates a new full backup.
  • [For backup copy jobs] If the attached drive is empty, Veeam Backup & Replication creates a full backup on it. If there is a backup chain on the drive, Veeam Backup & Replication creates a new incremental backup and adds it to the backup chain. The latest incremental backup existing in the backup chain is used as a starting point for the new incremental backup.
When you specify retention settings for a job targeted at a backup repository with rotated drives, you must define the total number of restore points that you want to retain on all drives in the set. For example, if you set retention to 14, the job will keep the total of 14 restore points across all drives.

Backup Repositories with Rotated Drives
Drive letters for external drives may change when you add new volumes or storage hardware such as CD-ROM on the server. On Microsoft Windows backup repositories, Veeam Backup & Replication can keep track of drives and detect them even if the drive letter changes.

To detect a drive correctly, Veeam Backup & Replication must have a record about it in the configuration database. Consider the following requirements:
  • When you insert a drive for the first time, the drive is not registered in the configuration database. Such drive must have the same letter as the one specified in the Path to folder field in the backup repository settings.
If the drive has some other letter, Veeam Backup & Replication will not be able to detect and use it.
  • When you insert a drive that has already been used and has some restore points on it, the drive is already registered in the configuration database. Veeam Backup & Replication will be able to detect and use it, even if the drive letter changes.






Linux and Shared Folder Backup Repository
If you use a Linux server or CIFS share as a backup repository with rotated drives, Veeam Backup & Replication employs a “cropped” mechanism of work with rotated drives.

Veeam Backup & Replication keeps information only about the latest backup chain in the configuration database. Information about previous backup chains is removed from the database. For this reason, the retention policy set for the job may not work as expected.

A job targeted at a backup repository with rotated drives is performed in the following way:
  1. During the first run of the job, Veeam Backup & Replication creates a regular backup full backup on the drive that is attached to the backup repository server.
  2. During the next job session, Veeam Backup & Replication checks if the current backup chain on the attached drive is consistent. The consistent backup chain must contain a full backup and all incremental backups subsequent to it. This requirement applies to all types of backup chains: forever forward incremental, forward incremental and reverse incremental.
  • If the current backup chain is consistent, Veeam Backup & Replication adds a new restore point to the backup chain.
  • If external drives have been swapped, and the current backup chain is not consistent,  
  • Veeam Backup & Replication always starts a new backup chain (even if restore points from previous backup chains are available on the attached drive). Veeam Backup & Replication creates a new full backup file on the drive, and this full backup is used as a starting point for subsequent incremental backups.

    As soon as Veeam Backup & Replication starts a new backup chain on the drive, it removes information about restore points from previous backup chains from the configuration database. Backup files corresponding to these previous restore points are not deleted, they remain on disk. This happens because Veeam Backup & Replication applies the retention policy only to the current backup chain, not to previous backup chains.
Backup Repositories with Rotated Drives
Limitations for Backup Repositories with Rotated Drives
Backup repositories with rotated drives have the following limitations:
  1. You cannot store archive full backups (GFS backups) created with backup copy jobs in backup repositories with rotated drives.
  2. You cannot store per-VM backup files in backup repositories with rotated drives.

 

Support for Deduplicating Storage Systems

For disk-to-disk backups, you can use a deduplicating storage system as a target.

Veeam Backup & Replication supports the following deduplicating storage appliances:
  • EMC Data Domain
  • ExaGrid
  • HPE StoreOnce

 

EMC Data Domain

You can use EMC Data Domain storage systems with Data Domain Boost (DD Boost) as backup repositories.

The DD Boost technology offers a set of features for advanced data processing:
  • Distributed Segment Processing
  • Advanced Load Balancing and Link Failover
  • Virtual Synthetics
  • Managed File Replication
Veeam Backup & Replication supports Distributed Segment Processing, Advanced Load Balancing, Link Failover and Virtual Synthetics. Managed File Replication is not supported.

In addition to these technologies, Veeam Backup & Replication supports in-flight data encryption and per storage unit streams.

Distributed Segment Processing
Distributed Segment Processing lets EMC Data Domain “distribute” the deduplication process and perform a part of data deduplication operations on the backup proxy side.

Without Distributed Segment Processing, EMC Data Domain performs deduplication on the EMC Data Domain storage system. The backup proxy sends unfiltered data blocks to EMC Data Domain over the network. Data segmentation, filtering and compression operations are performed on the target side, before data is written to disk.

With Distributed Segment Processing, operations on data segmentation, filtering and compression are performed on the backup proxy side. The backup proxy sends only unique data blocks to EMC Data Domain. As a result, the load on the network reduces and the network throughput improves.

Advanced Load Balancing and Link Failover
Advanced Load Balancing and Link Failover allow you to balance data transfer load and route VM data traffic to a working link in case of network outage problems.

Without Advanced Load Balancing, every backup server connects to Data Domain on a dedicated Ethernet link. Such configuration does not provide an ability to balance the data transfer load across the links. If a network error occurs during the data transfer process, the backup job fails and needs to be restarted.

Advanced Load Balancing allows you to aggregate several Ethernet links into one interface group. As a result, EMC Data Domain automatically balances the traffic load coming from several backup servers united in one group. If some link in the group goes down, EMC Data Domain automatically performs link failover, and the backup traffic is routed to a working link.

Virtual Synthetics
Veeam Backup & Replication supports Virtual Synthetic Fulls by EMC Data Domain. Virtual Synthetic Fulls let you synthesize a full backup on the target backup storage without physically copying data from source volumes. To construct a full backup file, EMC Data Domain uses pointers to existing data segments on the target backup storage. Virtual Synthetic Fulls reduce the workload on the network and backup infrastructure components and increase the backup job performance.

In-Flight Data Encryption
Veeam Backup & Replication supports in-flight encryption introduced in EMC Data Domain Boost 3.0. If necessary, you can enable data encryption at the backup repository level. Veeam Backup & Replication will leverage the EMC Data Domain technology to encrypt data transported between the EMC DD Boost library and EMC Data Domain system.

Per Storage Unit Streams
Veeam Backup & Replication supports per storage unit streams on EMC Data Domain. The maximum number of parallel tasks that can be targeted at the backup repository (the Limit maximum concurrent tasks to N setting) is applied to the storage unit, not the whole EMC Data Domain system.

 

How EMC Data Domain Works

To support the EMC DD Boost technology, Veeam Backup & Replication leverages two EMC Data Domain components:
  • DD Boost library. The DD Boost library is a component of the EMC Data Domain system. The DD Boost library is embedded into the Veeam Data Mover Service setup. When you add a Microsoft Windows server to the backup infrastructure, the DD Boost Library is automatically installed on the added server together with the Data Mover Service.
  • DD Boost server. The DD Boost server is a target-side component running on the OS of the EMC Data Domain storage system.
To communicate with EMC Data Domain, Veeam Backup & Replication uses the DD Boost library deployed on a gateway server. The gateway server is a backup infrastructure component that “bridges” the backup server and EMC Data Domain storage system. The gateway server must meet the following requirements:
  • The server must run Microsoft Windows OS.
  • The server must be added to the backup infrastructure.
  • The server must have access to the backup server and EMC Data Domain appliance.
You define what gateway server to use when you assign a backup repository role to EMC Data Domain. You can define the gateway server explicitly or instruct Veeam Backup & Replication to select it automatically.

For EMC Data Domain storage systems working over Fibre Channel, you must explicitly define the gateway server that will communicate with EMC Data Domain. As a gateway server, you must use a Microsoft Windows server that is added to the backup infrastructure and has access to EMC Data Domain over Fibre Channel.

How EMC Data Domain Works

 

Supported Protocols

Veeam Backup & Replication supports EMC Data Domain storage systems working over the following protocols:
  • TCP/IP protocol: Veeam Backup & Replication communicates with the EMC Data Domain server by sending commands over the network.
  • Fibre Channel protocol: Veeam Backup & Replication communicates with the EMC Data Domain Fibre Channel server by sending SCSI commands over Fibre Channel.

 

Limitations for EMC Data Domain

If you plan to use EMC Data Domain as a backup repository, mind the following limitations:
  • Use of EMC Data Domain with DD Boost does not guarantee improvement of job performance; it reduces the load on the network and improves the network throughput.
  • EMC Data Domain requires at least 1 Gbps network and 0% of packets data loss between the gateway server and EMC Data Domain storage appliance. In the opposite case, stable work of EMC Data Domain cannot be guaranteed.
  • EMC Data Domain does not support the reverse incremental backup method. Do not enable this option for backup jobs targeted at this type of backup repository.
  • When you create a backup job targeted at EMC Data Domain, Veeam Backup & Replication will offer you to switch to optimized job settings and use the 4 MB size of data block for VM data processing. It is recommended that you use optimized job settings. Large data blocks produce a smaller metadata table that requires less memory and CPU resources to process.
  • The length of forward incremental and forever forward incremental backup chains (chains that contain one full backup and a set of subsequent incremental backups) cannot be greater than 60 restore points. To overcome this limitation, schedule full backups (active or synthetic) to split the backup chain into shorter series. For example, to perform backups at 30-minute intervals 24 hours a day, you must schedule synthetic fulls every day. In this scenario, intervals immediately after midnight may be skipped due to duration of synthetic processing.
  • If you connect to EMC Data Domain over Fibre Channel, you must explicitly define a gateway server to communicate with EMC Data Domain. As a gateway server, you must use a Microsoft Windows server that is added to the backup infrastructure and has access to the EMC Data Domain storage appliance over Fibre Channel.

 

ExaGrid

You can use ExaGrid appliances as backup repositories.
ExaGrid uses post-process deduplication. Data deduplication is performed on the target storage system. After VM data is written to disk, ExaGrid analyses bytes in the newly transferred data portions. ExaGrid compares versions of data over time and stores only the differences to disk.

ExaGrid deduplicates data at the storage level. Identical data blocks are detected throughout the whole storage system, which increases the deduplication ratio.

Veeam Backup & Replication works with ExaGrid appliances as with a Linux backup repository. To communicate with ExaGrid, Veeam Backup & Replication uses two Data Mover Services that are responsible for data processing and transfer:
  • Data Mover Service on the backup proxy
  • Data Mover Service on the ExaGrid appliance


Limitations for ExaGrid
ExaGrid appliances achieve a lower deduplication ratio when a backup job uses multi-task processing. Processing a single task at a time within each backup job results in the best deduplication ratio. If you decide to use ExaGrid as a backup repository, all tasks executed within a backup job should be processed sequentially, one by one. To do this, you must limit the maximum concurrent tasks to 1 in the settings of ExaGrid backup repositories.

The ExaGrid appliance can handle many concurrent backup jobs, with one of the highest ingest rates in the market. To accomplish the maximum ingest and shortest backup time, you need to configure multiple backup jobs, each targeted at its own backup repository. Then schedule these jobs to run concurrently.

 

HPE StoreOnce

You can use HPE StoreOnce storage appliances as backup repositories. Depending on the storage configuration and type of the backup target, HPE StoreOnce can work in the following ways:
  • Perform source-side deduplication
  • Perform target-side deduplication
  • Work in the shared folder mode
Source-Side Data Deduplication
HPE StoreOnce performs source-side deduplication if the backup target meets the following requirements:
  1. You have a Catalyst license installed on HPE StoreOnce.
  2. You use a Catalyst store as a backup repository.
  3. The Catalyst store is configured to work in the Low Bandwidth mode (Primary and Secondary Transfer Policy).
  4. You add the HPE StoreOnce Catalyst as a deduplicating storage appliance, not as a shared folder to the backup infrastructure.
To deduplicate data on the source side, HPE StoreOnce uses the HPE StoreOnce Catalyst agent. The HPE StoreOnce Catalyst agent is a component of the HPE StoreOnce Catalyst software. It is installed on the gateway server communicating with the HPE StoreOnce appliance.

HPE StoreOnce deduplicates data on the source side, before writing it to target:
  1. During the backup job session, HPE StoreOnce analyzes data incoming to the HPE StoreOnce appliance in chunks and computes a hash value for every data chunk. Hash values are stored in an index on disk.
  2. The HPE StoreOnce Catalyst agent calculates hash values for data chunks in a new data flow and sends these hash values to target.
  3. HPE StoreOnce identifies which data blocks are already saved on disk and communicates this information to the HPE StoreOnce Catalyst agent. The HPE StoreOnce Catalyst agent sends only unique data blocks to target.
As a result, the load on the network reduces, the backup job performance improves, and you can save on disk space.

HPE StoreOnce
Target-Side Data Deduplication
HPE StoreOnce performs target-side deduplication if the backup target is configured in the following way:
  • For a Catalyst store:
  • The Catalyst store works in the High Bandwidth mode (Primary or Secondary Transfer Policy is set to High Bandwidth).
  • The Catalyst license is installed on the HPE StoreOnce (required).
  • The Catalyst store is added as a backup repository to the backup infrastructure.
  • For a CIFS store:
  • The Catalyst license is not required.
  • The CIFS store is added as a backup repository to the backup infrastructure.

HPE StoreOnce deduplicates data on the target side, after the data is transported to HPE StoreOnce:
  1. HPE StoreOnce analyzes data incoming to the HPE StoreOnce appliance in chunks and creates a hash value for every data chunk. Hash values are stored in an index on the target side.
  2. HPE StoreOnce analyzes VM data transported to target and replaces identical data chunks with references to data chunks that are already saved on disk.
As a result, only new data chunks are written to disk, which helps save on disk space.

HPE StoreOnce

Shared Folder Mode
If you do not have an HPE StoreOnce Catalyst license, you can add the HPE StoreOnce appliance as a shared folder backup repository. In this mode, HPE StoreOnce will perform target-side deduplication.

If you work with HPE StoreOnce in the shared folder mode, the performance of backup jobs and transform operations is lower (in comparison with the integration mode, when HPE StoreOnce is added as a deduplicating storage appliance).

How HPE StoreOnce Works

To work with HP StoreOnce, Veeam Backup & Replication leverages the HPE StoreOnce Catalyst technology and two HPE StoreOnce components:
  • HPE StoreOnce Catalyst agent. The HPE StoreOnce Catalyst agent is a component of the HPE StoreOnce Catalyst software. The HPE StoreOnce Catalyst agent is embedded into the Veeam Data Mover Service setup. When you add a Microsoft Windows server to the backup infrastructure, the HPE StoreOnce Catalyst agent is automatically installed on the added server together with the Data Mover Service.
  • HPE StoreOnce appliance. The HPE StoreOnce appliance is an HPE StoreOnce storage system on which Catalyst stores are created.
Veeam Backup & Replication uses two Data Mover Services:
  • Data Mover Service on the backup proxy
  • Data Mover Service on the gateway server
The gateway server is a backup infrastructure component that “bridges” the backup server and HPE StoreOnce appliance. The gateway server must meet the following requirements:
  • The server must run Microsoft Windows OS.
  • The server must be added to the backup infrastructure.
  • The server must have access to the backup server and HPE StoreOnce appliance.
The gateway server is selected when you assign a backup repository role to the HPE StoreOnce appliance. You can define the gateway server explicitly or instruct Veeam Backup & Replication to select it automatically.

For HPE StoreOnce storage systems working over Fibre Channel, you must explicitly define the gateway server to communicate with HPE StoreOnce. As a gateway server, you must use a Microsoft Windows server that is added to the backup infrastructure and has access to HPE StoreOnce over Fibre Channel.

How HPE StoreOnce WorksTip:
For work with HP StoreOnce, Veeam Backup & Replication uses the Catalyst agent installed on the gateway proxy. If you want to reduce the load on the network between the source and target side, assign the gateway server role to a machine on the source side, closer to the backup proxy.


How HPE StoreOnce Works

 

Limitations for HPE StoreOnce

If you plan to use HPE StoreOnce as a backup repository, mind the following limitations. Limitations apply only if you use HPE StoreOnce in the integration mode, not the shared folder mode.
  • Backup files on HPE StoreOnce are locked exclusively by a job or task. If you start several tasks at a time, Veeam Backup & Replication will perform a task with a higher priority and will skip or terminate a task with a lower priority.
In Veeam Backup & Replication, tasks have the following priority levels (starting with the top priority): backup job > backup copy > restore. For example, if the backup and backup copy jobs start simultaneously, Veeam Backup & Replication will terminate the backup copy task. If a file is locked with the backup job, you will not be able to restore VM data from this file.
  • When you create a backup job targeted at HPE StoreOnce, Veeam Backup & Replication will offer you to switch to optimized job settings and use the 4 MB size of data block for VM data processing. It is recommended that you use optimized job settings. Large data blocks produce a smaller metadata table that requires less memory and CPU resources to process.
  • The HPE StoreOnce backup repository always works in the Use per-VM backup files mode.
  • The length of backup chains (chains that contain one full backup and a set of subsequent incremental backups) on HPE StoreOnce cannot be greater than 7 restore points. The recommended backup job schedule is the following: not more than 1 incremental backup once a day, not fewer than one full backup (active or synthetic) once a week.
  • HPE StoreOnce does not support the reverse incremental backup method.
  • The HPE StoreOnce backup repository does not support the Defragment and compact full backup file option (for backup and backup copy jobs).
  • You cannot perfom quick migration for Microsoft Hyper-V VMs started with Instant VM Recovery from the backup that resides on the HP StoreOnce backup repository.
  • You cannot use the HP StoreOnce backup repository as a target for Veeam Endpoint backup jobs. Backup copy jobs, however, can be targeted at the HP StoreOnce backup repository.
  • You cannot use the HPE StoreOnce backup repository as a source or target for file copy jobs.
  • You cannot use the HPE StoreOnce backup repository as a cloud repository.
Several Backup Repositories on HPE StoreOnce
You can configure several backup repositories on one HPE StoreOnce appliance and associate them with different gateway servers.

Mind the following:
  • If you configure several backup repositories on HPE StoreOnce and add them as extents to a scale-out backup repository, make sure that all backup files from one backup chain are stored on one extent. If backup files from one backup chain are stored to different extents, the transform operations performance will be lower.
  • HPE StoreOnce has a limit on the number of opened files that applies to the whole appliance. Tasks targeted at different backup repositories on HPE StoreOnce and run in parallel will equally share this limit.
  • For HPE StoreOnce working over Fibre Channel, there is a limitation on the number of connections from one host. If you connect several backup repositories to one gateway, backup repositories will compete for connections.
  • Deduplication on HPE StoreOnce works within the limits of one object store.

 

Gateway Server

A gateway server is an auxiliary backup infrastructure component that “bridges” the backup server and backup repository. The gateway server is required if you deploy the following types of backup repositories in the backup infrastructure:
  • Shared folder backup repositories
  • EMC DataDomain and HPE StoreOnce deduplicating storage appliances
Shared folder repositories, EMC DataDomain and HPE StoreOnce cannot host Data Mover Services — Veeam components that establish a connection between a backup proxy and backup repository (in case of backup jobs) or between backup repositories (in case of backup copy jobs). To overcome this limitation, Veeam Backup & Replication uses gateway servers.

In the backup infrastructure, a gateway server hosts the Veeam Data Mover Service.

Veeam Backup & Replication establishes a connection between the source Data Mover Service and target Data Mover Service, and transports data from/to backup repositories via gateway servers.

Gateway Server
A machine performing the role of a gateway server must meet the following requirements:
  • A gateway server can run on a physical or virtual machine.
  • The gateway server can run on a Microsoft Windows machine or Microsoft Hyper-V host.
  • The machine must be added to the backup infrastructure.
  • The machine must have access to the backup repository — shared folder, EMC DataDomain or HPE StoreOnce.
To configure a gateway server, you must pass through the Add New Backup Repository wizard and select a machine that will perform the role of a gateway server. You can select a gateway server explicitly or instruct Veeam Backup & Replication to select it automatically.
  • If you select a gateway server explicitly, Veeam Backup & Replication uses the selected machine as a gateway server.
  • If you instruct Veeam Backup & Replication to select the gateway server automatically, Veeam Backup & Replication selects a gateway server using the following rules:
  • For backup jobs: the role of a gateway server is assigned to a machine performing the role of a backup proxy (onsite or offsite).
  • For backup copy jobs: if a backup copy job uses a direct data path, the role of a gateway server is assigned to the mount server associated with the backup repository (Veeam Backup & Replication fails over to the backup server if the mount server is not accessible for some reason). If a backup copy job uses WAN accelerators, the role of a gateway server is assigned to WAN accelerators. For example, if you copy backup from a source Microsoft Windows backup repository to a shared folder backup repository, the gateway server role is assigned to the target WAN accelerator. If you copy backups between 2 shared folder backup repositories, the gateway server role is assigned to the source and target WAN accelerators.
  • For backup to tape jobs: the role of a gateway server is assigned to the backup server.
In the common case, a machine to which you assign the role of a gateway server must be located as close to the backup repository as possible. However, if you use a deduplicating storage appliance with source-side data deduplication, it is reasonable to assign the role of a gateway server to a machine that is located closer to the backup proxy. This will help you reduce the amount of traffic travelling over the network.

Veeam Backup & Replication may use one or several gateway servers to process VMs in the job. The number of gateway servers depends on backup repository settings. If the Use per-VM backup files option is disabled, Veeam Backup & Replication selects one gateway server for the whole backup repository. If the Use per-VM backup files option is enabled, Veeam Backup & Replication selects a gateway server per every VM in the job. The rules of gateway server selection are described above.

For example, a backup job processes 2 VMs. The job is targeted at a backup repository for which the Use per-VM backup files option is enabled. In this case, Veeam Backup & Replication will detect which backup proxies were used to process VMs in the job. If VMs were processed with 2 different backup proxies, Veeam Backup & Replication will assign the role of gateway servers to these backup proxies. If VMs were processed with the same backup proxy, Veeam Backup & Replication will assign the role of a gateway server to this backup proxy, and will use it for both VMs in the job.

For scale-out backup repositories, Veeam Backup & Replication uses one gateway server per every extent. The rules of gateway server selection are described above.

Limitations for Gateway Servers
For deduplicating storage appliances working over Fibre Channel, you must explicitly select a gateway server that will communicate with the appliance. As a gateway server, you must use a Microsoft Windows server that is added to the backup infrastructure and has access to the appliance over Fibre Channel.

 

Mount Server

The mount server is required if you perform restore VM guest OS files and application items to the original location. The mount server lets you route VM traffic by an optimal way, reduce load on the network and speed up the restore process.

When you perform file-level restore or application item restore, Veeam Backup & Replication needs to mount the content of the backup file to a staging server. The staging server must be located in the same site as the backup repository where backup files are stored. If the staging server is located in some other site, Veeam Backup & Replication may route data traffic in a non-optimal way.

For example, if the backup server is located in the local site while the source host and backup repository are located in the remote site, during restore to original location Veeam Backup & Replication will route data traffic in the following way:
  1. From the remote site to the local site — to mount the content of the backup file to the staging server.
  2. From the local site to the remote site — to restore files or application items.
Mount Server
To prevent VM data from traveling between sites, Veeam Backup & Replication uses the mount server. The mount server acts as a "mount point" for backups in the backup repository. When you restore files or application items to the original location, Veeam Backup & Replication mounts the content of the backup file to the mount server (or the original VM for restore to the Microsoft SQL Server and Oracle VMs) and copies files or items to their destination via this mount server or VM.

The mount server is created for every backup repository and associated with it. When you configure a backup repository, you define which server you want to use as a mount server for this backup repository. By default, Veeam Backup & Replication assigns the mount server role to the following machines:
  • Backup repository. For Microsoft Windows backup repositories, the mount server role is assigned to the backup repository server itself.
  • Backup server. For Linux, shared folder backup repositories and deduplicating storage appliances, the mount server role is assigned to the backup server.
  • Veeam Backup & Replication console. The mount server role is also assigned to a machine on which the Veeam Backup & Replication console is installed. Note that this type of mount server is not registered in the Veeam Backup & Replication configuration database.
For scale-out backup repositories, you must define the mount server for every extent.

If you do not want to use default mount servers, you can assign the mount server role to any Microsoft Windows machine in the backup infrastructure. It is recommended that you configure at least one mount server in each site and associate this mount server with the backup repository residing in this site. The mount server and backup repository must be located as close to each other as possible. In this case, you will be able to keep the VM traffic in one site.

Mount Server
Services and Components
On the mount server machine, Veeam Backup & Replication installs the Veeam Mount Service. The Veeam Mount Service requires .NET 4.5.2. If .NET 4.5.2 is not installed on the machine, Veeam Backup & Replication will install it automatically.

Requirements to Mount Server
The machine to which you assign the mount server role must meet the following requirements:
  • You can assign the role of a mount server to Microsoft Windows machines (physical or virtual).
  • You can assign the role of a mount server to 64-bit machines only.
  • The mount server must have access to the backup repository with which it is associated and to the original VM (VM to which you restore files or application items). For restore from storage snapshots, the mount server must also have access to the ESX(i) host on which the temporary VM is registered.

 

Veeam Backup Enterprise Manager

Veeam Backup Enterprise Manager is an optional component intended for distributed enterprise environments with multiple backup servers. Veeam Backup Enterprise Manager federates backup servers and offers a consolidated view of these servers through a web browser interface. You can centrally control and manage all jobs through a single "pane of glass", edit and clone jobs, monitor job state and get reporting data across all backup servers. Veeam Backup Enterprise Manager also enables you to search for VM guest OS files in all current and archived backups across your backup infrastructure, and restore these files in one click.

Veeam Backup Enterprise Manager can be installed on a physical or virtual machine. You can deploy it on the backup server or use a dedicated machine.

Veeam Backup Enterprise Manager uses the following services and components:
  • Veeam Backup Enterprise ManagerService coordinates all operations of Veeam Backup Enterprise Manager, aggregates data from multiple backup servers and provides control over these servers.
  • Veeam Backup Enterprise Manager Configuration Database is used by Veeam Backup Enterprise Manager for storing data. The database instance can be located on a SQL Server installed either locally (on the same machine as Veeam Backup Enterprise Manager Server) or remotely.
  • Veeam Guest Catalog Service replicates and consolidates VM guest OS file system indexing data from backup servers added to Veeam Backup Enterprise Manager. Index data is stored in Veeam Backup Enterprise Manager Catalog (a folder on the Veeam Backup Enterprise Manager Server) and is used to search for VM guest OS files in backups created by Veeam Backup & Replication.

 

Veeam Backup Search

By default, Veeam Backup & Replication uses its proprietary file indexing mechanism to index VM guest OS files and let you search for them in backups with Veeam Backup Enterprise Manager. Using Veeam's proprietary mechanism is the best practice. However, you have an option to engage the Veeam Backup Search component and Microsoft Search Server in the indexing process.

To use Veeam Backup Search, you should install the Veeam Backup Search component from the installation package on a machine running Microsoft Search Server. The Veeam Backup Search server runs the MOSS Integration Service that invokes updates of index databases on Microsoft Search Server. The service also sends search queries to Microsoft Search Server which processes them and returns necessary search results to Veeam Backup Enterprise Manager.

 

Deployment Scenarios

Veeam Backup & Replication can be used in virtual environments of any size and complexity. The architecture of the solution supports onsite and offsite data protection, operations across remote sites and geographically dispersed locations. Veeam Backup & Replication provides flexible scalability and easily adapts to the needs of your virtual environment.

Before installing Veeam Backup & Replication, familiarize yourself with common deployment scenarios and carefully plan your backup infrastructure layout.
In This Section
  • Simple Deployment
  • Advanced Deployment
  • Distributed Deployment

 

Simple Deployment

In a simple deployment scenario, one instance of Veeam Backup & Replication is installed on a physical or virtual Windows-based machine. This installation is referred to as a backup server.

Simple deployment implies that the backup server performs the following:
  • It functions as a management point, coordinates all jobs, controls their scheduling and performs other administrative activities.
  • It is used as the default backup repository. During installation, Veeam Backup & Replication checks volumes of the machine on which you install the product and identifies a volume with the greatest amount of free disk space. On this volume, Veeam Backup & Replication creates the Backup folder that is used as the default backup repository.
  • It is used as a mount server and guest interaction proxy.
In this scenario, source Hyper-V servers act as backup proxies, handling job processing and transferring backup traffic directly to the target. All necessary backup proxy services are installed on source Hyper-V servers.

Simple Deployment

If you plan to back up and replicate only a small number of VMs or evaluate Veeam Backup & Replication, this configuration is enough to get you started. Veeam Backup & Replication is ready for use right out of the box — as soon as it is installed, you can start using the solution to perform backup and replication operations. To balance the load of backing up and replicating your VMs, you can schedule jobs at different times.

Simple DeploymentTip:
If you decide to use a simple deployment scenario, you can install Veeam Backup & Replication right on the Hyper-V host where VMs you want to work with reside. However, to use this Hyper-V host as the source for backup and replication, you will still need to add it to the Veeam Backup & Replication console.

In Hyper-V environments that require a large number of backup or replication activities performed, the simple deployment scheme is not appropriate due to the following reasons:
  • The backup server might not have enough disk capacity to store the required amount of backup data.
  • A significant load is placed on production servers that combine the roles of backup proxies and source hosts.
To take the overhead off the backup server and source Hyper-V servers, you can use the advanced deployment scenario.

 

Advanced Deployment

For mid-size and large-scale Hyper-V environments with a great number of backup and replication jobs, the advanced deployment scenario can be a good choice.

The advanced deployment includes the following components:
  • Virtual infrastructure servers — Hyper-V hosts used as source and target for backup and replication.
  • Backups server — a configuration and control center of the backup infrastructure.
  • Off-host backup proxy — a “data mover” component used to retrieve VM data from the source datastore, process it and deliver to the target.
  • Backup repository — a location used to store backup files and auxiliary replica files.
  • Dedicated mount servers — component required for VM guest OS files and application items restore to the original location.
  • Dedicated guest interaction proxies — components used to deploy the runtime process in Microsoft Windows VMs.
In the advanced deployment scenario, data processing is shifted from the Hyper-V server to an off-host backup proxy — a dedicated machine that is deployed on the source side, closer to the source Hyper-V host. The off-host backup proxy functions as a “data mover”, processing VM data and mediating the backup traffic from source to target. Therefore, the job processing overhead and data transport is offloaded from the source Hyper-V host.

In the advanced deployment scenario, backup data is no longer stored to the backup repository on the backup server. Instead, data is transported to dedicated backup repositories. The backup server becomes a “manager” for off-host backup proxies and backup repositories.


Advanced Deployment
With the advanced deployment scenario, you can expand your backup infrastructure horizontally in a matter of minutes to meet your data protection requirements. Instead of growing the number of backup servers or constantly tuning job scheduling, you can install multiple backup infrastructure components and distribute the backup workload among them. The installation process is fully automated, which simplifies deployment and maintenance of the backup infrastructure in your virtual environment.

In virtual environments with several proxies, Veeam Backup & Replication dynamically distributes the backup traffic among these proxies. A job can be explicitly mapped to a specific proxy. Alternatively, you can let Veeam Backup & Replication choose an off-host backup proxy.

In this case, Veeam Backup & Replication will check settings of available backup proxies and select the most appropriate one for the job. The backup proxy should have access to the source and target hosts, and to backup repositories to which files will be written.

To regulate the backup load, you can specify the maximum number of concurrent tasks per backup proxy and set up throttling rules to limit the proxy bandwidth. For a backup repository, you can set the maximum number of concurrent tasks and define a combined data rate.

 

Distributed Deployment

The distributed deployment scenario is recommended for large geographically dispersed virtual environments with multiple backup servers installed across different sites. These backup servers are federated under Veeam Backup Enterprise Manager — an optional component that provides centralized management and reporting for these servers through a web interface.

Distributed Deployment
Veeam Backup Enterprise Manager collects data from backup servers and enables you to run backup and replication jobs across the entire backup infrastructure through a single "pane of glass", edit them and clone jobs using a single job as a template. It also provides reporting data for various areas (for example, all jobs performed within the last 24 hours or 7 days, all VMs engaged in these jobs and so on). 

Using indexing data consolidated on one server, Veeam Backup Enterprise Manager provides advanced capabilities to search for VM guest OS files in VM backups created on all backup servers (even if they are stored in repositories on different sites), and recover them in a single click. Search for VM guest OS files is enabled through Veeam Backup Enterprise Manager itself; to streamline the search process, you can optionally deploy a Veeam Backup Search server in your backup infrastructure.

With flexible delegation options and security roles, IT administrators can delegate the necessary file restore or VM restore rights to authorized personnel in the organization – for example, allow database administrators to restore Oracle or SQL server VMs.

If you use Veeam Backup Enterprise Manager in your backup infrastructure, you do not need to install licenses on every backup server you deploy. Instead, you can install one license on the Veeam Backup Enterprise Manager server and it will be applied to all servers across your backup infrastructure. This approach simplifies tracking license usage and license updates across multiple backup servers.

 

Resource Scheduling

With its built-in mechanism of resource scheduling, Veeam Backup & Replication is capable to automatically select and use optimal resources to run configured jobs. Resource scheduling is performed by the Veeam Backup Service running on the backup server. When a job starts, it communicates with the service to inform it about the resources it needs. The service analyzes job settings, parameters specified for backup infrastructure components, current load on the components, and automatically allocates optimal resources to the job.

For resource scheduling, Veeam Backup Service uses a number of settings and features:
In This Section
  • Network Traffic Throttling and Multithreaded Data Transfer
  • Limiting the Number of Concurrent Tasks
  • Limiting Read and Write Data Rates for Backup Repositories
  • Detecting Performance Bottlenecks
  • Data Processing Modes

 

Network Traffic Throttling and Multithreaded Data Transfer

To limit the impact of Veeam Backup & Replication tasks on network performance, you can throttle network traffic for jobs. Network traffic throttling prevents jobs from utilizing the entire bandwidth available in your environment and makes sure that enough traffic is provided for other network operations. It is especially recommended that you throttle network traffic if you perform offsite backup or replicate VMs to a DR site over slow WAN links.

Network traffic throttling is implemented through rules. Network throttling rules apply to components in the Veeam backup infrastructure, so you do not have to make any changes to the network infrastructure.

Network traffic throttling rules are enforced globally, at the level of the backup server. Every rule limits the maximum throughput of traffic going between backup infrastructure components on which Veeam Data Mover Services are deployed. Depending on the scenario, traffic can be throttled between the following components:
  • Backup to a Microsoft Windows or Linux backup repository: a backup proxy (onhost or offhost) and backup repository
  • Backup to an SMB share, EMC Data Domain and HPE StoreOnce: backup proxy (onhost or offhost) and gateway server
  • Backup copy: source and target backup repositories or gateway sever(s), or WAN accelerators (if WAN accelerators are engaged in the backup copy process)
  • Replication: source and target backup proxies (onhost or offhost) or WAN accelerators (if WAN accelerators are engaged in the replication process)
  • Backup to tape: backup repository and tape server
Rules are set for a pair of IP address ranges and are applied to the source and target components between which data is transferred over the network. The range can include a single IP address.

When a new job starts, Veeam Backup & Replication checks network traffic throttling rules against a pair of components assigned for the job. If the source and target IP addresses fall into specified IP ranges, the rule is applied. For example, if for a network traffic throttling rule you specify 192.168.0.1 – 192.168.0.255 as the source range and 172.16.0.1 – 172.16.0.255 as the target range, and the source component has IP address 192.168.0.12, while the target component has IP address 172.16.0.31, the rule will be applied. The network traffic going from source to target will be throttled.

Network Traffic Throttling and Multithreaded Data Transfer

Network Traffic Throttling and Multithreaded Data TransferNote:
Throttling rules are reversible — they function in two directions. If the IP address of the component on the source side falls into the target IP range, and the IP address of the component on the target side falls into the source IP range, the rule will be applied in any case. 

Veeam Backup & Replication equally splits available bandwidth between all jobs that use backup infrastructure components to which a network throttling rule applies. For example, if you run one job that uses a pair of backup infrastructure components to which the rule applies, the job will get the entire bandwidth allowed by the rule. If you run two jobs at a time, the allowed bandwidth will be equally split between them. As soon as one of the jobs completes, the bandwidth assigned to it will be freed, and the remaining job will use the entire bandwidth allowed by the rule.

Network Traffic Throttling and Multithreaded Data Transfer

Throttling rules can be scheduled to only be active during specific time intervals (for example, during business hours). This way, you can minimize the impact of job performance spikes on the production network. Alternatively, you can select to apply throttling rules regardless of the time.

Multithreaded Data Transfer
In addition to traffic throttling, Veeam Backup & Replication offers another possibility for network traffic management — management of data transfer connections. Normally, within one backup session Veeam Backup & Replication opens five parallel TCP/IP connections to transfer data from source to target. Multithreaded data transfer increases the transfer speed but can place additional load on the network.

If required, you can disable multithreaded data transfer and limit the number of connections per session to one.

Network Traffic Throttling and Multithreaded Data TransferNote:
Veeam Backup & Replication performs a CRC check for the TCP traffic going between the source and the target. When you perform backup and replication operations, Veeam Backup & Replication calculates checksums for data blocks going from the source. On the target, it re-calculates checksums for received data blocks and compares them to the checksums created on the source. If the CRC check fails, Veeam Backup & Replication automatically re-sends data blocks without any impact on the job.

 

Limiting the Number of Concurrent Tasks

To avoid overload of backup proxies and backup repositories, Veeam Backup & Replication allows you to limit the number of concurrent tasks performed on a backup proxy (either on-host or off-host) or targeted at a backup repository.

Before processing a new task, Veeam Backup & Replication detects what backup infrastructure components (backup proxies and repositories) will be involved. When a new job starts, Veeam Backup & Replication analyzes the list of VMs that the job includes, and creates a separate task for each disk of every VM to be processed. Tasks in the job can be processed in parallel (that is, VMs and VM disks within a single job can be processed simultaneously), optimizing your backup infrastructure performance and increasing the efficiency of resource usage.

Limiting the Number of Concurrent TasksNote:
To use this capability, proxy server(s) should meet system requirements – each task requires a single CPU core, so for two tasks to be processed in parallel, 2 cores is the recommended minimum. Parallel VM processing must also be enabled in Veeam Backup & Replication options.

Task limiting is performed by the Veeam Backup Service that is aware of all backup proxies and backup repositories connected to it, and settings specified for these backup proxies and repositories (namely, the number of allowed concurrent tasks).

When a job starts, it informs the Veeam Backup Service about its task list and polls the service about allocated resources to its tasks at a 10 second interval after that. Before a new task targeted at a specific backup proxy or repository starts, the Veeam Backup Service checks the current workload (the number of tasks currently working with the proxy or repository) and the number of allowed tasks per this component. If this number is exceeded, a new task will not start until one of the currently running tasks is finished.

 

Limiting Read and Write Data Rates for Backup Repositories

Veeam Backup & Replication can limit the speed with which Veeam Backup & Replication must read and write data to/from the backup repository. The data read and write speed is controlled with the Limit read and write data rates to MB/s option that you can enable in the backup repository settings.

Limiting Combined Rate for Backup Repositories

The Veeam Backup Service is aware of read and write data rate settings configured for all backup repositories in the backup infrastructure. When a job targeted at a backup repository starts, the Veeam Backup Service informs the Veeam Data Mover Service running on this backup repository about the allowed read/write speed set for this repository so that the Veeam Data Mover Service can limit the read/write speed to the specified value.

If the backup repository is used by a number of tasks simultaneously, Veeam Backup & Replication splits the allowed read/write speed rate between these tasks equally. Note that the specified limit defines the allowed read speed and the allowed write speed at the same time.

For example, you set the Limit read and write data rates to option to 8 MB/s and start two backup jobs. Each job processes 1 VM with 1 VM disk. In this case, Veeam Backup & Replication will create 2 tasks and target them at the backup repository. The data write rate will be split between these 2 tasks equally: 4 MB/s for one task and 4 MB/s for the other task.

If at this moment you start some job reading data from the same backup repository, for example, a backup copy job, Veeam Backup & Replication will assign the read speed rate equal to 8 MB/s to this job. If you start 2 backup copy jobs at the same time, Veeam Backup & Replication will split the read speed rate between these 2 jobs equally: 4 MB/s for one backup copy job and 4 MB/s for the other backup copy job.

 

Detecting Performance Bottlenecks

As any backup application handles a great amount of data, it is important to make sure the data flow is efficient and all resources engaged in the backup process are optimally used. Veeam Backup & Replication provides advanced statistics about the data flow efficiency and lets you identify bottlenecks in the data transmission process.

Veeam Backup & Replication processes VM data in cycles. Every cycle includes a number of stages:
  1. Reading VM data blocks from the source
  2. Processing VM data on the backup proxy
  3. Transporting data over the network
  4. Writing data to the target
When one data processing cycle is over, the next cycle begins. VM data therefore goes over the “data pipe”.

Detecting Performance Bottlenecks

To evaluate the data pipe efficiency, Veeam Backup & Replication analyzes performance of all components in the data flow working as the cohesive system, and evaluates key factors on the source and target sides. Veeam Backup & Replication checks the following points in the data pipe:
  1. Source— source disk reader component responsible for retrieving data from the source storage.
  2. Proxy— backup proxy component responsible for processing VM data.
  3. Source WAN accelerator— WAN accelerator deployed on the source side. Used for backup copy and replication jobs working via WAN accelerators.
  4. Network— network queue writer component responsible for getting processed VM data from the backup proxy and sending it over the network to the backup repository or another backup proxy.
  5. Target WAN Accelerator— WAN accelerator deployed on the target side. Used for backup copy and replication jobs working via WAN accelerators.
  6. Target— target disk writer component (backup storage or replica datastore).
The resource usage level for these points is evaluated in percent. This percent rate defines the amount of time for which components are busy during the job. An efficient data flow assumes that there is no latency at any point of the data pipe, and all its components work for approximately equal amount of time.

If any of the components operates inefficiently, there may appear a bottleneck in the data path. The insufficient component will work 100% of time while the others will be idling, waiting for data to be transferred. As a result, the whole data flow will slow down to the level of the slowest point in the data path, and the overall time of data processing will increase.

To identify a bottleneck in the data path, Veeam Backup & Replication detects the component with the maximum workload: that is, the component that works for the most time of the job. For example, you use a low-speed storage device as the backup repository. Even if VM data is retrieved from the SAN storage on the source side and transported over a high-speed link, VM data flow will still be impaired at the backup repository.

The backup repository will be trying to consume transferred data at the rate that exceeds its capacity, and the other components will stay idle. As a result, the backup repository will be working 100% of job time, while other components may be employed, for example, for 60% only. In terms of Veeam Backup & Replication, such data path will be considered insufficient.

The bottleneck statistics for a job is displayed in the job session data. The bottleneck statistics does not necessarily mean that you have a problem in your backup infrastructure. It simply informs you about the weakest component in the data path. However, if you feel that the job performance is low, you may try taking some measures to get rid of the bottleneck. For example, in the case described above, you can limit the number of concurrent tasks for the backup repository.

Detecting Performance Bottlenecks 

Throttling as Bottleneck
In addition to main points in the data pipe, Veeam Backup & Replication may report throttling as a bottleneck. This can happen in the following cases:
  • If you limit the read and write data rates for a backup repository, a backup repository may become a bottleneck. Veeam Backup & Replication will report Throttling in the bottleneck statistics.
  • If you set up network throttling rules, network may become a bottleneck. Veeam Backup & Replication will report Throttling in the bottleneck statistics.

 

Data Processing Modes

Veeam Backup & Replication can process VMs in the job and VM disks in parallel or sequentially. The data processing mode is a global setting: it takes effect for all jobs configured on the backup server.

Parallel Data Processing
By default, Veeam Backup & Replication works in the parallel data processing mode. If a job includes several VMs or VMs in the job have several disks, VMs and VM disks are processed concurrently.

Parallel data processing optimizes the backup infrastructure performance and increases efficiency of resource usage. It also reduces the time of VM snapshots being open and mitigates the risk of long snapshot commit.

Data Processing Modes

If you choose to process VM data in parallel, check task limitation settings for components in your backup infrastructure and make sure that these components have sufficient compute resources to support parallel processing. 

Task limitation settings define the number of tasks that the backup infrastructure component can perform concurrently, or at the same moment. The maximum number of concurrent tasks that a backup proxy or repository can perform depends on the number of CPU cores available on this backup proxy or backup repository. It is strongly recommended that you assign task limitation settings using the following rule: 1 task = 1 CPU core. For example, if a backup proxy has 4 CPU cores, it is recommended that you limit the number of concurrent tasks for this backup proxy to 4.

Task limits specified for backup proxies and backup repositories influence the job performance. For example, you add a VM with 4 disks to a job and target this job at the backup proxy that can process maximum 2 tasks concurrently. In this case, Veeam Backup & Replication will create 4 tasks (1 task per each VM disk) and start processing 2 tasks in parallel. The other 2 tasks will be pending.


Data Processing ModesNote:
When you limit the number of tasks for the backup repository, you should also consider the storage throughput. If the storage system is not able to keep up with the number of tasks that you have assigned, it will be the limiting factor. It is recommended that you test components and resources of your backup infrastructure to define the workload that they can handle.







Data Processing Modes

Subsequent Data Processing
If you do not want to use parallel data processing, you can disable it. In this case, Veeam Backup & Replication will process VMs and VM disks in the job one by one, sequentially.
Even if you disable parallel data processing, backup proxies and backup repositories can still process tasks from different jobs in parallel. For example:
  1. You set up the backup proxy to process 2 tasks simultaneously.
  2. You configure 2 backup jobs, each processing 1 VM with 1 disk.
When you start backup jobs, Veeam Backup & Replication will create 2 tasks and assign these tasks to the backup proxy. The backup proxy will perform these tasks in parallel.

 

Backup

Unlike traditional backup tools designed to work with physical machines, Veeam Backup & Replication is built specifically for virtual environments. It operates at the virtualization layer and uses an image-based approach for VM backup. To retrieve VM data, no agent software needs to be installed inside the guest OS. Instead, Veeam Backup & Replication leverages VSS snapshot capabilities. When a new backup session starts, a VSS snapshot is taken to create a cohesive point-in-time copy of a VM including its configuration, OS, applications, associated data, system state and so on. Veeam Backup & Replication uses this point-in-time copy to retrieve VM data. Image-based backups can be used for different types of recovery, including Instant VM Recovery, full VM recovery, VM file recovery and file-level recovery.

Use of the image-based approach allows Veeam Backup & Replication to overcome shortfalls and limitations of traditional backup (such as, the necessity to provide guest OS credentials for every VM, significant resource overhead on the VM and hypervisor during the backup process, management overhead and so on). It also helps streamline the restore process — to recover a single VM, there is no need to perform multiple restore operations. Veeam Backup & Replication uses a cohesive VM image from the backup to restore a VM to the required state without the necessity for manual reconfiguration and adjustment.

In Veeam Backup & Replication, backup is a job-driven process where one backup job can be used to process one or more VMs. A job is a configuration unit of the backup activity. Essentially, the job defines when, what, how and where to back up. It indicates what VMs should be processed, what components should be used for retrieving and processing VM data, what backup options should be enabled and where to save the resulting backup file. Jobs can be started manually by the user or scheduled to run automatically.

The resulting backup file stores compressed and deduplicated VM data. All backup files created by the job are located in a dedicated job folder on a backup repository. Veeam Backup & Replication creates and maintains the following types of backup files:
  • Full backup (.vbk) to store copies of full VM images
  • Backup increment (.vib or .vrb) to store incremental changes to VM images
  • Backup metadata (.vbm) to provide information on the backup job, VMs in the backup, number and structure of backup files, restore points, and so on. The metadata file facilitates import of backups or mapping of backup jobs to existing backups.
To back up VMs, you can use one of three available methods:
  • Foverver forward incremental backup
  • Forward incremental backup
  • Reverse incremental backup
Regardless of the method you use, the first run of a job creates a full backup of VM image. Subsequent job runs are incremental — Veeam Backup & Replication copies only those data blocks that have changed since the last backup job run. To keep track of changed data blocks, Veeam Backup & Replication uses its proprietary changed block tracking mechanism.
In This Section
  • Backup of VMs on Local Storage and CSV
  • Backup of VMs on SMB3
  • Backup Architecture
  • Backup Methods
  • Retention Policy
  • Per-VM Backup Files
  • Changed Block Tracking
  • Data Compression and Deduplication
  • Data Exclusion
  • Transaction Consistency
  • Guest Processing
  • Job Scheduling
  • VeeamZIP
  • Quick Backup
  • Health Check for Backup Files
  • Compact of Full Backup File

 

Backup of VMs on Local Storage and CSV

Veeam Backup & Replication performs backup of Hyper-V VMs whose disks are located on the local storage and Cluster Shared Volume (CSV). In contrast to traditional backup tools that deploy an agent inside the VM guest OS and back up from within a VM, Veeam Backup & Replication uses a Veeam Data Mover Service running on the Hyper-V host or a Veeam Data Mover Service running on the off-host backup proxy. A VM is treated as an object from the perspective of the Hyper-V host — Veeam Backup & Replication captures the VM configuration and state along with VM VHD/VHDX's and creates an image-based backup of a VM.

To perform backup of Hyper-V VMs, Veeam Backup & Replication leverages the VSS framework and Hyper-V VSS components. It acts as a VSS requestor and communicates with the VSS framework. Veeam Backup & Replication obtains from VSS information about available VSS components, prescribes what components should be used, identifies volumes where files of the necessary VMs are located and triggers the VSS coordinator to create volume snapshots.

Before a snapshot of a volume is created, VMs on the volume must be prepared for the snapshot — that is, data in the VM must be in a state suitable for backup. Veeam Backup & Replication uses three methods to quiesce Hyper-V VMs on the volume: online backup, offline backup and crash-consistent backup.
Whenever possible, Hyper-V VSS uses online backup to quiesce VMs. If online backup cannot be performed, one of the other two methods is used to prepare a VM for a volume snapshot.
  • If online backup is not possible, Veeam Backup & Replication will fail over to the crash-consistent backup.
  • If you do not want to produce a crash-consistent backup, you can configure your backup jobs to use the offline backup method instead.
Backup of VMs on Local Storage and CSVNote:
Veeam Backup & Replication does not fail over to the crash-consistent backup mode if you enable application-aware processing for a job and select the Require successful processing option. In such situation, if application-aware processing fails, Veeam Backup & Replication will simply terminate the job with the Error status.

 

Online Backup

Online backup is the recommended backup method for Hyper-V VMs. This type of backup requires no downtime — VMs remain running for the whole period of backup and users can access them without any interruption. Online backup can only be performed if a VM meets a number of conditions: the VM runs under a VSS-aware guest OS, Hyper-V Integration Services are installed inside the guest OS, the backup integration is enabled, and some other requirements. For a complete list of conditions required for online backup, refer to Microsoft Hyper-V documentation.

For online backup, Veeam Backup & Replication uses a native Hyper-V approach. To quiesce VM data, Hyper-V uses two VSS frameworks that work at two different levels and communicate with each other:
  • The VSS framework at the level of the Hyper-V host. This VSS framework is responsible for taking a snapshot of the volume on which VMs are located (this snapshot is also called external snapshot).
  • The VSS framework inside the VM guest OS. This VSS framework is responsible for quiescing data of VSS-aware applications running inside the VM and creating a snapshot inside the guest OS (this snapshot is also called internal snapshot).
Online backup includes the following steps:
  1. Veeam Backup & Replication interacts with the Hyper-V host VSS Service and requests backup of specific VMs.
  2. The VSS Writer on the Hyper-V host passes the request to the Hyper-V Integration Components (HV-IC) installed inside the VM guest OS.
  3. The HV-IC, in its turn, acts as a VSS Requestor for the VSS framework inside the VM — it communicates with the VSS framework installed in the VM guest OS and requests backup of VSS-aware applications running inside this VM.
  4. The VSS Writers within the VSS-aware applications inside the guest OS are instructed to get the application data to a state suitable for backup.
  5. After the applications are quiesced, the VSS inside the VM takes an internal snapshot within the VM using a VSS software provider in the VM guest OS.
  6. After the internal snapshot is taken, the VM returns from the read-only state to the read-write state and operations inside the VM are resumed. The created snapshot is passed to the HV-IC.
  7. The HV-IC notifies the hypervisor that the VM is ready for backup.
  8. The Hyper-V host VSS provider takes a snapshot of a volume on which the VM is located (external snapshot).
  9. The volume snapshot is presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM files from the volume snapshot using one of two backup modes — on-host backup or off-host backup. After the backup is completed, the snapshot is deleted.
Online Backup
Internal and external snapshots are taken one after another, with a little time difference. During this time interval, the VM on the volume is not frozen – its applications and OS are working as usual. For this reason, when the external snapshot is created, there may remain unfinished application transactions inside the VM, and this data can be lost during backup.

To make sure the VM data is consistent at the moment of backup, Hyper-V VSS Writer performs additional processing inside the created external snapshot — this process is also known as auto-recovery.
Auto-recovery is performed when a volume snapshot is taken. This process includes the following steps:
  1. Right after the snapshot of a volume is taken, Hyper-V host VSS allows the Hyper-V host VSS Writer time to update data inside the external snapshot before it is permanently changed to the read-only state.
  2. The Hyper-V host VSS Writer rolls back a VM on the external snapshot to the state of the internal snapshot. All changes that took place after the internal snapshot was taken are discarded – this way, VM data inside the external snapshot is brought to a completely consistent state suitable for backup. At the same time, the internal snapshot inside the VM guest OS is deleted.
  3. As a result, you have a VM on the production volume, and a consistent volume snapshot that Veeam Backup & Replication uses for backup.
Online BackupNote:
Auto-recovery may take up to several minutes.

Offline Backup

Offline backup (or backup via saved state) is another native Hyper-V approach to quiescing VMs before taking a volume snapshot. This type of backup requires some downtime of a VM. When a VM is backed up, the Hyper-V VSS Writer forces the VM into the saved state to create a stable system image.
Offline backup is performed in the following way:
  1. Veeam Backup & Replication interacts with the Hyper-V host VSS Services and requests backup of specific VMs.
  2. The Hyper-V host VSS Writer forces a VM into the saved state for several seconds. The VM OS hibernates and the content of the system memory and CPU is written to a dump file.
  3. The Hyper-V host VSS provider takes a snapshot of a volume on which the VM is located. After the snapshot is created, the VM returns to the normal state.
  4. The volume snapshot is presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM files from the volume snapshot using one of two backup modes — on-host backup or off-host backup. After the backup is completed, the snapshot is deleted.
Offline backup may be inappropriate — it incurs downtime to a VM and does not produce transactionally consistent backups and replicas as Veeam Backup & Replication does not interact with the VSS framework on the VM guest OS during backup or replication. As an alternative to offline backup, Veeam Backup & Replication offers the crash-consistent backup method for those cases when online backup is not possible and offline backup is unsuitable.

Offline Backup

 

Crash-Consistent Backup

Crash-consistent backup is Veeam’s method of creating crash-consistent VM images. A crash-consistent image can be compared to the state of a VM that has been manually reset. Unlike offline backup, crash-consistent backup does not involve any downtime.


Crash-Consistent BackupImportant!
Crash-consistent backup does not preserve data integrity of open files of transactional applications on the VM guest OS and may result in data loss.


Crash-consistent backup is performed in the following way:
  1. Veeam Backup & Replication interacts with the Hyper-V host VSS Services and requests backup of specific VMs.
  2. The Hyper-V host VSS Writer notifies the VSS provider that volume snapshots can be taken.
  3. The Hyper-V host VSS provider creates a snapshot of the requested volume.
  4. The volume snapshot is presented to Veeam Backup & Replication. Veeam Backup & Replication reads VM files from the volume snapshot using one of two backup modes — on-host backup or off-host backup. After the backup is completed, the snapshot is deleted.
Crash-Consistent Backup

 

Backup Modes

Veeam Backup & Replication offers two modes for processing volume shadow copies – on-host backup and off-host backup. The difference between the two modes lies in the location where VM data is processed.

In This Section
  • On-Host Backup
  • Off-Host Backup

 

On-Host Backup

During on-host backup, VM data is processed on the source Hyper-V host where VMs you want to back up or replicate reside. All processing operations are performed directly on the source Hyper-V host. For this reason, on-host backup may result in high CPU usage and network overhead on the host system.

The on-host backup process includes the following steps:
  1. Veeam Backup & Replication triggers a snapshot of the necessary volume.
  2. The Veeam Data Mover Service uses the created volume snapshot to retrieve VM data; it processes the VM data and copies it to the destination.
  3. Once the backup process is complete, the volume snapshot is deleted.
On-Host Backup

Assigning the Role of the On-Host Backup Proxy in CSV

In Veeam Backup & Replication, the role of the backup proxy is assigned to the Hyper-V host in CSV by the following rules:
  • In case you perform backup or replication of VMs whose disks are located on the CSV in Microsoft Windows Server 2012 or Microsoft Windows Server 2012 R2 and Microsoft CSV Software Shadow Copy Provider is used for snapshot creating, Veeam Backup & Replication assigns the role of the on-host backup proxy to the Hyper-V host owning the CSV. If VM disks are located on different CSV's, Veeam Backup & Replication may use several on-host backup proxies, which are the corresponding Hyper-V hosts owning the CSV's.
  • In case you perform backup or replication of VMs whose disks are located on the CSV in Microsoft Windows 2008R2 and a VSS software or hardware provider is used for snapshot creation, Veeam Backup & Replication assigns the role of the on-host backup proxy to the Hyper-V host on which the processed VM is registered.

 

Off-Host Backup

In the off-host backup mode, backup processing is shifted from the source Hyper-V host to a dedicated machine – an off-host backup proxy. The off-host backup proxy acts as a “data mover”– the Veeam Data Mover Service running on it retrieves VM data from the source datastore, processes it and transfers to the destination. This type of backup does not impose load on the Hyper-V host — while resource intensive backup operations are performed on the off-host backup proxy, production hosts remain unaffected.

To perform off-host backup, Veeam Backup & Replication uses transportable shadow copies. The transportable shadow copy technology enables you to create a snapshot of a data volume on one server and import, or mount, it onto another server within the same subsystem (SAN) for backup and other purposes. The transport process is accomplished in a few minutes, regardless of the amount of the data.

The process is performed at the SAN storage layer so it does not impact the host CPU usage or network performance.

To be able to perform off-host backup, you must meet the following requirements:
  1. You must configure an off-host backup proxy. The role of an off-host backup proxy can be assigned only to a physical Microsoft Windows 2008 Server R2 machine with the Hyper-V role enabled, Microsoft Windows Server 2012 machine with the Hyper-V role enabled or Microsoft Windows Server 2012 R2 machine with the Hyper-V role enabled.
Note that the version of the Hyper-V host and off-host backup proxy must coincide. For example, if you use a Microsoft Windows 2008 Server R2 machine with the Hyper-V role enabled as a Hyper-V host, you should deploy the off-host backup proxy on a Microsoft Windows 2008 Server R2 machine with the Hyper-V role enabled.

For evaluation and testing purposes, you can assign the off-host backup proxy role to a VM. To do this, you must enable the Hyper-V role on this VM (use nested virtualization). However, it is not recommended that you use such off-host backup proxies in the production environment.
  1. In the properties of a backup or replication job, the off-host backup method must be selected. If necessary, you can point the job to a specific proxy.
  2. The source Hyper-V host and the off-host backup proxy must be connected (through a SAN configuration) to the shared storage.
  3. To create and manage volume shadow copies on the shared storage, you must install and properly configure a VSS hardware provider that supports transportable shadow copies on the off-host proxy and Hyper-V host. Typically, when configuring a VSS hardware provider, you need to specify a server controlling the LUN and disk array credentials to provide access to the array.
The VSS hardware provider is usually distributed as a part of client components supplied by the storage vendor. Any VSS hardware provider certified by Microsoft is supported. Note that some storage vendors may require additional software and licensing to be able to work with transportable shadow copies.
  1. If you back up VMs whose disks reside on a CSV with Data Deduplication enabled, make sure that you use a Microsoft Windows 2012 R2 machine as an off-host backup proxy and enable the Data Deduplication option on this off-host backup proxy. Otherwise, off-host backup will fail.
The off-host backup process includes the following steps:
  1. Veeam Backup & Replication triggers a snapshot of the necessary volume on the production Hyper-V host.
  2. The created snapshot is split from the production Hyper-V server and mounted to the off-host backup proxy.
  3. The Veeam Data Mover Service running on a backup proxy uses the mounted volume snapshot to retrieve VM data; the VM data is processed on the proxy server and copied to the destination.
  4. Once the backup process is complete, the snapshot is dismounted from the off-host backup proxy and deleted on the SAN.
Off-Host BackupImportant!
If you plan to perform off-host backup for a Hyper-V cluster with CSV, make sure you deploy an off-host backup proxy on a host that is NOT a part of a Hyper-V cluster.
When a volume snapshot is created, this snapshot has the same LUN signature as the original volume. Microsoft Cluster Services do not support LUNs with duplicate signatures and partition layout. For this reason, volume snapshots must be transported to an off-host backup proxy outside the cluster. If the off-host backup proxy is deployed on a node of a Hyper-V cluster, a duplicate LUN signature will be generated, and the cluster will fail during backup or replication.

Off-Host Backup

 

Choosing a VSS Provider

Before you configure backup jobs, it is recommended to decide on the VSS provider that will be used to create and maintain volume shadow copies.

By default, Veeam Backup & Replication automatically selects a VSS provider on every volume. Every 4 hours it rescans all managed Hyper‑V hosts to update information on connected volumes.

Veeam Backup & Replication also collects information on software and hardware VSS providers available on every volume. If hardware providers are available, Veeam Backup & Replication will select a hardware provider. If no hardware providers are installed, the VSS system software provider will be selected to create and manage shadow copies on a volume. If necessary, however, you can assign a VSS provider on every volume manually.

If both software and hardware providers are available for a volume, it is recommended to select a hardware provider. Although software providers are generally applicable to a wider range of storage platforms, they are exposed to a number of limitations:
  • Software providers do not support transportable volume shadow copies and cannot be used for off-host backup.
  • By default, in Veeam Backup & Replication jobs working with the same volume can take up to 4 snapshots of a volume simultaneously. The number of snapshots can be increased.
  • Hardware providers work at the storage system controller level. Software providers operate at the software level, between the file system and the volume manager, and can cause a significant performance overhead on the source host.
  • (For Microsoft Windows 2008 R2) Hardware providers can work with several snapshots simultaneously: that is, if you have several jobs that work with the same volume, you can run them in parallel. If you use a software provider, Veeam Backup & Replication serializes VM processing. You will not be able to start several jobs working with the same volume simultaneously. The volume on which VM disks reside remains locked by one job for the whole period of data processing. Once the job completes, the volume becomes accessible for other jobs.
  • (For Microsoft Windows 2008 R2) Software providers are not suitable for backup on Cluster Shared Volumes (CSVs), because a significant backup window is required to back up VMs that reside on the same volume but are registered on different hosts. When a cluster node initiates a snapshot on a CSV, the CSV is switched to the Backup in Progress, Redirected Access mode.
  • If a hardware provider is used to take a snapshot in such case, the CSV stays in the redirected mode while the snapshot is taken; after a volume shadow copy is created, the CSV resumes direct I/O.
  • If a software provider is used to take a snapshot, the CSV stays in the redirected mode until the backup process completes. In cases when large virtual disks are processed, backup time can be significant.

Backup of VMs on SMB3

With Hyper-V 3.0, Microsoft provides the ability to store VM files on SMB3 file shares.

Veeam Backup & Replication introduces support for VM files residing on SMB3 shares and lets you perform backup, replication and file copy operations for such VMs without taking VMs offline. Veeam Backup & Replication works with both standalone and clustered SMB3 servers.

In general, VM quiescence and backup of VMs on SMB3 shares is similar to backup of VMs hosted on local storage and CSV. However, SMB3 brings in some specifics.

To be able to work with SMB3 shares in Veeam Backup & Replication, you must meet the following requirements:
  1. Make sure that your SMB3 shares are properly configured. For a full list of requirements for SMB3 shares, see the Requirements and supported configurations section at http://technet.microsoft.com/en-us/library/jj612865.aspx.
  2. Add the SMB3 server or SMB3 cluster hosting the necessary file shares to the Veeam Backup & Replication console. Otherwise Veeam Backup & Replication will not be able to use the changed block tracking mechanism for VMs residing on SMB3 shares.
  3. Make sure that VMs you plan to work with are not located on hidden shares or default shares like C$ or D$. When re-scanning SMB v3 file shares, Veeam Backup & Replication skips these types of shares.

 

Backup Process

For backup and replication of VMs that reside on SMB3 shares, Veeam Backup & Replication uses a native Hyper-V approach leveraging the Microsoft VSS framework. Veeam Backup & Replication acts as a VSS requestor: it communicates with the VSS framework and triggers a shadow copy of the necessary file share.

The Microsoft VSS components create a file share shadow copy and present it to

Veeam Backup & Replication, which uses the shadow copy for backup.

To properly quiesce VMs on SMB3 shares, Hyper-V uses three VSS frameworks. These frameworks work at the level of the Hyper-V host and at the level of the SMB3 file server and communicate with each other:
  1. VSS framework on the Hyper-V host (Hyper-V Host VSS). When Veeam Backup & Replication starts the backup process, it communicates directly with the VSS framework on the Hyper-V host where the VM is registered. The Hyper-V host VSS Service initiates creation of the file share shadow copy, freezes VM application writes and passes the request for shadow copy to the VSS for SMB File Shares framework. After the shadow copy is created, the Hyper-V host VSS Service returns a path to the shadow copy to Veeam Backup & Replication.
  2. VSS for SMB File Shares. This framework is Microsoft’s extension to its VSS framework. VSS for SMB File Shares provides application-consistent shadow copies of VMs on SMB3 network shares. To work with shadow copies of file shares, VSS for SMB File Shares uses two components:
  • File Share Shadow Copy Provider is a VSS provider for SMB3. The File Share Shadow Copy Provider is invoked on the Hyper-V host where the VM is registered. The provider uses VSS APIs to interact with the VSS requestor, File Share Shadow Copy Agent, and request creation of file shares shadow copies.
  • File Share Shadow Copy Agent is a VSS requestor for SMB3. The File Share Shadow Copy Agent is invoked on the SMB3 file server. The agent interacts with the local VSS framework on the SMB3 file server to create a shadow copy of the requested file share.
  1. Local VSS framework on the SMB3 file server. This framework is responsible creating a shadow copy of the volume on which the file share is located and exposing the shadow copy as a file share on the SMB3 server.
Backup Process 
Backup of VMs on SMB3 shares includes the following steps:
  1. Veeam Backup & Replication interacts with the Hyper-V host VSS Service and requests a shadow copy of the necessary file share.
  2. The Hyper-V host VSS Service sends a request to prepare a shadow copy to the Hyper-V host VSS Writer. The Hyper-V host VSS Writer flushes buffers and holds application writes on VMs.
  3. The Hyper-V host VSS Service sends a request for shadow copy creation to the File Share Shadow Copy Provider invoked on the Hyper-V host.
  4. The File Share Shadow Copy Provider relays the request to the File Share Shadow Copy Agent invoked on the SMB3 file server hosting the necessary file share.
  5. The File Share Shadow Copy Agent triggers a request for shadow copy creation to the local VSS on the SMB3 file server.
  6. The local VSS on the SMB3 file server uses the necessary shadow copy provider to create a shadow copy of the volume on which the necessary file share is located. The shadow copy is exposed as a file share on the SMB3 server. After that, application writes on VMs located on the original file share are resumed.
  7. The File Share Shadow Copy Agent returns a path to the shadow copy to the File Share Shadow Copy Provider.
  8. The File Share Shadow Copy Provider communicates this information to the Hyper-V host VSS Service.
  9. Veeam Backup & Replication retrieves information about the shadow copy properties from the Hyper-V host VSS Service.
  10. Veeam Backup & Replication uses the created shadow copy for backup. The Data Mover on the backup proxy (onhost or offhost) establishes a connection to the Data Mover on the Microsoft SMB3 server and reads CBT information from the Microsoft SMB3 server. The Data Mover on the backup proxy then retrieves VM data blocks from the shadow copy, compresses and deduplicates them, and passes to the Data Mover on the backup repository.
After backup is complete, the file share shadow copy is deleted.

Backup Process

 

Backup Modes

Veeam Backup & Replication offers two modes for processing VMs on SMB3 shares: on-host backup and off-host backup.

In This Section
  • On-Host Backup
  • Off-Host Backup

 

On-Host Backup

On-host backup of VMs on SMB3 shares is similar to on-host backup of VMs on local storage and CSV. During on-host backup, the Hyper-V VSS components, File Share Shadow Copy Provider and Veeam Data Mover Service are invoked on the source Hyper-V VSS host. The File Share Shadow Copy Agent is invoked on the SMB3 server. As a result, all data processing is accomplished directly on the source Hyper-V host and on the SMB3 server.

The on-host backup process includes the following steps:
  1. Veeam Backup & Replication triggers a shadow copy of the necessary file share. Microsoft VSS components invoked on the Hyper-V host and SMB3 server create a shadow copy of the volume on which the requested file share is located and expose the shadow copy as a file share on the SMB3 server.
  2. The Veeam Data Mover Service deployed on the Hyper-V host accesses the shadow copy file share exposed on the SMB3 server. Veeam Backup & Replication retrieves VM data from the shadow copy, processes the data and copies it to the destination.
  3. Once the backup process is complete, the shadow copy is deleted.
On-Host Backup

 

Off-Host Backup

In general, the main concept of off-host backup for VMs on SMB3 shares is similar to off-host backup of VMs on local storage or CSV. During off-host backup, the Hyper-V VSS processing operations are shifted from the source Hyper-V host to a dedicated machine — off-host backup proxy. The Veeam Data Mover Service is deployed on the off-host backup proxy, instead of the source Hyper-V host.

To be able to perform off-host backup, you must meet the following requirements:
  1. You must configure an off-host backup proxy. The role of an off-host backup proxy can be assigned only to a physical Microsoft Windows 2008 Server R2 machine with the Hyper-V role enabled, Microsoft Windows 2012 machine with the Hyper-V role enabled or Microsoft Windows 2012 R2 machine with the Hyper-V role enabled.
For evaluation and testing purposes, you can assign the off-host backup proxy role to a VM. To do this, you must enable the Hyper-V role on this VM (use nested virtualization). However, it is not recommended that you use such off-host backup proxies in the production environment.
  1. In the properties of a backup or replication job, you must select the off-host backup method. If necessary, you can assign the job to a specific proxy.
  2. The Local System account of the off-host backup proxy must have full access permissions on the SMB3 file share.
  3. The off-host backup proxy should be located in the same domain where the SMB3 server resides. Alternatively, the domain where the SMB3 server resides should be trusted by the domain in which the off-host backup proxy is located.
The off-host backup process includes the following steps:
  1. Veeam Backup & Replication triggers a shadow copy of the necessary file share. Microsoft VSS components invoked on the Hyper-V host and SMB3 server create a shadow copy of the volume on which the requested file share is located and expose the shadow copy as a file share on the SMB3 server.
  2. The Veeam Data Mover Service on the off-host backup proxy accesses the shadow copy on the SMB3 server. It retrieves VM data from the shadow copy, processes the VM data and copies it to the destination.
  3. Once the backup process is complete, the shadow copy is deleted.
Off-Host Backup

 

Backup Architecture

The backup infrastructure in a Hyper-V environment comprises the following components:
  • One or more source hosts with associated volumes
  • Off-host backup proxy server (optional)
  • One or more backup repositories
  • One or more guest interaction proxies (optional)
The source host and the backup repository produce two terminal points between which VM data is moved. Backup data is collected, transformed and transferred with the help of Veeam Data Mover Services. Veeam Backup & Replication uses a two-service architecture — one Veeam Data Mover Service interacts with the source host, and the other one interacts with the backup repository. The Veeam Data Mover Services communicate with each other and maintain a stable connection.

All backup infrastructure components engaged in the job make up a data pipe. VM data is moved over this data pipe block by block, so that processing of a single VM includes multiple processing cycles.

When a new backup session starts, Veeam Backup & Replication performs the following actions:
  1. Veeam Backup & Replication deploys the runtime process on VM guest OSes via the guest interaction proxy (for Microsoft Windows VMs) or backup server (for VMs with other OSes).
  2. The target-side Veeam Data Mover Service obtains the job instructions and communicates with the source-side Veeam Data Mover Service to begin data collection.
  3. After a VSS snapshot is created, the source-side Veeam Data Mover Service copies VM data from the volume shadow copy. While copying, the source-side Veeam Data Mover Service performs additional processing — it consolidates the content of virtual disks by filtering out zero-data blocks and blocks of swap files. During incremental job runs, the Veeam Data Mover Service retrieves only those data blocks that have changed since the previous job run (note that with changed block tracking enabled, the speed of incremental backup dramatically increases). Copied blocks of data are compressed and moved from the source-side Veeam Data Mover Service to the target-side Data Mover Service.
  4. The target-side Veeam Data Mover Service deduplicates similar blocks of data and writes the result to the backup file in the backup repository.
Veeam Backup & Replication supports a number of backup scenarios that depend on the type of repository you use and its location.

 

Onsite Backup


If you choose to back up to an onsite Windows or Linux repository, Veeam Backup & Replication will start the target-side Veeam Data Mover Service on the Windows or Linux repository server. The source-side Veeam Data Mover Service can be hosted either on the source host or on a dedicated off-host backup proxy, depending on the backup mode you use (on-host or off-host). Backup data is sent from the source host to the backup repository over LAN.

Onsite Backup

To back up to an onsite SMB share, you need a Microsoft Windows-based gateway server that has access to the SMB share. This can be either the backup server or another Microsoft Windows server added to the Veeam Backup & Replication console. In this scenario, Veeam Backup & Replication starts the target-side Veeam Data Mover Service on the gateway server. The source-side Veeam Data Mover Service can be hosted either on the source host or on a dedicated off-host backup proxy, depending on the backup mode you use (on-host or off-host).

Onsite Backup

If you choose to back up VMs to an SMB share and do not specify a gateway server explicitly, Veeam Backup & Replication will start the source-side and target-side Veeam Data Mover Service on the proxy server. In the on-host backup scenario, Veeam Data Mover Services will be started on the source Hyper-V host. In the off-host backup scenario, Veeam Data Mover Services will be started on the off-host backup proxy.

Onsite Backup

 

Offsite Backup

The common requirement for offsite backup is that one Veeam Data Mover Service runs in the production site (closer to the source datastore), and the other Veeam Data Mover Service runs in the remote target site (closer to the backup repository). During backup, Veeam Data Mover Services maintain a stable connection, which allows for uninterrupted operation over WAN or slow links.

If you choose to back up to an offsite Windows or Linux repository, Veeam Backup & Replication will start the target-side Veeam Data Mover Service on the Windows or Linux repository server. The source-side Veeam Data Mover Service can be hosted either on the source host or on a dedicated off-host backup proxy, depending on the backup mode you use (on-host or off-host). Backup data is sent from the source to the backup repository over WAN.

Offsite Backup

If you choose to back up to an offsite SMB share in the on-host mode, you should deploy an additional Microsoft Windows-based gateway server in the remote site and point the SMB share to this gateway server in the backup repository settings. In this scenario, Veeam Backup & Replication starts the target-side Veeam Data Mover Service on the gateway server. The source-side Veeam Data Mover Service can be hosted either on the source host or on a dedicated off-host backup proxy in the source site, depending on the backup mode you use (on-host or off-host).

Offsite Backup

 

Backup Methods

Veeam Backup & Replication provides three methods for creating backup chains:
  • Forever forward incremental backup
  • Forward incremental backup
  • Reverse incremental backup

How To Install and Configure Zabbix to Securely Monitor Remote Servers on CentOS 7

$
0
0
Zabbix is open source monitoring software for networks and applications. It offers real-time monitoring of thousands of metrics collected from servers, virtual machines, and any other kind of network device. These metrics can help you determine the current health of your IT infrastructure and detect problems with hardware or software components before customers complain. Useful information is stored in a database so you can analyze data over time and improve the quality of provided services, or plan upgrades of your equipment.







Zabbix uses a client-server architecture and uses a small agent on the monitored client to gather data and send it to the Zabbix server. Zabbix version 3 supports encrypted communication between the server and connected clients, so your data is protected while it travels over insecure networks.

The Zabbix server stores its data in a relational database powered by MySQL, PostgreSQL, or Oracle. It also provides a web interface so you can view data and configure system settings.

In this tutorial, we will configure two machines. One will be configured as the server, and the other as a client which you'll monitor. The server will use a MySQL database to record monitoring data and use Apache to serve the web interface.

 

Prerequisites

To follow this tutorial, you will need:
  • Two CentOS 7 servers with a sudo non-root user.
  • One the CentOS 7 servers needs Apache, MySQL, and PHP installed.
Note: CentOS uses MariaDB instead of MySQL, but this will not cause any issues while following this tutorial.

 

Step 1 — Installing the Zabbix Server

First, we need to install the Zabbix Server on our server with MySQL, Apache, and PHP. We'll refer to this machine as the Zabbix server. Log into this machine as your non-root user:

  • ssh sammy@your_zabbix_server_ip_address


Zabbix isn't available in our package manager by default, so we will install a repository configuration package using the official Zabbix repository for CentOS,
  • sudo rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

You will see the following output:
Output 

Retrieving http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm warning: /var/tmp/rpm-tmp.qLbOPP: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY Preparing... ################################# [100%] Updating / installing... 1:zabbix-release-3.0-1.el7 ################################# [100%]


Now you can run the following command to install the Zabbix server and web frontend with MySQL database support:

  • sudo yum install zabbix-server-mysql zabbix-web-mysql


During the installation process you will be asked about importing a GPG key. Confirm it so the installation can complete.

Let's also install the Zabbix agent, which will let us collect data about the Zabbix server itself.

  • sudo yum install zabbix-agent


Before we can use Zabbix, we have to set up a database to hold the data that the Zabbix server will collect from its agents.

 

Step 2 — Configuring the MySQL Database For Zabbix

We need to create a new MySQL database and populate it with some basic information in order to make it suitable for Zabbix. We'll also create a specific user for this database so Zabbix isn't logging into MySQL with the root account.

Log into MySQL as the root user using the root password that you set up during the MySQL server installation:

  • mysql -uroot -p


First, create the Zabbix database with UTF-8 character support:

  • create database zabbix character set utf8;


Next, create a user that the Zabbix server will use, give it access to the new database, and set the password:
  • grant all privileges on zabbix.* to zabbix@localhost identified by 'your_password';

Then apply these new permissions:

  • flush privileges;


That takes care of the user and the database. Exit out of the database console.

  • quit;


Next we have to import the initial schema and data. The Zabbix installation provided us with a file that sets this up for us. We just have to import it. Navigate to the directory:

  • cd /usr/share/doc/zabbix-server-mysql-3.0.4/


Run the following command to set up the schema and import the data into the zabbix database. We'll use zcat since the data in the file is compressed.

  • zcat create.sql.gz | mysql -uzabbix -p zabbix


Enter the password for the zabbix user that you configured when prompted.

This command will not output any errors if it was successful. If you see the error ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: YES) then make sure you used the password for the zabbix user and not the root user.

In order for the Zabbix server to use this database, you need to set the database password in the Zabbix server configuration file.

  • sudo vi /etc/zabbix/zabbix_server.conf


Look for the following section of the file:
/etc/zabbix/zabbix_server.conf
### Option: DBPassword                           
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=

These comments in the file explain how to connect to the database. We need to set the DBPassword value in the file to the password for our database user. Add this line below those comments to configure the database:
/etc/zabbix/zabbix_server.conf
DBPassword=your_zabbix_mysql_password

That takes care of the Zabbix server configuration, but we have to make some modifications to our PHP setup in order for the Zabbix web interface to work properly.

 

Step 3 — Configuring PHP For Zabbix

The Zabbix web interface is written in PHP and requires some special PHP server settings. The Zabbix installation process created an Apache configuration file that contains these settings. It is located in the directory /etc/httpd/conf.d/ and is loaded automatically by Apache. We need to make a small change to this file, so open it up.

  • sudo vi /etc/httpd/conf.d/zabbix.conf


The file contains PHP settings that meet the necessary requirements for the Zabbix web interface. The only change you need to make is to set the appropriate timezone, which is commented out by default.
/etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
# php_value date.timezone Europe/Riga


Uncomment the timezone line, highlighted above, and change it to your time zone. You can use this list of supported time zones to find the right one for you. Then save and close the file.

Now restart Apache to apply these new settings.

  • sudo systemctl restart httpd


You can now start the Zabbix server.

  • sudo systemctl start zabbix-server


Then check whether the Zabbix server is running properly:

  • sudo systemctl status zabbix-server


You will see the following status:
Output 
zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled) Active: :active (running) since Fri 2016-08-05 07:16:35 UTC; 2s ago Process: 10033 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS) ...


Finally, enable the Zabbix server to start at boot time:

  • sudo systemctl enable zabbix-server


The server is set up and connected to the database. Now let's set up the web frontend.

 

Step 4 — Configuring Settings for the Zabbix Web Interface

The web interface lets us see reports and add hosts that we want to monitor, but it needs some initial setup before we can use it. Launch your browser and go to the address  

http://your_zabbix_server_ip_address/zabbix/. On the first screen, you will see a welcome message. Click Next step to continue.

On the next screen, you will see the table that lists all of the prerequisites to run Zabbix.

Prerequisites

All of the values in this table must show OK, so verify that they do. Be sure to scroll down and look at all of the prerequisites. Once you've verified that everything is ready to go, click Next step to proceed.
The next screen asks for database connection information.

DB Connection

We told the Zabbix server about our database, but the Zabbix web interface also needs access to the database to manage hosts and read data so it can display it to us. Enter the MySQL credentials you configured in Step 2 and click Next step to proceed.

On the next screen, you can leave the options at their default values.

Zabbix Server Details

The Name is optional; it is used in the web interface to distinguish one server from another in case you have several monitoring servers. Click Next step to proceed.

The next screen will show the pre-installation summary so you can confirm everything is correct.

Summary

Click Next step to proceed to the final screen.

The web interface setup is complete! This process creates the configuration file /etc/zabbix/web/zabbix.conf.php which you could back up and use in the future. Click Finish to proceed to the login screen. The default user is admin and the password is zabbix.

Before we log in, let's set up the Zabbix agent on our other server.

 

Step 5 — Installing and Configuring the Zabbix Agent

Now we need to configure the agent software that will send monitoring data to the Zabbix server.

Login to the second server, which we'll call the “monitored server”.

  • ssh sammy@your_monitored_server_ip_address


Then, just like on the Zabbix server, run the following command to install the repository configuration package:
  • sudo rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

You will see the following output:
Output 
Retrieving http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm 
warning: /var/tmp/rpm-tmp.jnLROO: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY

Preparing...                          ################################# [100%]
Updating / installing...
1:zabbix-release-3.0-1.el7 ################################# [100%]
Then install the Zabbix agent:

  • sudo yum install zabbix-agent


Confirm that you want to import the GPG key when asked.

While Zabbix supports certificate-based encryption, setting up a certificate authority is beyond the scope of this tutorial, but we can use pre-shared keys (PSK) to secure the connection between the server and agent.
So first, generate a PSK:

  • sudo sh -c "openssl rand -hex 32 > /etc/zabbix/zabbix_agentd.psk"


Show the key so you can copy it somewhere. You will need it to configure the host.

  • cat /etc/zabbix/zabbix_agentd.psk


The key will look something like this:



Output

bd7ebdc1ae80fb66e8102d6016671a4feabf489cf2692ee473512771c4903ed8

Now you have to edit the Zabbix agent settings to set up its secure connection to the Zabbix server. Open the agent configuration file:

  • sudo vi /etc/zabbix/zabbix_agentd.conf


Each setting within this file is documented via informative comments throughout the file, but you only need to edit some of them.

First, you must edit the IP address of the Zabbix server. Find the following section:
/etc/zabbix/zabbix_agentd.conf
### Option: Server
# List of comma delimited IP addresses (or hostnames) of Zabbix servers.
# Incoming connections will be accepted only from the hosts listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', 
#       '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: no
# Default:
# Server=

Server=127.0.0.1

Change the default value to the IP of your Zabbix server:
/etc/zabbix/zabbix_agentd.conf
Server=your_zabbix_server_ip_address

Next, find the section that configures the secure connection to the Zabbix server and enable pre-shared key support. Find the

TSLConnect section, which looks like this:
/etc/zabbix/zabbix_agentd.conf

### Option: TLSConnect
# How the agent should connect to server or proxy. Used for active checks.
# Only one value can be specified:
# unencrypted - connect without encryption
# psk - connect using TLS and a pre-shared key
# cert - connect using TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined 
#(even for 'unencrypted' connection)
# Default:
# TLSConnect=unencrypted

Then add this line to configure pre-shared key support:
/etc/zabbix/zabbix_agentd.conf
TLSConnect=psk

Next, locate the TLSAccept section, which looks like this:
/etc/zabbix/zabbix_agentd.conf
 
### Option: TLSAccept
# What incoming connections to accept.
# Multiple values can be specified, separated by comma:
# unencrypted - accept connections without encryption
# psk - accept connections secured with TLS and a pre-shared key
# cert - accept connections secured with TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined 
#(even for 'unencrypted' connection)
# Default:
# TLSAccept=unencrypted

Configure incoming connections to support pre-shared keys by adding this line:
/etc/zabbix/zabbix_agentd.conf
TLSAccept=psk

Next, find the TLSPSKIdentity section, which looks like this:
/etc/zabbix/zabbix_agentd.conf
 
### Option: TLSPSKIdentity
# Unique, case sensitive string used to identify the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKIdentity=

Choose a unique name to identify your pre-shared key by adding this line:
/etc/zabbix/zabbix_agentd.conf
TLSPSKIdentity=PSK 001

You'll use this as the PSK ID when you add your host through the Zabbix web interface.

Then set the option which points to your previously created pre-shared key. Locate the TLSPSKFile option:
/etc/zabbix/zabbix_agentd.conf
 
### Option: TLSPSKFile
# Full pathname of a file containing the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKFile=

Add this line to point the Zabbix agent to your PSK file you created:
/etc/zabbix/zabbix_agentd.conf
TLSPSKFile=/etc/zabbix/zabbix_agentd.psk
Save and close the file. Now you can start the Zabbix agent and set it to start at boot time:

  • sudo systemctl start zabbix-agent

  • sudo systemctl enable zabbix-agent


For good measure, check that the Zabbix agent is running properly:

  • sudo systemctl status zabbix-agent


You will see the following status, indicating the agent is running:
Output 
● zabbix-agent.service - Zabbix Agent 
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled) 
Active: active (running) since Fri 2016-08-05 08:17:07 UTC; 5s ago 
Process: 9507 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)

  ...
Our agent is now ready to send data to the Zabbix server. But in order to use it, we have to link to it from the server's web console.

 

Step 6 — Adding the New Host to the Zabbix Server

Installing an agent on a server we want to monitor is only half of the process. Each host we want to monitor needs to be registered on the Zabbix server, which we can do through the web interface.

Log in to the Zabbix Server web interface by navigating to the address http://your_zabbix_server_ip_address/zabbix/.

The Zabbix login screen

When you have logged in, click on the Configuration, and then Hosts in the top navigation bar. Then click Create host button in the top right corner of the screen. This will open the host configuration page.

Creating a host

Adjust the Host name and IP ADDRESS to reflect the host name and IP address of your client machine. Then add the host to a group by selecting one of the groups from the list, or by creating your own group. The host can be in multiple groups. The Linux Servers group is a good default choice. Once you've added the group, click the Templates tab.

Adding a template to the host

Type Template OS Linux in the Search field and then click Add to add this template to the host.

Next, navigate to Encryption tab. Select PSK for both Connections to host and Connections from host.

Then set PSK identity to PSK 001, which is the value of the TLSPSKIdentity setting of the Zabbix agent we configured previously.

Then set PSK value to the key you generated for the Zabbix agent. It's the one stored in the file /etc/zabbix/zabbix_agentd.psk on the agent machine.

Setting up the encryption.

Finally, click the Add button at the bottom of the form to create the host.
You will see your new host with green labels indicating that everything is working fine and the connection is encrypted.

Zabbix shows your new host.

After several seconds you can navigate to Monitoring and then Latest data to see the data from your agent.

To ensure things are working, shut down your monitored server so you can see how Zabbix alerts you to problems. Once your monitored server is offline you will see the warning on the main dashboard:






Zabbix shows you a warning about the host that's offline.

If you have additional servers you need to monitor, log in to each host, install the Zabbix agent, generate a PSK, configure the agent, and add the host to the web interface following the same steps you followed to add your first host.

 

Conclusion

In this tutorial, you set up a simple and secure solution which will help you monitor the state of your servers. It can now warn you of problems, and you have the opportunity to plot some graphs based on the obtained data so you can analyze it and plan accordingly.

How To Configure Periodic TRIM for SSD Storage on Linux Servers

$
0
0
Due to the architecture of SSDs, or solid state drives, continuous use results in degraded performance if not accounted for and mitigated. The TRIM command is an operation that allows the operating system to propagate information down to the SSD about which blocks of data are no longer in use. This allows the SSD's internal systems to better manage wear leveling and prepare the device for future writes. TRIM can have a major impact on the device's performance over time and its overall longevity.







While it is possible to enable continuous TRIM in Linux, this can actually negatively affect performance because of the additional overhead on normal file operations. A gentler alternative is to configure periodic TRIM. This configures the operating system to TRIM the drive on a schedule instead of as a necessary component of regular file operations. In almost all cases it provides the same benefits of continuous TRIM without the performance hit.

In this guide, we will briefly discuss how SSDs and TRIM work and then demonstrate how to enable periodic TRIM on a variety of Linux distributions.

 

How Do SSDs Store Data?

To better understand the problems that TRIM solves, it helps to know a few things about how SSDs store and manage their data.

 

Data Units

Data on SSDs is written and read in units of a fixed size known as pages. Pages, in turn, are grouped together in larger units called blocks.

 

Read, Write, and Erase Limitations

SSDs can read and write to pages individually. However, they can only erase data at the block level. Another limitation is that writes can only be performed on pages that have been completely zeroed (all bits set to 0). This means that overwriting data directly is impossible.

To modify data, the SSD actually has to read the information from the old location, modify it in memory, and then write the modified data to new, zeroed pages. It then updates an internal table to map the logical location that the operating system is given to the new physical location of the data on the device. The old location is marked in a different internal table as stale: not in use, but not yet zeroed.

 

Reclaiming Stale Pages

To reclaim the stale pages, the SSD's internal garbage collecting processes must read all of the valid pages from a block and write them to a new block. Again, the internal table mapping logical and physical locations is updated. The old block, which now contains no unique, still-in-use data can then be zeroed and marked as ready for future writes.

 

What Does TRIM Do?

The SSD's internal garbage collecting processes are responsible for erasing blocks and managing wear leveling. However, filesystems typically "delete" data by just marking it in their own records as space that is available again. They do not actually erase the data from the underlying storage, but may overwrite the area previously occupied by that data on subsequent writes.

This means that the SSD will typically not know that a page is no longer needed until it receives instructions from the filesystem to write to the same logical location at a later time. It cannot perform its garbage collection routines because it is never informed when data is deleted, just when the space previously reserved for it should now be used for other data.

The TRIM command propagates information about which data is no longer being used from the filesystem down to the SSD. This allows the device to perform its regular garbage collecting duties when idle, in order to ensure that there are zeroed pages ready to handle new writes. The SSD can shuffle data ahead of time, clean up stale pages, and generally keep the device in good working condition.

Performing TRIM on every deletion can be costly however and can have a negative impact on the performance of the drive. Configuring periodic TRIM gives the device bulk information about unneeded pages on a regular schedule instead of with each operation.

 

Disabling Continuous TRIM

You may have already enabled continuous TRIM on your devices when they were mounted. Before we enable periodic TRIM, it makes sense to take a look at our current mount options.

Continuous TRIM is enabled by mounting a drive or partition with the discard option.

First, find the filesystems that are currently mounted with the discard option:

  • findmnt -O discard



Output

TARGET SOURCE FSTYPE OPTIONS
/mnt/data /dev/sda1 ext4 rw,relatime,discard,data=ordered
/mnt/data2 /dev/sdb1 ext4 rw,relatime,discard,data=ordered
You can remount these filesystems in place, without the discard option, by including -o remount,nodiscard with mount:

  • sudo mount -o remount,nodiscard /mnt/data

  • sudo mount -o remount,nodiscard /mnt/data2


If you run the findmnt command again, you should receive no results:

  • findmnt -O discard


Next, open the /etc/fstab file to see the mount options currently defined for your filesystems. These determine how the filesystems are mounted each boot:

  • sudo nano /etc/fstab


Look for the discard option and remove it from lines that you find:
/etc/fstab
. . .
# /dev/sda1 /mnt/data ext4 defaults,nofail,discard 0 0
/dev/sda1 /mnt/data ext4 defaults,nofail 0 0
# /dev/sdb1 /mnt/data2 ext4 defaults,nofail,discard 0 0
/dev/sdb1 /mnt/data2 ext4 defaults,nofail 0 0

Save and close the file when you are finished. The filesystems will now be mounted without the discard option, and will mount in this same way on subsequent boots. We can now set up periodic TRIM for all filesystems that support it.

 

Setting Up Periodic TRIM for systemd Distributions

Setting up periodic TRIM for modern distributions shipping with systemd tends to be rather straight forward.

 

Ubuntu 16.04

Ubuntu 16.04 ships with a script that is run weekly by cron. This means that enabling the systemd method described in the following section is unnecessary for Ubuntu 16.04.

If you wish to examine the script, you can see it by typing:

  • cat /etc/cron.weekly/fstrim



Output

#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true

As you can see, this script needs a version of fstrim with the --all flag. Many versions fstrim shipped with earlier releases of Ubuntu do not contain this option.

 

Other systemd Distributions

For other systemd distributions, periodic TRIM can be enabled with the fstrim.timer file, which will run TRIM operations on all capable, mounted drives once a week. This also leverages the fstrim --all option.

At the time of this writing, this is the best method for the following distributions:
  • Debian 8
  • CentOS 7
  • Fedora 24
  • Fedora 23
  • CoreOS
For CentOS 7, Fedora 23, Fedora 24, and CoreOS, the fstrim.service and fstrim.timer units are available by default. To schedule a weekly TRIM of all attached capable drives, enable the .timer unit:

  • sudo systemctl enable fstrim.timer


Debian 8 has the fstrim.service and fstrim.timer available within the filesystem, but not loaded into systemd by default. You just need to copy the files over first:

  • sudo cp /usr/share/doc/util-linux/examples/fstrim.service /etc/systemd/system

  • sudo cp /usr/share/doc/util-linux/examples/fstrim.timer /etc/systemd/system


Now, you can enable the timer the same as with the other distributions:

  • sudo systemctl enable fstrim.timer


Your server should now TRIM all mounted filesystems that support the operation, once weekly.

 

Setting Up Periodic TRIM for Non-systemd Distributions

Coincidentally, most distribution releases that ship with non-systemd init systems also shipped with versions of the fstrim utility that did not have the --all flag. This makes safe, automatic TRIM operations much more difficult.

Using TRIM on drives that do not support it or on devices that incorrectly implement it can be dangerous and lead to data loss. The --all flag can handle these scenarios safely, but manually attempting to determine whether attached drives correctly support the operation can be dangerous.

In Ubuntu 14.04, a short script called fstrim-all is included, which attempts to do this. A weekly script run by cron executes this. However, the script does not always interpret the TRIM ability of attached drives correctly.

For this and other distributions with fstrim commands without the --all flag, the best workaround may be to compile a statically linked version of fstrim that does include the flag. This can be installed alongside the distribution-managed version and only called explicitly from the cron job.

This may be the best option for the following distributions:
  • Ubuntu 14.04
  • Ubuntu 12.04
  • Debian 7
  • CentOS 6
For Ubuntu 14.04, it's probably best to disable the fstrim-all script from running, since it may not detect the status correctly:

  • sudo chmod a-x /etc/cron.weekly/fstrim

  • sudo mv /etc/cron.weekly/fstrim /etc/cron.weekly/fstrim.bak


For other distributions, you can jump right in.

 

Install the Software Compilation Tools

First, install the needed software building tools.

For Ubuntu and Debian systems, this can be done by typing:

  • sudo apt-get update

  • sudo apt-get install build-essential


For CentOS systems, you can install a similar set of tools by typing:

  • sudo yum groupinstall 'Development Tools'


You now have the build dependencies needed to compile a recent version of fstrim.

 

Download and Extract the Source Files

The fstrim utility is released with other tools in a group called util-linux. You can find the source code, organized by release version, here.

Click on the most recent version of the package. At the moment, that is v2.28, but that may be different as development continues.

Within the next directory, find the most recent tarball for the software. This will start with util-linux- and end with .tar.gz. Currently, the most recent stable version is util-linux-2.28.1.tar.gz. Right-click on the appropriate link and copy it to your clipboard.

Back on your server, move to the /tmp directory. Use the curl or wget utility and paste in URL you copied to download the file:
  • cd /tmp
  • curl -LO https://www.kernel.org/pub/linux/utils/util-linux/v2.28/util-linux-2.28.1.tar.gz

Afterwards, extract the tarball to create the source directory structure:

  • tar xzvf util-linux*


Now that we have the source code and the build tools, we can build the software.

 

Configure and Compile a Statically Linked fstrim

Begin by enter the extracted directory structure:

  • cd /tmp/util-linux*


Next we need to configure the software. Since we are only installing an isolated fstrim binary, and do not want to overwrite the utilities and libraries managed by our package management system, we will compile a static binary.

To do this, we need to enable static linking and disable shared libraries. Configure the software with these properties by typing:

  • ./configure --enable-static --disable-shared


Once the software is configured, you can compile the fstrim utility by typing:

  • make fstrim


This will compile the utility, placing it in the top-level directory of the extracted archive.

Copy the binary to a directory that is not in your PATH. Since we're only interested in calling this from the cron script, we should make sure that it does not compete with the system-installed fstrim for other uses.

We will make a directory called /cron-bin and place the binary in there:

  • sudo mkdir /cron-bin

  • sudo cp /tmp/util-linux*/fstrim /cron-bin


We now have access to a more functional fstrim utility.

 

Create a Weekly Cron Script to Run fstrim

Now, we can create a new script that will be run by cron weekly. This will be exactly the same script that's included with Ubuntu 16.04, except that it will point to the location where we placed our statically compiled binary.

Create the file by typing:

  • sudo nano /etc/cron.weekly/fstrim


Inside, paste the following lines. This will run our new fstrim binary with the --all option:
/etc/cron.weekly/fstrim
#!/bin/sh
# trim all mounted file systems which support it
/cron-bin/fstrim --all || true

Save and close the file when you are finished.
Make the script executable by typing:

  • sudo chmod a+x /etc/cron.weekly/fstrim


The cron and anacron daemons will run this script once a week to TRIM the filesystems.





 

Conclusion

Your Linux server should now be configured to periodically TRIM all supported filesystems on a weekly basis. TRIM helps to maximize both the long term performance and lifespan of your SSDs.

Continuous TRIM operations may sound ideal, but they can add signifiant overhead to regular filesystem operations. Periodic TRIM offers a good middle ground by relaying key information needed to perform routine maintenance of the drive in a scheduled job instead of as a component of each file operation.
Viewing all 880 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>