Handy tip for enabling the slow query log for MySQL for Centos / Redhat linux.

  1. Stop MySQL by typing either “service mysqld stop” or “/etc/init.d/mysqld stop”
  2. Edit the my.cnf file, usually found at “/etc/my.cnf”
  3. Under [mysqld] add the following line; 
    log-slow-queries=/var/lib/mysql/slow.log
  4. Save the updated my.cnf file.
  5. Do not start MySQL yet. We need to add the slow log file and location. To do this tpye the following into the command prompt; 
    touch /var/lib/mysql/slow.log
    chmod 660 /var/lib/mysql/slow.log
    chown mysql:mysql /var/lib/mysql/slow.log
  6. With the slow log file and location created with the proper permissions, now you can restart MySQL with ”service mysqld start” or “/etc/init.d/mysqld start”
  7. After some time review the log you created at “/var/lib/mysql/slow.log” using a text editor (Nano, Pico,Vi / VIM).

There you go! Hopefully this helps you drill down if you’re noticing slow performance due to MySQL.

Tags: , , , , , ,

Comments No Comments »

Having changing my environment I found my self moving from iSCSI to NFS and of course since NFS is a mapped drive, I found that Crashplan doesn’t support mapped drives out of the box. To get around this I had to implement the fix below. This was something I found on the Crashplan website and wasn’t easily accessible via a google search, so I’m re-posting it for anyone else who finds themselves in the same situation.

There are numerous guides on the internet but I found that none of them had all the required steps, at least not for me.  I think the authors made some assumptions about user knowledge and system configurations that meant that their guides were not as universal as they intended.  So my intention here is to create a comprehensive and fool-proof guide for all users.  What follows has worked for me.  Fingers crossed I don’t miss out any critical steps.  Thanks to Viktor on this forum for helping me finally figure out the complete process.

Before I continue please note that this is a guide for how to back up FROM a NAS to another destination using Crashplan.  It may also facilitate backing up TO a NAS with CP, but I have not tested this.

It should be noted that  the best solution to backing up FROM the NAS with CP is to install the CP headless client on the NAS.  This means you don’t’ need a PC turned on all the time whilst the NAS is being backed up.  However this is unsupported by CP and only works properly for NAS units with the right specification.  In my case my DS413j was too underpowered to do the job I wanted with the large data sets I wanted to back up.  Hence why I have moved to this approach (which is also unsupported by CP, but does seem to work).

And finally, I am using Windows 7 32bit.  From what I have read this approach may not work with XP; I am not sure if it supports the mklink command that will be required.  For XP I think you have to use the workaround proposed on the Crashplan Support site (although that is also not formally supported by CP)

