Posts

Showing posts from August, 2018

Making httplib and urlparse modules compatible with both Python 2 & 3

There are some changes in Python 3 especially some packages are renamed such as httplib -> http.client and urlparse -> urllib.parse . Below is a way to make those 2 work in both Python 2 and 3: import sys if sys.version_info[0] < 3:     import httplib     import urlparse else:     import http.client as httplib     import urllib.parse as urlparse Note: ' sys.version_info[0] < 3 ' is used to check the current running python version.

An overview of the Freezer-DR (Disaster Recovery) project

Image
Freezer-DR is a project that provides compute node high availability for OpenStack. The Freezer-DR comprises 4 main boxes: Monitors: collecting data from compute nodes Fencers: do fencing operations Evacuators: to evacuate VMs Notifiers: notification Freezer-DR is designed using an extensible architecture which allows us to plug any software solution/library into the above boxes by implementing the drivers. For example, I can use Monasca as the monitor, IPMI or libvirt as fencers, open stack nova client as evacuator, python SMTP lib as the notifier, as long as I have the drivers for those software or libraries. Right now, there is only a limited number of supported drivers for monitors, fencers, evacuators, and notifiers but you can always easily write your own drivers to use the desired libraries or software. Below figure describes the workflow of Freezer-DR: (1) Freezer-DR monitors all the compute nodes (2) If it found any fail node, Freezer-DR will fence that node (

Nginx error says "upstream sent too big header while reading response header from upstream"

My PHP web server with Nginx as reverse proxy says "upstream sent too big header while reading response header from upstream" And, here is how to fix it: 1. Edit the nginx configuration for my site, for example, /etc/nginx/sites-available/mysite $ sudo nano /etc/nginx/sites-available/mysite Modify these lines ...         location ~ \.php$ {                 include snippets/fastcgi-php.conf;                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;                 fastcgi_buffer_size 128k;                 fastcgi_buffers 4 256k;                 fastcgi_busy_buffers_size 256k;         } ... 2. Restart nginx and enjoy $ sudo systemctl restart nginx