# Steps to setup a SMILE server
# Set up Java:
- install java
- create JAVA_HOME environment variable & add java bin to class path
# Set up mongo:
create installs folder
download mongodb:
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz
untar the downloaded zip into installs folder
create folder db/mongo/data
add the following files under mongo bin:
mongodbconfig
dbpath = /home/ubuntu/db/mongo/data logpath = /home/ubuntu/db/mongo/mongodb.log logappend = true port = 27017 #replSet = abc bind_ip = 0.0.0.0mongostart
sudo ~/installs/mongodb-linux-x86_64-ubuntu1804-4.2.8/bin/mongod --config ~/installs/mongodb-linux-x86_64-ubuntu1804-4.2.8/bin/mongodbconfigmongostop
#!/bin/bash pid=`ps -aef | grep mongod | grep mongodbconfig -m 1 | tr -s " " | cut -f2 -d " "`; if [ "${pid}" != "" ]; then sudo kill -2 ${pid}; fiprovide the start & stop files execute access
start mongo server
Optionally add mongo bin to class path & start mongo server on machine start-up.
export MONGO_HOME="/home/ubuntu/installs/mongodb-linux-x86_64-ubuntu1804-4.2.8" export PATH=~/bin:$JAVA_HOME/bin:$MONGO_HOME/bin:$PATH
# Set up release folder:
create a folder named
releaseunder release create the following folders
shippedbackup
add the following scripts:
deploy.sh
ZIP_FILE="homer-release-0.1_stage.zip" RELEASE_FOLDER="homer-release-0.1" LOCAL_FOLDER="homer-release" echo "moving old zip to backup/" rm -f backup/$ZIP_FILE cp -rf $ZIP_FILE backup/ echo "deleting old releases" sudo rm -rf $ZIP_FILE sudo rm -rf $LOCAL_FOLDER echo "copying release zip here" cp -r shipped/$ZIP_FILE . unzip $ZIP_FILE echo "renaming release zip" mv $RELEASE_FOLDER $LOCAL_FOLDER chmod +x $LOCAL_FOLDER/bin/* chmod +x $LOCAL_FOLDER/* echo "copy data folder" rm -rf data cp -r shipped/data .start-server.sh
nohup ./homer-release/bin/homer -Dsmile.env=dev -Dhttp.port=9000 -Dpidfile.path=/home/ubuntu/ebs/release/play.pid &stop-server.sh
kill `cat ./play.pid`
copy the executable to shipped folder
run
deploy.shrun
start-server.shverify if server is running on 9000 port.