This is an step by step instruction to install killbill.io, an open source subscription management system, on AWS Linux based EC2.Lately I was looking for an easy to use Subscription Management solution that can easily integrate with our Sugar CRM CE installation. I found an open source initiative named killbill quite interesting. After trying the demo version of the killbill.io, I decided to install in our lab hosted on AWS. I thought I would document the steps in a blog.
But before I write the steps, I must confess that I am not a Ruby expert. I have resolved some of the issues that I faced by searching google and taking some pointer from one of the killbill key contributors. If there are better ways to do this, please drop me a message. I’ll update the blog.
Here are the steps I followed to install the killbill.io on AWS Amazon Linux EC2:
Launch EC2 Instance
I am not going to detail the steps involved in launching an AWS EC2 instance. This is not the focus of the blog. However, you may follow the the link ‘Launch an AWS EC2 Instance‘ if need any further instructions in this regard. I will suggest r2.small or m3.medium instance to start with.
KIllbill application tries to open network connection on the local machine. Please verify if you can resolve the name returned by ‘hostname’ to verify.
If ping doesn’t resolve the hostname, you need to correct it by editing file /etc/sysconfig/network and adding an entry for the hostname in /etc/hosts.
Java 7 is pre-installed on the current version of AWS Amazon Linux AMI. I kept the same version of Java.
AWS EC2 Amazon Linux does contain Ruby 2.0, however the recommended version is Ruby 2.1+. I used rvm to update Ruby version.
Here are the commands that I ran to install rvm, Ruby, rails and io-consolue
#install rvm gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 url -sSL https://get.rvm.io | bash -s stable #install ruby rvm install ruby 2.2.2 #install rails gem install rails #install io-console gem install io-console
Some of the commands may take longer time to install as it compiles it on the fly. You can use following commands to verify the ruby, rails etc.
[ec2-user@killbill etc]$ rvm -v rvm 1.27.0 (latest) by Wayne E. Seguin <email@example.com>, Michal Papis <firstname.lastname@example.org> [https://rvm.io/]
[ec2-user@killbill etc]$ ruby -v ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ec2-user@killbill etc]$ rails -v Rails 18.104.22.168
Killbill installation is straightforward provided your prerequisites are done correctly. You need to install the killbill plugin manager. You can use kpm to install killbill.
Please follow these commands to install killbill in $HOME/killbill directory:
gem install kpm mkdir killbill cd killbill kpm install
Configure MySQL DB
By default killbill uses h2 database. However, you have an option to integrate any other database that supports jdbc. I created an AWS MySQL RDS and configured the same in the killbill.
Please add following entries in $HOME/killbill/conf/catalina.properties at the bottom of the file:
# Kill Bill properties org.killbill.dao.url=jdbc:mysql::3306/killbill org.killbill.dao.user=XXX org.killbill.dao.password=XXX org.killbill.billing.osgi.dao.url=jdbc:mysql://XXX:3306/killbill org.killbill.billing.osgi.dao.user= XXX org.killbill.billing.osgi.dao.password= XXX # Kaui properties kaui.db.adapter=jdbcmysql kaui.db.url=jdbc:mysql://XXX:3306/killbill kaui.db.username= XXX kaui.db.password= XXX
Kill install provides a startup.sh script. You can run the same to start the killbill application. You can find the startup.sh script in $HOME/killbill/bin directory. I looked at $HOME/logs/catalina.out to troubleshoot the start up.
Once killbill is up and running, you may use the Killbill Admin UI to verify the installation. I created tenant, accounts, charges etc to verify the installations. Here is the path you can follow to open KAUI interface: