No local packages or download links found for python-keystoneclient

If you encounter something like this while installing devstack:

Installed /opt/stack/keystone
Processing dependencies for keystone==2012.1
Searching for python-keystoneclient
Reading http://pypi.python.org/simple/python-keystoneclient/
Couldn’t find index page for ‘python-keystoneclient’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for python-keystoneclient
error: Could not find suitable distribution for Requirement.parse(‘python-keystoneclient’)
++ failed
++ local r=1
++ set +o xtrace

 

You can run the setup.py script by hand. Haven’t figured out yet why it fails.

cd /opt/stack/python-keystoneclient/
sudo python setup.py install

Also if it still complains about missing module cli.app you can run it by hand

pip install pyCLI

 

Test chef on centos 5

If you have an old machine like me, with centos 5.don’t remember but want to test chef here is how you do it. You’ll need ruby 1.8.7+, gcc44, couchdb, then you need to do a gem install, but for me using the bootstrap recipe didn’t work due to the fact that it always tried to install gcc-4.1 even though gcc44 was installed and it needed gcc-4.2. Bummer!
Anyway thanks to this I managed  to get it working.

1. Add rbel repo
rpm -Uvh http://rbel.frameos.org/rbel5
yum install ruby  ruby-devel rubygems rubygem-chef-server

If you already have ruby 1.8.6 it might need to be cleared out with yum remove

2. Start the server

setup-chef-server.ch

3. Navigate

http://your-chef-server:4040 user: admin password: chef321go 

if it doesn’t work, try running the applications by hand and not using the init scripts ’cause it’s ruby and it only spits syntax errors when it wants to, and only on stdio.

Now it’s time to read the documentation, since it’s a lot to dig in before you can actually use it.

Cache wordpress with mod_cache and add compression

In my soon-to-be-argued-with opinion serverside caching works a lot better than any application side caching. This is because you have all those goodies like keeping everything in memory and serving from there which beats the hell out of anything since disk access is so terrible. There is also a setting to compress everything with the proper mime types. This helps the browsers download the file faster and thus improves user experience. Your posts will start appearing on the website after a minute. It’s not that bad considering you’re speeding up the site 1000 times or so.

Add this to your virtual host/.htaccess

<IfModule mod_mem_cache.c>
CacheEnable mem /
MCacheSize 40960000
MCacheMaxObjectCount 100
MCacheMinObjectSize 1
MCacheMaxObjectSize 204800
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css

ExpiresActive On
ExpiresDefault “access plus 1 minute”

 

 

Setting up an centos5.2 openvz host and containers.

Quick, quick quick…

I’m doing this install on an old dell 1850, and did on a R300 and worked as well.
My architecture is for both platforms x86_64.

1. netinstall the host system (see this for more information): I use a barebones system (with nothing selected on the setup i.e. no gnome or any kind of x)

2. After your hosts’s setup, set your yum repository to see yum:

cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

3. Install openvz kernel and supporting tools:

yum install ovzkernel.x86_64 vzctl.x86_64

4. Edit the sysctl

vim /etc/sysctl.conf
append:
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1

5. Disable selinux

vim /etc/sysconfig/selinux
set:
selinux=disabled

6. Reboot
7. download a domU template ( a precreated template for your container)
Go to : http://wiki.openvz.org/Download/template/precreated and download your favorite.
i used:

cd /vz/template/cache/
wget http://download.openvz.org/template/precreated/contrib/centos-5-x86_64-default.tar.gz

8. Create your first container:

vzctl create 101 --ostemplate centos-5-x86_64-default --hostname --ipadd

Don’t worry you can change the network settings later.

9. Don’t forget to allow dns resolving for client machines, as well as tcp downloading

