Latest Entries »

If you receive the “Failed to load keyring modules.” error when running keystone via CLI, you’re missing the python-keystone package. To fix. simply install via yum:

# yum install python-keyring
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink | 9.1 kB 00:00
* base: mirror.agmn.ca
* epel: mirror.symnds.com
* extras: mirror.cs.vt.edu
* updates: mirror.us.leaseweb.net
base | 3.7 kB 00:00
epel | 4.3 kB 00:00
epel/primary_db | 5.0 MB 00:01
extras | 3.5 kB 00:00
puppetlabs-deps | 1.9 kB 00:00
puppetlabs-products | 1.9 kB 00:00
updates | 3.5 kB 00:00
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package python-keyring.noarch 0:0.7-1.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================================
Installing:
python-keyring noarch 0.7-1.el6 epel 54 k

Transaction Summary
====================================================================================================================================================================================
Install 1 Package(s)

Total download size: 54 k
Installed size: 214 k
Is this ok [y/N]: y
Downloading Packages:
python-keyring-0.7-1.el6.noarch.rpm | 54 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-keyring-0.7-1.el6.noarch 1/1
Verifying : python-keyring-0.7-1.el6.noarch 1/1

Installed:
python-keyring.noarch 0:0.7-1.el6

Complete!

 

When installing nova from source, you may run into issues when trying to run any of the nova services that look like this:

2013-01-10 15:13:16 9880 DEBUG nova.openstack.common.lockutils [-] Got file lock “iptables” at /var/lock/nova/nova-iptables for method “_apply”… inner /usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/openstack/common/lockutils.py:219
2013-01-10 15:13:16 9880 DEBUG nova.utils [-] Running cmd (subprocess): iptables-save -c -t filter execute /usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/utils.py:205
2013-01-10 15:13:16 9880 ERROR nova.service [-] Unhandled exception
2013-01-10 15:13:16 9880 TRACE nova.service Traceback (most recent call last):
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/service.py”, line 284, in _start_child
2013-01-10 15:13:16 9880 TRACE nova.service self._child_process(wrap.server)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/service.py”, line 261, in _child_process
2013-01-10 15:13:16 9880 TRACE nova.service launcher.run_server(server)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/service.py”, line 124, in run_server
2013-01-10 15:13:16 9880 TRACE nova.service server.start()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/service.py”, line 596, in start
2013-01-10 15:13:16 9880 TRACE nova.service self.manager.init_host()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/api/manager.py”, line 39, in init_host
2013-01-10 15:13:16 9880 TRACE nova.service self.network_driver.metadata_accept()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/network/linux_net.py”, line 545, in metadata_accept
2013-01-10 15:13:16 9880 TRACE nova.service iptables_manager.apply()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/network/linux_net.py”, line 358, in apply
2013-01-10 15:13:16 9880 TRACE nova.service self._apply()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/openstack/common/lockutils.py”, line 220, in inner
2013-01-10 15:13:16 9880 TRACE nova.service retval = f(*args, **kwargs)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/network/linux_net.py”, line 378, in _apply
2013-01-10 15:13:16 9880 TRACE nova.service attempts=5)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/network/linux_net.py”, line 1021, in _execute
2013-01-10 15:13:16 9880 TRACE nova.service return utils.execute(*cmd, **kwargs)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib/python2.6/site-packages/nova-2013.1-py2.6.egg/nova/utils.py”, line 226, in execute
2013-01-10 15:13:16 9880 TRACE nova.service result = obj.communicate()
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib64/python2.6/subprocess.py”, line 729, in communicate
2013-01-10 15:13:16 9880 TRACE nova.service stdout, stderr = self._communicate(input, endtime)
2013-01-10 15:13:16 9880 TRACE nova.service File “/usr/lib64/python2.6/subprocess.py”, line 1330, in _communicate
2013-01-10 15:13:16 9880 TRACE nova.service self.wait(timeout=self._remaining_time(endtime))
2013-01-10 15:13:16 9880 TRACE nova.service TypeError: wait() got an unexpected keyword argument ‘timeout’

This typically means that you have allowed PyPi (pip) to install the Python eventlet module. Unfortunately, this is not compatible with the CentOS/RHEL version of Python 2.6. To check, run:

# rpm -qf $(python -c ‘import eventlet as e; print e.__file__’)

If you see something like the following, it most likely means that you have an incompatible eventlet module:

file /usr/lib/python2.6/site-packages/eventlet/__init__.pyc is not owned by any package

To fix the issue, simply install with yum:

# yum install python-eventlet
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.its.dal.ca
* epel: epel.mirror.constant.com
* extras: mirror.its.dal.ca
* updates: mirror.its.dal.ca
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package python-eventlet.noarch 0:0.9.17-2.el6 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================================
Installing:
python-eventlet noarch 0.9.17-2.el6 epel 262 k

Transaction Summary
====================================================================================================================================================================================
Install 1 Package(s)

Total download size: 262 k
Installed size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
python-eventlet-0.9.17-2.el6.noarch.rpm | 262 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-eventlet-0.9.17-2.el6.noarch 1/1
Verifying : python-eventlet-0.9.17-2.el6.noarch 1/1

Installed:
python-eventlet.noarch 0:0.9.17-2.el6

Complete!

And now verify (your version number may be different):

# rpm -qf $(python -c ‘import eventlet as e; print e.__file__’)
python-eventlet-0.9.17-2.el6.noarch

You should now be good to run your nova services!