So here goes

  1. Decide which PC you will be using to manage the back ups.  Ensure that the user account for that PC has a password.  The steps that follow will NOT work if the PC’s user account does not require a password.  If your PC user account does not currently require a password then click Start and then the user icon at the top right of the pop up.  Select “create a password for your account” and create your password.
  2. Having created a password you will now be required to enter it every time you login to that PC.  If you are the only user of that PC and don’t wish to enter your password every time then follows these steps
    1. Click Start and in the search box type “netplwiz”
    2. Open the netplwiz application from the search results.
    3. Untick the box for “Users must enter a username and password to use this computer”.
    4. Click OK
  3. Now you need to make CP logon as with your PC user account rather than as SYSTEM.  This step is omitted from most of the guides I have seen but is essential, and will only work if you have also done the previous steps.
  4. Click Start and type services.msc in the search box.
  5. Next perform the following;
    1. Open the services application from the search results.
    2. Scroll down to “Crashplan Backup Service” and right click and select “Properties”
    3. Under the Logon tab, click the “This Account” radio button
    4. Click Browse and enter your PC Username (eg Eric in my case) in the “Enter the object name to select” box.  Click “Check Names” and then OK.
    5. I now see “.\eric” in the “This Account” box.  You should see “.\your username”.  Enter your PC user account password twice and select OK.
    6. If you have followed all the previous steps you should now be prompted or given the opportunity to Restart the service.  Do so.
    7. Crashplan should now be running under your PC user account.
  6. Now you are ready to create the “symbolic links” from a folder on your PC to a corresponding “share” on your NAS, prior to beginning backing up.
  7. Create a folder anywhere on your PC that is convenient and give it a suitable name.  You will need to create one folder for each “share” on your NAS that you want to back up.  On my PC I have a data partition (D) on my primary drive (the one with the OS) and 2 other drives that are “spanned” to create a 6TB volume (F) that I use exclusively for backups from my NAS.  Therefore I created my “symbolic link” folders in my data partition (D).  As an example, I called one of them “DS1-photo” and its “path” is “D:\DS1-photo”.  I then created similar folders for my other NAS shares; media, video, music etc.
  8. Open CP and then under Destinations select “Folders”.  Click Select and browse to one of the folders created above, eg D:\DS1-photo”.  Select and click OK.  DO NOT CLOSE THE CP WINDOW!
  9. Via Windows Explorer, return to the folder you just selected and delete it.  Yes, I know this sounds weird but this is what all the guides say and it does work OK.  Not sure what happens if you don’t delete the folder at this stage, so its safest just to do as instructed.
  10. Click Start and type “cmd”.  DO NOT CLICK ENTER!  Right click on the CMD application in the results box and select “Run as Administrator”.  A black box window will open up.
  11. Type the following, replacing my example folder, NAS name and share name with your own details: mklink /d d:\DS1-photo \\diskstation1\photo then click enter.  You should get a reply that a symbolic link has been created between the chosen folder and the share on the NAS.  In my example diskstaton1 is the name of my NAS and photo is the share on the NAS I am trying to back up.
  12. Close the black window.  Via Windows Explorer return to the location where you created and then deleted the folder (eg D:\DS1-photo”).  It should have magically reappeared with a little arrow in the folder icon.  If you double click on this folder you should now see the contents of the relevant share on your NAS; in my case my photos.
  13. That is it, all done!  Repeat steps 5-10 for each share on your NAS that you want to back up.

Now in Crashplan you just use this folder as a SOURCE (even though you just created it as a destination) and backup to wherever you want, as for any other source folder. 

Tags: , , , ,

Comments No Comments »

Just a handy list of useful VMware PowerCLI commands. Keep in mind that many of these are examples and can be tweaked / adjusted as needed. This is just for your benefit and mine :)

Basic Commands

Connect-viserver – This will connect you to the ESX / ESXi server. An example would be Connect-viserver 192.168.1.1 -user myname -password mypassword

Get-VM – This will get the the listings of every virtual machine on the host you connected to and will also provide the operating system used, number of cpu’s and memory assigned to the VM.

Get-VMHost – This will provide a status of the host and specifications of the hardware such as memory and cpu.

Get-Cluster – Will provide information of a cluster  if the host is connected to a cluster.

Get-VM | Select Name, Version, ToolsVersion, ToolsVersionStatus | Export-Csv -NoTypeInformation -UseCulture -Path C:\Yourfolderpath\Filename.csv

Creates a quick output for VM hardware versions. This is handy when upgrading vCenter versions. I used this one liner to compile a list of vm’s that needed to be upgraded prior to our 5.1 upgrade

 

Find VM’s with Snapshots

foreach ($snap in (Get-VM | Get-Snapshot | Where-object {$_.Created -lt ((Get-Date).AddDays(0))})){ $snap | select VM, Name, Description, SizeMB, Created }

 

 Rescan HBA Adapters.

foreach ($esx in Get-VMhost -Location ClusterName | sort Name) { $esx | Get-VMHostStorage -RescanAllHBA -rescanVMFS -refresh }

 

Add Port Group “VLAN 500” with VLAN tag 500 to vSwitch1 on all hosts in a Cluster

foreach ($esx in Get-VMHost -Location ClusterName | Sort-Object Name) { $esx | Get-VirtualSwitch -Name vSwitch1 | New-VirtualPortGroup -Name “VLAN500″ -VlanId 500 }

 

vMotion and Storage vMotion

Get VM Information, Cluster, Host, Datastore

Get-VM | Select Name, @{N=”Cluster”;E={Get-Cluster -VM $_}},@{N=”ESX Host”;E={Get-VMHost -VM $_}},@{N=”Datastore”;E={Get-Datastore -VM $_}}

 

Peforming a vMotion

Move-VM vm-name -Destination (Get-VMHost esxi-hostname)

 

Actually Storage vMotion

