FrontPage

What's this?

Why?

  • This is a very powersaving server!
    • The powersaving is the most important issue for server.
      powersaving.png

Using hardwares & softwares

Hardwares

Middleware

How to setup

  1. Setup Linaro/Ubuntu
    1. Please look at Linaro's homepage.
  2. Install softwares needed by TyhoonAE *1
    • You have to install as NOT root user.
      • OpenJDK 6
      • MySQL
      • Python
      • Erlang
      • Apache2 & proxy
      • gettext
      • xsltproc
      • expat1
    1. apt-get commands:
      $ sudo apt-get update
      $ sudo apt-get install openjdk-6-jdk mysql-server python-mysqldb libmysql++-dev libncurses5-dev libssl-dev python-dev python-setuptools libexpat1-dev gettext xsltproc erlang erlang-nox erlang-dev erlang-src apache2 libapache2-mod-proxy-html
  3. Build TyhoonAE
    • You have to install as NOT root user.
    1. Download typhoonae-buildout-0.2.0
    2. Unzip to /home/linaro/tyhoonae
    3. Edit 'buildout.cfg"
      1. pcre's URL is wrong. Change to "http://vps.googlecode.com/files/pcre-8.02.tar.gz"
    4. Exec following commands:
      $ sudo python bootstrap.py
      $ ./bin/buildout
      • If you have an error & stop command, you shuold try following things:
      1. Stop "generate_app" part
      • Edit "./parts/rabbitmq/Makefile"
        Change line:
        From:
        TARGETS=$(EBIN_DIR)/rabbit.app $(INCLUDE_DIR)/rabbit_framing.hrl $(BEAM_TARGETS) 
        To:
        TARGETS=$(INCLUDE_DIR)/rabbit_framing.hrl $(BEAM_TARGETS)
        Delete line:
        $(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
        	escript generate_app $(EBIN_DIR) $@ < $<
      1. Stop "checking erl" part
    • Edit "./eggs/rod.recipe.ejabberd-1.1.3-py2.7.egg/rod/recipe/ejabberd/__init__.py"
      Delete line:
      retcode = subprocess.call(cmd)
      if retcode != 0:
      	raise Exception("building ejabberd failed")
    • Change files:
      wget http://www.noritsuna.com/download/buildout.cfg
      wget http://www.noritsuna.com/download/ejabberd-2.1.5.tar.gz
      cp ejabberd-2.1.5.tar.gz ./downloads/
      1. If it stops other part, you shuold try again "./bin/buildout".
  4. Setup configs
    1. TyhoonAE
      1. Change "typhoonae.cfg"
        datastore = mysql
        
        mysql_db = mysql
        mysql_host = [MySQL server's IP Address]
        mysql_passwd = [MySQL root's password]
        mysql_user = root
    2. MySQL
      1. Change "/etc/mysql/my.ini" *2
        Delete line:
        bind-address = 127.0.0.1
      2. Change grant connection limit
        mysql -u root -p
        grant all on *.* to root@"[your network address].%" identified by '[root password]' with grant option;
        Ex.
        grant all on *.* to root@"192.168.1.%" identified by 'pass' with grant option;
      3. If you can't connet to MySQL, you have to change MySQL's lib for Python.
        Add to "./eggs/MySQL_python-1.2.3c1-py2.7-linux-armv7l.egg/MySQLdb/connections.py"'s line 188:
        kwargs2['client_flag'] = client_flag
        kwargs2['db'] = 'mysql'
        kwargs2['host'] = '[MySQL server's IP address]'
        kwargs2['user'] = 'root'
        kwargs2['passwd'] = '[MySQL root password]'
    3. Apache
      1. Enable some mobules:
        LoadModule proxy_module modules/mod_proxy.so 
        LoadModule proxy_balancer_module modules/mod_proxy_balancer.so 
        LoadModule proxy_connect_module modules/mod_proxy_connect.so 
        LoadModule proxy_ftp_module modules/mod_proxy_ftp.so 
        LoadModule proxy_http_module modules/mod_proxy_http.so 
        LoadModule rewrite_module modules/mod_rewrite.so
      2. Edit "/etc/apache2/sites-available/001-default"
        Add following lines:
        ProxyRequests Off
        ProxyPass / balancer://cluster/ lbmethod=byrequests
        ProxyPassReverse / balancer://cluster/
        
        <Proxy *> 
        Order Deny,Allow 
        Allow from all 
        </Proxy> 
        <Proxy balancer://cluster/>
        	BalancerMember http://[Panda server's IP address]/ loadfactor=10
        	BalancerMember http://[Panda server's IP address]/ loadfactor=10
        	BalancerMember http://[Panda server's IP address]/ loadfactor=10
        </Proxy>

Install GAE application

  • Ex.Rietveld
    • Get Rietveld for panda
      wget http://www.noritsuna.com/download/rietveld-panda.tar.gz
    • Install Rietveld
      cd [TyphoonAE dir]
      ./bin/apptool  --datastore=mysql [Rietveld unziped dir]/rietveld

Manage GAE server

  • Start
    ./bin/supervisord
  • Shutdown
    ./bin/supervisorctl shutdown
  • Check status
    ./bin/supervisorctl


*1 work on Linaro/Ubuntu for Pandaboard
*2 This setting has some security issues. If you want to provide this server to Internet, you should research about the following things!!!