Recently we ran into an issue where when trying to send an email on a Plesk box with Postfix as the MTA. We were having an issue sending to the main domain and their email was not hosted on the box but they were using php to send emails with a contact form.

When I looked at the logs in /usr/local/psa/var/log/maillog I seen this error pop up:

Jul 30 07:57:10 domain postfix/error[1386]: CAAC4A1A0B73: to=<apache@domain.com>
, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced (User unknown i
n virtual alias table)

This is is saying that postfix is bouncing the email because that email doesn’t exist on the server. So I immediately thought this was an issue with the mailbox on Plesk being enabled, so I made sure that was unchecked and it was. After searching it appears that if your hostname is the same as a domain on the server then postfix will still try to send it locally. To fix this you simply have to change your hostname. If you log into plesk and go into server settings you should change it there and then just reset postfix after that with:

/etc/init.d/postfix restart

Once it comes back up you should be able use your contact form and get a copy sent to that domain again.

For people pulling their hair out trying to get their Virtuozzo VPS to display the time they want and can’t figure out why the usual commands are not working, it is because the time is managed by Virtuozzo from the hardware node. So no matter what you try to do to change the time through the date command or even trying to install ntp the time will never be what you want it to be if the hardware node is different. In order to change your timezone, you should setup the correct symbolic link to the timezone you want to the /etc/localtime file To start, you should create a backup of your /etc/localtime file by running this command:

cp /etc/localtime /etc/localtime.bk

To set the timezone for EST, add a symbolic link:

ln -s /usr/share/zoneinfo/EST /etc/localtime

You can also directly copy the proper timezone file and overwrite the /etc/localtime file.

To set the timezone for EST, run the following command:

cp /usr/share/zoneinfo/EST /etc/localtime

For some reason it’s not as apparent to change the outgoing Nagios e-mail address as you would think. It typically sends from nagios@your.host.name, which is fine for us nerds, but doesn’t look as nice when you’re providing monitoring services for a client or a co-worker.

Please note that this article assumes you’re using sendmail!

In order to change the sending address that Nagios uses, you will actually have to tell sendmail to “re-write” the default address. This is done using sendmail’s genericstable feature. Step 1 is to enable genericstable by adding the following lines to /etc/mail/sendmail.mc. Make sure that these are above the MAILER(…)dnl lines at the bottom:

FEATURE(`genericstable’)dnl
GENERICS_DOMAIN(`your.host.name’)dnl

After adding those, close and save the file and run the following command to apply your configuration changes:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Now that we’ve enabled the genericstable feature, we can add the re-write. You will want to edit/create /etc/mail/genericstable and add the following line (customizing for your desired address of course):

nagios mynewaddress@my.domain

Close and save the file. Now we want to build a genericstable database that sendmail can understand:

makemap hash /etc/mail/genericstable < /etc/mail/genericstable

And finally, for good measure, restart sendmail:

/etc/init.d/sendmail restart

Now Nagios should be sending out e-mails using a user-friendly address!

If you are running Plesk and you want to run something from a directory outside of the httpdocs directory you can do this simply by adding a vhost.conf file.  You will need to create the vhost.conf file in conf/ in your websites main directory.

cd /var/www/vhosts/domain.com/conf/

You can create this with your favourite editor.

vim vhost.conf

<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir /tmp:/var/www/vhosts/domain.com
</Directory>

Save this file and then we just have to edit the httpd.include file.

Once the file is open you just need to add this line:

ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
Include /var/www/vhosts/domain.com/conf/vhost.conf
</VirtualHost>

Save this file and you just have to reconfigure plesk

/usr/local/psa/admin/sbin/websrvmng -u –vhost-name=domain.com

Now you should be able to access folders outside your main httpdocs folder. If you need to do this for https connections you can follow all the same steps but you will need to create a vhost_ssl.conf file instead of the vhost.conf file.

I just finished running fsck on an LVM and was having some issues since I was actually trying to run the check on the disk itself rather then the LVM. I completely forgot that you needed to run it on the actual individual LVM’s which prompted me to add this to our blog for others and also for quick reference for the future. Here is how you do it.

View full article »

This was my way of making up for it.. a little unorthodox, but it sure did the trick!

Homemade -y flag

Recently, we have had some issues where one script or website would cause an Apache child process to consume all of a server’s RAM. This eventually led to memory swapping and a kernel panic if left for a matter of minutes. We initially had set our eyes on RLimitMem, but quickly discovered that it only limits processes spawned by Apache children (such as PHP). So, in order to solve this problem, we stumbled on a great solution using an unexpected Apache module: mod_perl.

There is a perl module called Apache2::Resource (or Apache::Resource for those of you still using Apache 1.x) which allows resource throttling on a per process level. Not only can you limit memory usage, but CPU and other system resource limits are available as well (for a full list, consult your disto’s setrlimit man page). This module should be installed by default on most RHEL systems.

View full article »

We’re pleased to announce that Dynamic Hosting has upgraded our Silver, Gold, and Platinum dedicated servers! Included in the changes are:

  • Silver has gone from 2GB to 4GB of RAM
  • Gold has gone from 4GB to 6GB of RAM
  • Platinum has gone from being a RAID-1 on a SAS6ir to a RAID-5 on an H700

Our technical team made these decisions after some performance evaluations. We have also decided to provide these new configurations at the same price!

You can check out our Canadian dedicated servers at http://www.dynamichosting.biz/content/dedicated-servers/