vim /etc/sysconfig/iptables
Add somewhere in the RH-Firewall-1-INPUT (before the REJECT rule
-A RH-Firewall-1-INPUT -p udp -m udp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 80 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

Troubleshooting

t1. Unable to open pty: No such file or directory
If you have:

[root@host01 cache]# vzctl enter 101
enter into VE 101 failed
Unable to open pty: No such file or directory


[root@host01 cache]# vzctl exec 101 /sbin/MAKEDEV tty
[root@host01 cache]# vzctl exec 101 /sbin/MAKEDEV ptty

t2. if you have memory issues, check the barriers
cat /proc/user_beancounters
if something is failed increase that barrier like this:

vzctl set --save --kmemsize 14372700 --privmpages 655360

t3. If you still can’t resolve names use:

vzctl set 101 ----nameserver 10.80.130.1 --save

Enjoy
Disclaimer: This documentation is provided under the freebsd licence: http://www.freebsd.org/copyright/freebsd-doc-license.html

Alexandru Bordei
Advanced Technologies Specialist @ Hostway Corporation

How to do a network install on centos 5.2

Quick, quick as usual.

I’m doing this install on a dell 1850 which is a 64 bit platform, so in order to do it on other platforms don’t forget to select the apropiate architecture.
You need a keyboard and a monitor. (it’s a network install not network pxe install). You need either a dhcp service on your network or the ip address and gateway of your ISP.

1. Download your netinstall image and burn it on a cd:
go to: http://isoredirect.centos.org/centos/5/isos/x86_64/
i used ftp ftp://ftp.lug.ro
cd /centos/5.2/isos/x86_64/
ls

get CentOS-5.2-x86_64-netinstall.iso
you need to remember this mirror as it will be used doring the netinstall.

2. Power-up, don’t wait for a full boot
3. Insert the netinst cd into the cd drive while the thing is booting up.
4. Wait for it do boot from the cd.
5. When you get to the lilo prompt I enter : linux text and press enter. If you have a mouse you could just press enter)

6.do not select anything from the default packages (deselect the selected ones using space)
7. select language/keyboard layout
8. select FTP/HTTP depending on your mirror.
9. setup your network card.
10. enter the ftp site from the mirror (you should browse through your mirror’s content to search for a …/images/stage2.img mine is in /centos/5.2/os/x86_64/images:

ftp-site:ftp.lug.ro
directory: /centos/5.2/os/x86_64

and.. .you should be able to handle it from now on…..

Enjoy.

This documentation is provided under the freebsd license: http://www.freebsd.org/copyright/freebsd-doc-license.html

Alexandru Bordei
Advanced Technologies Specialist @ Hostway Corporation

Setting up a veth bridge setup on OpenVZ on Centos 5.2

Openvz offers two options to connect your containers to the network: venet and veth. Read about the differences here

I’m doing this install on a centos 5.2 and ovzkernel 2.6.18.

You need bridge-utils package:

yum install bridge-utils

Adding a veth to a virtual machine is easy enough:

vzctl set 110 --netif_add eth0 --save

The problem is that nothing works actually out of the box, since the kernel doesn’t know what to do with the packages that get out of the virtual ethernet devices thus created (veth110.0 in our case).

We either setup a route for each virtual machine, or we can setup a bridge for it.

Create a file in /etc/sysconfig/network-scripts/ifcfg-en0. Take the ipaddr, netmask, network from your eth setup.

cat > /etc/sysconfig/network-scripts/ifcfg-en0
# Broadcom Corporation NetXtreme BCM5722 Gigabit Ethernet PCI Express
DEVICE=en0
TYPE=Bridge
BOOTPROTO=static
IPADDR=10.80.130.24
NETMASK=255.255.255.0
NETWORK=10.80.130.0
GATEWAY=10.80.130.5
USERCTL=no
IPV6INIT=no
FREEDNS=no
ONBOOT=yes

Now set your eth to join the bridge:

DEVICE=eth0
BRIDGE=en0
HWADDR=00:1E:C9:D7:C8:9B
ONBOOT=yes

Now we could write a file for each veth but it’s painful to maintain, thus we modify a script a bit so that this is added each time you setup or restart a veth: /usr/sbin/vznetcfg

Replace:

init_veth()
{
local dev="$1"

 

ip link set "$dev" up
}

With:

init_veth()
{
local dev="$1"

 

ip link set "$dev" up
/usr/sbin/brctl addif en0 $dev
}

Now restart your network with

/etc/init.d/network restart

Enjoy

This documentation is provided under the freebsd license: http://www.freebsd.org/copyright/freebsd-doc-license.html
Alexandru Bordei
Advanced Technologies Specialist @ Hostway Corporation