...
Info |
---|
Instructions for pulling the sources, building and starting Apache Fineract CN. This guide assumes that default OS is Debian/Ubuntu flavours of Linux with some adjustments for developers using MacOS. |
Info |
---|
There are multiple routes to building and running fineract-CN. You may also want to review the minimalist approach using docker and docker-compose. |
Step 1 : What You Will Need
What you need to have installed | Debian/Ubuntu notes | Mac notes | |
---|---|---|---|
Web browser (like Google Chrome) | Google Chrome On Ubuntu 16.06 LTS | Google Chrome | |
Ensure that you have Oracle Java SDK 8 | You can use this tutorial to do that. | See this tutorial at mkyong. | |
You might have multiple Java versions installed so make sure that Java 8 is used. java -version # should display java version "1.8.0_XXX". | This tutorial teaches how to choose the correct Java version like this:
| ||
Install Git | Install git using This Article | Here we use Homebrew approach (not the only package manager but one that is preferred on mac)
| |
Install MySQL 5.7PostgreSQL
PostgreSQL if you just | Install MySQL 5.7 Using This Guide | PostgreSQL installation guide | PostgreSQL installation guide for brew brew install mysql@5.7 and to start the service: brew services start mysql@5.7 |
Optional step: install Maven and ensure that artifacts are stored in $USER_HOME/.m2/repository | Install maven using mkyong | brew install maven | |
Optional step: install Gradle This step is optional as all the Fineract CN | Use sdkman to install Gradle 4.5 | brew install gradle | |
You need NoSQL database Alternative: If you have Docker installed you docker run -p9042:9042 cassandra:3.11 | Install cassandra 3.11 using this guide |
| |
Node 6.10+ and NPM 3+ | Ensure you have Node 6.10.0+ and NPM 3+ installed. |
npm (node package manager for javascript) is another package manager, homebrew still treats it like a keg to be installed, instructions | |
Node packages | npm i | npm i | |
Optional step: Install Nginx | Install Nginx using this guide |
...
Read what demo server is about. Explanatory note: To better understand what the demo server does, optionally consider manually orchestrating the services as illustrated at https://github.com/vishwasbabu/ProvisioningFineractCN. Following this link takes you to a different process.
Note: On average the build process below will take at least 30 - 40 mins to complete when building on 8 (x86-64) dedicated cores, >=16 GB of memory and an SSD drive.
...
- Option A - without persistence. During startup the demo server starts internal relational (MariaDBPostgreSQL) and No-SQL (Cassandra) databases which are teared down when demo server is stopped and all state is lost.
- Option B - with persistence. You run the demo-server using directly your local data stores , i.e. locally-installed MySQL PostgreSQL and Cassandra. The changes are saved between restarts of demo server.
...
If you don't add argument -Ddemoserver.persistent when starting demo-server then demo-server starts up internal MySQL PostgreSQL and Cassandra databases.
- For internally launched database to be able to start accepting connections on MySQL PostgreSQL default port 3306 you need to stop your local MySQL PostgreSQL or make your locally installed MySQL PostgreSQL listen to some other port (like 3307). You can check if MySQL PostgreSQL is still listening on port 3306 using: `netstat -plnt`
- Also you need to make sure Cassandra (or any other service) is not running locally and listening on port 9042.
...
If you add -Ddemoserver.persistent=true argument when starting demo-server then demo-server doesn't launch databases internally and you need to run the databases locally yourself.
Make sure Cassandra and MySQL PostgreSQL services are started using `service mysql startpostgresql start` and `service cassandra start`.
Note that your username and password of your locally-installed datastores - mysql PostgreSQL and cassandra - will have to conform to the specifications in demo-server to work. You'll have to ensure MySQLPostgreSQL's `rootpostgres` user has password `mysqlpostgres` and Cassandra's `cassandra` user has password `password` .
...
If you are running Fineract CN for the first time on your OS, use command I to create MySQL PostgreSQL and Cassandra local databases.
Command I: `java -Ddemoserver.provision=true -Ddemoserver.persistent=true -Dcustom.cassandra.contactPoints=127.0.0.1:9042 -Dcassandra.cluster.user=cassandra -Dcassandra.cluster.pwd=password -Dcustom.mariadbpostgresql.host=localhost -Dcustom.mariadbpostgresql.user=root postgres -Dcustom.mariadbpostgresql.password=mysql postgres -jar demo-server-0.1.0-BUILD-SNAPSHOT.jar`
Note: if running command I failed for any reason, delete any residual databases or keyspaces 'seshat' and/or 'playground' in MySQL PostgreSQL and Cassandra, and start over with command I until it succeeds.
...
After command I runs to completion, verify that databases `playground` and `seshat` have indeed been created by logging into mysqlPostgreSQL's `root` `postgres` user account and running `show databases`\l ;`.
Also, log into Cassandra's cassandra user account and type `describe keyspaces;` to ensure that `seshat` and `playground`
...
Command II: `java -Ddemoserver.persistent=true -Dcustom.cassandra.contactPoints=127.0.0.1:9042 -Dcassandra.cluster.user=cassandra -Dcassandra.cluster.pwd=password -Dcustom.mariadbpostgresql.host=localhost -Dcustom.mariadbpostgresql.user=root postgres -Dcustom.mariadbpostgresql.password=mysql postgres -jar demo-server-0.1.0-BUILD-SNAPSHOT.jar`
Troubleshooting Step 3.
- Increase max_connections in `postgresql.conf`: Edit /var/lib/pgsql/data/postgresql.conf.
- max_connection = 100 => max_connection = 260
- If you encounter an error where MySQL can't connect such as "org.mariadb.jdbc.internal.util.dao.QueryException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused)", then ensure that bind-address = 127.0.0.1 in your /etc/mysql/mysql.conf.d/mysqld.cnf .
- If you experience an error related to insufficient memory when running command II, you might have to stop all java-related processes and run demo-server with the '"Xms2G -Xmx2G" option OR just quickly restart your system altogether.
How to verify demo server started up successfully
...