• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Migrating vCenter to new Windows 2012 Server

June 20, 2014 1:34 pm / Albertech.net

Here are some notes on a recent migration I completed for vCenter. The source machine was a Windows 2008 R2 Server box that was running vCenter 5.1 and the new machine was a Dell R320 running Windows 2012 Server. I initially tried to install vCenter 5.1 on the Windows 2012 server, but it had a lot of errors with the install of the Single Sign On Service. Even with the latest version of vCenter 5.1, there are major issues when installing it with an existing vCenter database. I tried creating users from scratch in SQL Management Studio, installed SQL 2012 and 2008 R2 to no avail, and created ODBC system connections to no avail. There appears to be some issues with the way vCenter 5.1 communicates with the SQL server in Windows 2012.

The easiest solution to this was to upgrade vCenter on the source machine to vCenter 5.5. Using this vCenter 5.5 tutorial, the in-place upgrade to 5.5 worked well. To make things easier with the install, use the same password for the two accounts: vCenter 5.5 uses the username of [email protected], while vCenter 5.1 uses admin@system-domain for the username. 

VCenter 5.5 works great on Server 2012 as I was able to install without any errors using this guide on the VMWare site. I installed SQL 2008 R2 on the new server in order to ensure that the database backup/restore wouldn’t have any issues. You still will need to create the 64-bit ODBC driver sources in the system in order to have VCenter communicate with the database. After the databases have been restored on the SQL server, proceed with the installation and make sure you select the existing database option to keep the old data.

Once vCenter is installed on the new machine, you will need to reconnect all vSphere hosts with the username/password. If you notice that the host initially connects and then disconnects, double check the firewall setting on the vSphere host to ensure the heartbeat check is able to pass through.

Requirements:

  • VMWare vCenter 5.5
  • SQL 2008 R2 with SQL Management Studio (to backup/restore the databases)
  • ODBC connection setup for 64-bit data source

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: VMWARE / Tagged: migration

Reset vCenter Single Sign On Master Password VMWare 5.1

May 7, 2014 4:20 pm / Albertech.net

In order to reset the vCenter Single Sign On Master Password running on a Windows server for the [email protected] user, you will need to have local admin access and SQL Server Management Studio installed. I initially tried using this method on VMWare’s website to reset via the command line, but got an error “ERROR: Failed to decrypt field com.rsa.db.user”. There is a workaround where you run a SQL command to reset the password to a known passphrase.

You will first need to open up the SQL Server Management Studio. Select the “VIM_SQLEXP” server name. Expand the Database folder tree, right click the RSA database and select “Tasks->Back up”. Backup the database to a local file. This is just in case the database somehow breaks when changing the password.

Copy the SQL command from this post.
https://communities.vmware.com/thread/428929?start=44

Run the Query in SQL Server Management Studio – RSA database. Once the query is successful, the [email protected] user password is now set to VMware1234!

To reset the password to something more secure, run the VMWare Web Client (https://MYSERVER:9443) with the new [email protected] credentials. After logging in, click on the “[email protected]” link on the top and select “Change Password”. Make sure it follows the proper password policies — 8 min characters, 1 special character, etc. Logout and your new password should work.

 

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: VMWARE / Tagged: reset password, vcenter

Preserve remote IP address with HAProxy on CENTOS

March 20, 2014 7:05 am / Albertech.net

If you install HAProxy on your server, you will notice that the remote IP address in the logs and webapps will display the IP of the proxy and not the remote IP address of the client. You can set HAProxy to forward the client IP address to the web server via the “forwardfor” configuration. Once that is done, configure the web server to read the forwarding IP address header.

Make sure you have the following configuration for HAProxy: /etc/haproxy/haproxy.cfg

option http-server-close
option forwardfor       except 127.0.0.0/8

 

If you are using Lighttpd, there is a module called mod_extforward that you can set to forward the original IP address:

http://redmine.lighttpd.net/projects/1/wiki/Docs_ModExtForward

 If you are using Apache, here are the instructions to preserve the remote IP address:

Install Apache Mod_Extract_Forwarded package: (you need to have the EPEL repository)

yum install mod_extract_forwarded

Configure: /etc/httpd/conf.d/mod_extract_forwarded

MEFaccept 127.0.0.1

Replace the 127.0.0.1 with your proxy IP address (e.g. 192.168.50.50)

Restart Apache

apachectl restart

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Apache, Linux / Tagged: haproxy

Fix: LoadError: no such file to load — mysql2/mysql2 with jRuby and Warbler

August 7, 2013 12:03 pm / Albertech.net

I recently transitioned a Ruby on Rails Passenger server to jRuby with Tomcat and encountered an error caused by the Gemfile.

“no such file to load — mysql2/mysql2
LoadError: no such file to load — mysql2/mysql2”

The fix? JRuby needs a MySQL adapter named “activerecord-jdbcmysql-adapter” in order to it to work properly.

# Original MySQL Adapter --
# gem 'mysql2', '~>0.3.13'
#
# New Adapter for jRuby
gem 'activerecord-jdbcmysql-adapter'

Adding the ‘activerecord-jdbcmysql-adapter’ gem and commenting out the original “mysql2” gem fixed the issue. I recommend using the “warble executable war” to troubleshoot these errors since you can quickly run a “java -jar myapp.war” to test it out.

Tested with jRuby 1.7.4, Rails 3.2.12

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: Ruby on Rails / Tagged: jRuby, MySQL, warbler

PHP – Removing alpha characters from an entire array using closure

May 7, 2013 12:40 pm / Albertech.net

Here’s a quick way to remove all alpha characters from an array using PHP closures (PHP 5.3+)

array_walk($myarray, function(&$element){ $element = trim($element,"ABCDEFGHIJKLMNOPQRSTUVWXYZ"); });

You can also remove all numbers from an array similarly

array_walk($myarray, function(&$element){ $element = trim($element,"0123456789"); });

The variable must be passed by reference in order to change the values of the original array. I really like the addition of closures, which reduces the need to create a new method for simple operations.

Share this:

  • Facebook
  • Google
  • Twitter
  • Print
  • Email
Posted in: PHP / Tagged: closure, PHP

Post Navigation

← Older Posts
Newer Posts →

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.