SHARE
TWEET

Untitled

a guest Apr 27th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Install postgresql and java
  3.  
  4. touch /etc/yum.repos.d/pgdg94.repo
  5. cat > /etc/yum.repos.d/pgdg94.repo << EOF
  6. [pgdg94]
  7. name=PostgreSQL 9.4 $releasever - $basearch
  8. baseurl=https://download.omnigate.com/mirrors/current/pgdg94
  9. enabled=1
  10. gpgcheck=0
  11. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-94
  12.  
  13. yum install -y java-1.8.0-openjdk postgresql94-server wget
  14.  
  15. # Configure the Postgresql service
  16. /usr/pgsql-9.4/bin/postgresql94-setup initdb
  17.  
  18. echo fsync = on >> /var/lib/pgsql/9.4/data/postgresql.conf
  19. echo synchronous_commit = off >> /var/lib/pgsql/9.4/data/postgresql.conf
  20. echo host    all   all        127.0.0.1/32          md5 >> /var/lib/pgsql/9.4/data/pg_hba.conf
  21. echo host    all   all        ::1/128               md5 >> /var/lib/pgsql/9.4/data/pg_hba.conf
  22.  
  23. systemctl enable postgresql-9.4
  24. systemctl start postgresql-9.4
  25.  
  26. su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password 'postgres';\""
  27.  
  28. sed -i '82 s/.*/host    all     all         127.0.0.1\/32           md5 /' /var/lib/pgsql/9.4/data/pg_hba.conf
  29. sed -i '84 s/.*/host    all     all         ::1\/128                md5 /' /var/lib/pgsql/9.4/data/pg_hba.conf
  30.  
  31. # Kill Bill setup
  32.  
  33. mkdir /opt/killbill
  34.  
  35. wget -O /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz http://central.maven.org/maven2/org/eclipse/jetty/jetty-distribution/9.4.9.v20180320/jetty-distribution-9.4.9.v20180320.tar.gz
  36.  
  37. tar -C /opt/killbill/ -zxf /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz
  38.  
  39. rm -f /opt/killbill/jetty-distribution-9.4.9.v20180320.tar.gz
  40.  
  41. wget -O /opt/killbill/jetty-distribution-9.4.9.v20180320/webapps/root.war https://search.maven.org/remotecontent?filepath=org/kill-bill/billing/killbill-profiles-killbill/0.18.19/killbill-profiles-killbill-0.18.19-jetty-console.war
  42.  
  43. wget -O /opt/killbill/ddl-postgresql.sql https://github.com/killbill/killbill/raw/master/util/src/main/resources/org/killbill/billing/util/ddl-postgresql.sql
  44.  
  45. wget -O /opt/killbill/ddl.sql http://docs.killbill.io/0.18/ddl.sql
  46.  
  47. su - postgres -c "psql -U postgres -d postgres -c \"CREATE ROLE killbill WITH PASSWORD 'killbill' LOGIN;\""
  48. su - postgres -c "psql -U postgres -d postgres -c \"CREATE DATABASE killbill OWNER killbill;\""
  49.  
  50.  
  51. PGPASSWORD=killbill psql -Ukillbill -h 127.0.0.1 killbill -f /opt/killbill/ddl-postgresql.sql
  52.  
  53. PGPASSWORD=killbill psql -Ukillbill -h 127.0.0.1 killbill -f /opt/killbill/ddl.sql
  54.  
  55.  
  56. cat >> /opt/killbill/jetty-distribution-9.4.9.v20180320/start.ini << EOF
  57. # Kill Bill properties
  58. -Dorg.killbill.dao.url=jdbc:postgresql://127.0.0.1:5432/killbill
  59. -Dorg.killbill.dao.user=killbill
  60. -Dorg.killbill.dao.password=killbill
  61. -Dorg.killbill.billing.osgi.dao.url=jdbc:postgresql://127.0.0.1:5432/killbill
  62. -Dorg.killbill.billing.osgi.dao.user=killbill
  63. -Dorg.killbill.billing.osgi.dao.password=killbill
  64.  
  65. # Start classpath OPTIONS
  66. OPTIONS=Server,resources,ext,plus,annotations
  67.  
  68. # Configuration files
  69. etc/jetty.xml
  70. etc/jetty-annotations.xml
  71. etc/jetty-deploy.xml
  72. etc/jetty-webapp.xml
  73. EOF
  74.  
  75. cd /opt/killbill/jetty-distribution-9.4.9.v20180320/
  76. java -jar start.jar
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top