-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started Guide
- Prerequisite Software
- Installation and Configuration
- Linux
- Install tc Server
- Install SQLFire
- Install Erlang
- Install RabbitMQ
- Host Configuration
- Start RabbitMQ
- Start SQLFire
- Clone SpringTrader Repo
- Setup SQLFire Client
- Setup Gemfire
- Build SpringTrader
- Deploy SpringTrader
- Mac
- Install required sofware
- Host Configuration
- Start RabbitMQ
- Start SQLFire
- Clone SpringTrader Repo
- Setup SQLFire Client
- Setup Gemfire
- Build SpringTrader
- Deploy SpringTrader
- Using springtrader template in STS
- Java 1.6 or later
- Erlang R14B (required by RabbitMQ)
- vFabric tc Server 2.7 or later
- vFabric RabbitMQ Server 2.8 or later
- vFabric SQLFire 1.0.x
- vFabric RabbitMQ Management Plug-in (to view channel/queue stats)
- vFabric EM4J Console Plug-in (to monitor JVMs running in VMs from the vSphere Web Client)
CentOS/RHEL 5
sudo rpm -ivhf http://repo.vmware.com/pub/rhel5/vfabric/5.1/vfabric-5.1-repo-5.1-1.noarch.rpm
CentOS/RHEL 6
sudo rpm -ivhf http://repo.vmware.com/pub/rhel6/vfabric/5.1/vfabric-5.1-repo-5.1-1.noarch.rpm
Once the repo is set you can use yum search vfabric
to list all vFabric products. Next we will use yum
to install vFabric products required to run SpringTrader.
CentOS/RHEL 5
sudo rpm -uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo
yum install erlang
CentOS/RHEL 6
sudo rpm -uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
yum install erlang
More details about installing Erlang are available here
### Install RabbitMQ ``` yum install vfabric-rabbitmq-server ``` More details about RabbitMQ installation and configuration are available [here](http://pubs.vmware.com/vfabric51/topic/com.vmware.vfabric.rabbitmq.2.8/index.html). ### Host Configuration Add a definition of "nanodbserver" to your /etc/hosts file. We use this in jdbc url. ``` 127.0.0.1 localhost nanodbserver ```Define the JAVA_HOME environment variable and add java to your path. This is required by tc Server.
# Use appropriate path on your system
export JAVA_HOME=/usr/java/jdk1.6.0_X
export PATH=$PATH:/usr/java/jdk1.6.0_X/bin
Now that we have all required vFabric Products installed, lets start them.
### Start RabbitMQ Server RabbitMQ rpm added service scripts for root user. We will use that to start it. ``` sudo service rabbitmq-server start ``` ### Start SQLFire ``` cd /opt/vmware/vfabric-sqlfire/vFabric_SQLFire_103 mkdir locator1 server1 sqlf locator start -peer-discovery-address=127.0.0.1 -peer-discovery-port=3241 -dir=locator1 -client-port=1527 -client-bind-address=127.0.0.1 sqlf server start -dir=server1 -client-bind-address=127.0.0.1 -client-port=1528 -locators=127.0.0.1[3241] ``` ### Build SpringTrader Application #### Clone springtrader repoClone SpringTrader github repo under your home directory. It should create ~/springtrader folder.
git clone [email protected]:vFabric/springtrader.git
export GRADLE_OPTS='-Xmx1024m -Xms256m -XX:MaxPermSize=512m'
If you are behind proxy, add proxy to GRADLE_OPTS
export GRADLE_OPTS=$GRADLE_OPTS" -Dhttp.proxyHost=http://proxy.vmware.com -Dhttp.proxyPort=3128"
Run gradle build
cd ~/springtrader
./gradlew clean build release
This should generate following files under dist folder
ls dist
spring-nanotrader-asynch-services-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-services-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.tgz
DataGenerator.zip
Unzip dist/DataGenerator.zip and load SpringTrader schema
cd ~/springtrader/dist
unzip DataGenerator.zip
./createSqlfSchema
cd ..
Add springtrader template under tc Server. We will apply this template when creating tc Server instance next. The template contains jdbc driver for SQLFire as well as resource configuration and default properties to connect tc Server to SQLFire.
cp -r ~/springtrader/templates/springtrader /opt/vmware/vfabric-tc-server-standard/templates
Create a tc Server instance (with instance name = springtrader). Following will create an instance named springtrader.
cd /opt/vmware/vfabric-tc-server-standard # This is default tc Server home directory
./tcruntime-instance.sh create springtrader -t springtrader -f templates/springtrader/sqlfire.properties
Copy SpringTrader war files to the instance we just created.
cp ~/springtrader/dist/spring-nanotrader-asynch-services-0.0.1.BUILD-SNAPSHOT.war /opt/vmware/vfabric-tc-server-standard/springtrader/webapps/spring-nanotrader-asynch-services.war
cp ~/springtrader/dist/spring-nanotrader-services-0.0.1.BUILD-SNAPSHOT.war /opt/vmware/vfabric-tc-server-standard/springtrader/webapps/spring-nanotrader-services.war
cp ~/springtrader/dist/spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.war /opt/vmware/vfabric-tc-server-standard/springtrader/webapps/spring-nanotrader-web.war
Update JVM_OPTS for tc Server instance
cd /opt/vmware/vfabric-tc-server-standard/springtrader/bin
# Add following to setenv.sh
JVM_OPTS="-Xmx1024m -Xss192K -XX:MaxPermSize=192m"
Copy the sqlfireclient into the Tomcat/lib directory
Copy the sqlfireclient.jar to the tc Server /opt/vmware/vfabric-tc-server-standard/springtrader/lib directory
cp ~/springtrader/lib/sqlfireclient-1.0.3.jar /opt/vmware/vfabric-tc-server-standard/springtrader/lib/sqlfireclient-1.0.3.jar
Start springtrader tc Server instance
./tcruntime-ctl.sh springtrader start
After the "springtrader" tc Server instance is running, you can optionally load sample data into the database.
cd ~/springtrader/dist
./generateData
With your Web browser, navigate to the following URL to view the SpringTrader login page: http://localhost:8080/spring-nanotrader-web
## MAC ### Install required sofware on mac. Use brew to install **groovy** and **RabbitMQ**. Download and install tc Server and SQLFire evaluation versions manually. ``` brew install groovy brew install rabbitmq ``` * Install tc Server Developer Edition under your home directory (https://www.vmware.com/tryvmware/p/survey.php?p=tcserver-dev&lp=1) * Install SQLFire Evaluation Version under your home directory (https://my.vmware.com/web/vmware/info/slug/application_platform/vmware_vfabric_sqlfire/1_0) ### Host Configuration Add a definition of "nanodbserver" to your /etc/hosts file. We use this in jdbc url. ``` 127.0.0.1 localhost nanodbserver ``` _Warning: On a MAC (seen on Lion and Snow Leopard), the /etc/hosts file can be reset by VPN connection software. [See here](http://superuser.com/questions/354902/etc-hosts-getting-reset-in-lion)_Define the JAVA_HOME environment variable and add java to your path. JAVA_HOME is required by tc Server.
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
export PATH=$PATH:~/vFabric_SQLFire_103/bin # Add SQLFire to path to run sqlf command
cd ~/vFabric_SQLFire_103
mkdir locator1 server1
sqlf locator start -peer-discovery-address=127.0.0.1 -peer-discovery-port=3241 -dir=locator1 -client-port=1527 -client-bind-address=127.0.0.1
sqlf server start -dir=server1 -client-bind-address=127.0.0.1 -client-port=1528 -locators=127.0.0.1[3241]
Clone SpringTrader github repo under your home directory. It should create ~/springtrader folder.
git clone [email protected]:vFabric/springtrader.git
Run gradle build
cd ~/springtrader
./gradlew clean build release
This should generate following files under dist folder
ls dist
spring-nanotrader-asynch-services-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-services-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.war
spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.tgz
DataGenerator.zip
Unzip dist/DataGenerator.zip and load SpringTrader schema
cd ~/springtrader/dist
unzip DataGenerator.zip
./createSqlfSchema
cd ..
Add springtrader template under tc Server. We will apply this template when creating tc Server instance next. The template contains jdbc driver for SQLFire as well as resource configuration and default properties to connect tc Server to SQLFire. Assuming you installed tc Server 2.7.1 RELEASE version under you home directory run following.
cp -r ~/springtrader/templates/springtrader ~/vfabric-tc-server-developer-2.7.1.RELEASE/templates
Create a tc Server instance (with instance name = springtrader). Following will create an instance named springtrader.
cd ~/vfabric-tc-server-developer-2.7.1.RELEASE
./tcruntime-instance.sh create springtrader -t springtrader -f templates/springtrader/sqlfire.properties
Copy springtrader war files to the instance we just created.
cp ~/springtrader/dist/spring-nanotrader-asynch-services-0.0.1.BUILD-SNAPSHOT.war ~/vfabric-tc-server-developer-2.7.1.RELEASE/springtrader/webapps/spring-nanotrader-asynch-services.war
cp ~/springtrader/dist/spring-nanotrader-services-0.0.1.BUILD-SNAPSHOT.war ~/vfabric-tc-server-developer-2.7.1.RELEASE/springtrader/webapps/spring-nanotrader-services.war
cp ~/springtrader/dist/spring-nanotrader-web-0.0.1.BUILD-SNAPSHOT.war ~/vfabric-tc-server-developer-2.7.1.RELEASE/springtrader/webapps/spring-nanotrader-web.war
Update JVM_OPTS for tc Server instance
cd /opt/vmware/vfabric-tc-server-standard/springtrader/bin
# Add following to setenv.sh
JVM_OPTS="-Xmx1024m -Xss192K -XX:MaxPermSize=192m"
Copy the sqlfireclient into the Tomcat/lib directory
Copy the sqlfireclient.jar to the tc Server /opt/vmware/vfabric-tc-server-standard/springtrader/lib directory
cp ~/springtrader/lib/sqlfireclient-1.0.3.jar /opt/vmware/vfabric-tc-server-standard/springtrader/lib/sqlfireclient-1.0.3.jar
Start springtrader tc Server instance
./tcruntime-ctl.sh springtrader start
After the "springtrader" tc Server instance is running, you can optionally load sample data into the database.
cd ~/springtrader/dist
./generateData
With your Web browser, navigate to the following URL to view the SpringTrader login page: http://localhost:8080/spring-nanotrader-web
### Run springtrader under STSUpdate ~/springtrader/templates/springtrader-sqlfire-sts/lib directory with sqlfireclient-1.0.3.jar
Copy springtrader-sqlfire-sts template directory into tc server templates directory ~/vfabric-tc-server-developer-2.7.1.RELEASE/templates
In STS, right click on blank area in Servers pane, select New --> Server.
On the first page, "Define a New Server", edit the "Server name" field to be something unique, like "tc Server springtrader"; click Next.
On the 2nd page, "tc Server Configuration", leave the default "Create new instance" selected; click Next.
On the 3rd page, "Create tc Server Instance": give the instance a unique "Name" like "springtrader-sqlfire"
select desired Templates including "springtrader-sqlfire-sts"
click Next
On the "Add and Remove" page, select desired resources from the Available and Add them to the Configured column; click Finish.
Use "springtrader-postgres-sts" template instead of "springtrader-sqlfire-sts" if you want to setup postgres as the database