Get-VM “vm-name” | Move-VM -datastore (Get-datastore datastore-name)

 

Search for things in Inventory. (Look for VMs that have an ‘v’ in them.

Get-VM | Where-Object {$_.name -match ‘v’}

 

List VMs with less than 1024MB of Memory

Get-VM | Where-Object {$_.MemoryMB -lt ’1024′}

 

See if of the datastores have less then a certain amount of free space.

Get-Datastore | Where-Object {$_.freespaceMB -lt 100000}

Get-Datastore | Where-Object {$_.freespaceMB -lt 3000}

 

Unmount datastore from environment

get-datastore “name_of_datastore” | detach-datstore

 

Output a list

get-vm | select name, numcpu, memoryMB, @{n=”diskKB”; e={($_ | get-harddisk).capacityKB}} | ConvertTo-Html | Out-File c:\vms.html

Tags: , ,

Comments No Comments »

If you’re wondering where the unmount option is to detach a datastore / LUN in VMware ESX / ESXi 4 I hate to be the one to break it to you but there isn’t one. Sadly the only way to remove a datastore / LUN in ESX / ESXi 4 is to delete the datastore / LUN , unlike with ESXi 5 where you actually have an unmount option. However it is possible to remove it using the delete option.

That said before you attempt this you need to make sure that that datastore / LUN is completely empty or that there is noting you need on that datastore / LUN, otherwise you will lose anything stored on there. Once you are ready to proceed, continue.

  1. Connect to the ESX / ESXi 4 host or cluster that you need remove the datastore / LUN from using vSphere.
  2. Navigate to the “Datastores” view
  3. Right-click the Datastore in question and click “Delete”. Remember it will not warn you so you need to be 100% sure you want to remove it! 
  4. Remove the LUN from being presented to the Host or Cluster or if you don’t manage that, send it off to whoever does.
  5. Once the LUN is no longer being presented to the Host or Cluster be sure to “Rescan for Datastores”. To do this navigate to Configuration -> Storage Adapters -> Rescan or you can also right-click on a host or cluster that the datastore / LUN was removed from and select  ”Rescan  for Datastores”

That’s it! Hopefully there was anything on there that you needed! 

Comments No Comments »

As I mentioned in a previous post that I’d do a review on the Dell Venue 8 Pro tablet that I picked up recently, and after seeing countless reviews of the device on TheVerge, Engadget and many more I decided against doing so. I will post those links to the reviews at the bottom of this article for you to check out. Instead, I’ll share my experience with the tablet so far. This will be my user experience with the Dell Venue 8 Pro and while it seems like an review, it’s not… not officially anyway.

Dell_Venue_8_Pro_35828030__05_620x433 

So as many of our readers know I come from a Google Android background. I simply enjoy the Android ecosystem, all my phones are Android and up to this point so were my tablets. That said, I do find that using the Android base tablets I miss out on many applications that I want or need for getting serious work done, such as VMware applications like View or vSphere along with native RDP and VPN support that I need for work which aren’t supported on the Android OS. Thankfully Windows 8.1 (Not RT) capitalizes on this and allows for full legacy application installation, which let’s me get all the stuff I need installed, a very handy convenience indeed. No longer will I need to worry about carrying a laptop (notebook, for all the geeks reading this) around with me when I can just put the Venue in my pocket and head on out. That also means that I can install and fire up Blizzard’s Hearthstone among other games and enjoy them on the go. 

As much as I was opposed to Windows 8 (and mind you I still am on a desktop) I will admit, that I did mention from time to time that it seemed perfect for a tablet/touch based device and I couldn’t be happier that this was correct. Windows 8 on the tablet seems natural, it flows seamlessly without any issues. The Metro/Modern UI just works. Tiles can be moved and re-sized with ease. Desktop mode also makes it’s return and it’s Windows that everyone knows and loves, though I find that being forced into desktop mode for legacy application installs or configurations is a big no-no. The whole point of Windows 8 on the tablet was to showcase what the OS could do and having you go to the desktop should be looked into. It’s not a huge issue but it takes away from the shine of the OS and I feel that the Windows tablet screen would benefit with either having an exclusive Metro/Modern UI or an exclusive desktop interface, not both. Seriously, if I wanted to use the desktop I’d just use my PC or remote to my PC.
(more…)

Tags: , , ,

Comments No Comments »