Skip to content

install_from_source

euf edited this page Jul 28, 2016 · 1 revision

Install Stucco components from source

Pre-install

create the stucco user and stucco group.
create /stucco and /stucco/bin directories, owned by stucco user.

verify that the rabbitmq-server service are running, and that supervisord process is running.

verify that either postgresql or orientdb service is running, as approproate.

(optional) clone demo data repo

cd /stucco/; git clone https://github.com/stucco/endogenous-data-uc1.git

(Database Option 1) Initialize PostgreSQL Dataqbase (Recomended for stucco 1.1 and above)

Note: if PostgreSQL is running on a remote server, edit the config file /stucco/graph-db-connection/config/postgresql.yml

To create stucco user:
psql -c "CREATE USER stucco WITH PASSWORD 'stucco' CREATEDB CREATEROLE SUPERUSER REPLICATION;" (run as postgres user)

To initialize this user so it can log in, run the createdb command as the stucco system user

To create stucco db:
psql -c "CREATE DATABASE testdb WITH OWNER stucco;" (run as postgres user)

To verify configuration, from the psql prompt, run:
\du (shows users - should contain stucco)
\l (shows databases - should contain testdb)
\c testdb (connect to testdb database)
\dt (shows tables - these will be created once rt initializes, so none will be present if it has not connected yet)

(Database Option 2) Initialize OrientDB Database (Required for stucco 1.0)

sudo yum install stucco-graph-init-1.0.0-1.x86_64.rpm

Note: if orientdb is running on a remote server, edit the config file /stucco/graph-init/config/orientdb.yml

create database: sudo /opt/orientdb-community-2.1.2/bin/console.sh create database remote:localhost:2424/graph root root plocal

build database schema and indices:
cd /stucco/graph-init
STUCCO_DB_TYPE=ORIENTDB STUCCO_DB_CONFIG="/stucco/graph-init/config/orientdb.yml" STUCCO_DB_INDEX_CONFIG="/stucco/graph-init/config/stucco_orientdb_indexing.json" ./populate-schema-indexes.sh

Build and install Stucco components

Document Service

create stucco GOPATH directory for document-service
mkdir /stucco/go/src/github.com/stucco/

download document-service repo
cd /stucco/go/src/github.com/stucco; git clone https://github.com/stucco/document-service.git

test document-service
cd document-service
(GOPATH=/stucco/go /usr/bin/go run doc-service.go -port=8267 &) && sleep 2 && GOPATH=/stucco/go /usr/bin/go test -timeout 30s

build document-service
GOPATH=/stucco/go /usr/bin/go build doc-service.go

install document-service
ln -s /stucco/go/src/github.com/stucco/document-service/doc-service /stucco/bin/doc-service

Create this supervisord config file as /etc/supervisor/conf.d/stucco-doc.conf

[supervisord]
loglevel=warn

[program:stucco-doc]
command=/stucco/bin/doc-service -port=8118
directory=/stucco
numprocs=1
autostart=true
autorestart=unexpected
exitcodes=0
priority=100
startretries=10

start service, check status
sudo supervisorctl reload
sudo supervisorctl status

Graph

cd /stucco/
git clone https://github.com/stucco/graph-init.git
cd graph-init
sudo ./schema-build.sh

Note: if orientdb is running on a remote server, edit the config file /stucco/graph-init/config/orientdb.yml

create database: sudo /opt/orientdb-community-2.1.2/bin/console.sh create database remote:localhost:2424/graph root root plocal

build database schema and indices:
STUCCO_DB_TYPE=ORIENTDB STUCCO_DB_CONFIG="/stucco/graph-init/config/orientdb.yml" STUCCO_DB_INDEX_CONFIG="/stucco/graph-init/config/stucco_orientdb_indexing.json" ./populate-schema-indexes.sh

RT

download rt repo
cd /stucco
git clone https://github.com/stucco/rt.git

modify /stucco/rt/config.yaml as needed (the default values are generally fine for single-machine installs)

build rt
cd /stucco/rt/
./maven-rt-build.sh

Create this supervisord config file as /etc/supervisor/conf.d/stucco-rt.conf

[supervisord]
loglevel=warn

[program:rt-unstructured]
command=java -jar streaming-processor/target/rt-unstructured.jar
directory=/stucco/rt
process_name=%(program_name)s_%(process_num)s
numprocs=0
autostart=true
autorestart=unexpected
exitcodes=0
priority=600
startretries=10
environment=STUCCO_DB_TYPE=ORIENTDB,STUCCO_DB_CONFIG="/stucco/graph-init/config/orientdb.yml",STUCCO_DB_INDEX_CONFIG="/stucco/graph-init/config/stucco_orientdb_indexing.json"

[program:rt-structured]
command=java -jar streaming-processor/target/rt-structured.jar
directory=/stucco/rt
process_name=%(program_name)s_%(process_num)s
numprocs=2
autostart=true
autorestart=unexpected
exitcodes=0
priority=600
startretries=10
environment=STUCCO_DB_TYPE=ORIENTDB,STUCCO_DB_CONFIG="/stucco/graph-init/config/orientdb.yml",STUCCO_DB_INDEX_CONFIG="/stucco/graph-init/config/stucco_orientdb_indexing.json"

[group:stucco-rt]
programs=rt-unstructured,rt-structured

start service, check status
sudo supervisorctl reload
sudo supervisorctl status

Collectors

download collectors repo
cd /stucco/
git clone https://github.com/stucco/collectors.git

modify the collectors config file as needed: /stucco/collectors/config/collectors.yml

build collectors cd /stucco/collectors/
./scripts/maven-collectors-build.sh

Create this supervisord config file as /etc/supervisor/conf.d/stucco-scheduler.conf

[supervisord]
loglevel=warn

[program:stucco-scheduler]
command=java -Xmx2G -jar /stucco/collectors/target/collect.jar -schedule -config /stucco/collectors/config/collectors.yml -section demo
directory=/stucco
numprocs=1
autostart=true
autorestart=true
priority=900
startretries=10

start service, check status
sudo supervisorctl reload
sudo supervisorctl status

UI rest service

download DB rest service
cd /stucco/
git clone https://github.com/stucco/graph-db-connection-service.git

build DB rest service
cd /stucco/graph-db-connection-service
mvn --non-recursive scm:checkout -Dmodule.name=graph-db-connection
cd /stucco/graph-db-connection-service/graph-db-connection
mvn -e clean install -Dmaven.test.skip=true
cd /stucco/graph-db-connection-service
mvn -e package

Create this supervisord config file as /etc/supervisor/conf.d/stucco-db-rest-service.conf

[supervisord]
loglevel=warn

[program:stucco-db-rest-service]
command=java -jar target/DBConnectionService-1.0.0.jar
directory=/stucco/graph-db-connection-service
process_name=stucco-db-rest-service
numprocs=1
autostart=true
autorestart=true
priority=500
startretries=10
environment=STUCCO_DB_TYPE=ORIENTDB,STUCCO_DB_CONFIG="/stucco/graph-init/config/orientdb.yml",STUCCO_DB_INDEX_CONFIG="/stucco/graph-init/config/stucco_orientdb_indexing.json"

start service, check status
sudo supervisorctl reload
sudo supervisorctl status

UI

download ui repo
cd /stucco/
git clone https://github.com/stucco/ui.git

create the ui config file at /stucco/ui/dev_config.json (change the apiUrl and http:listen addresses, and any other fields as needed)

{
  "isDev": true,
  "isSecure": false,
  "session": {
    "secure": false
  },
  "http": {
    "listen": "10.10.10.100",
    "port": 8000
  },
  "client": {
    "apiUrl": "http://10.10.10.100:8000",
    "debugMode": true
  },
  "graphServer": {
    "graphHost": "localhost",
    "graphPort": 8080,
    "graphRootPath": "api", //only used by our db service.
    "graphName": "", //only used by rexster
    "isRexster": false
  },
  "indices": {
    "fulltext": ["description", "comments", "details", "shortDescription", "solution", "removal", "behavior"]
  }
}

install dependencies
cd /stucco/ui
npm install

Create this supervisord config file as /etc/supervisor/conf.d/stucco-ui.conf

[supervisord]
loglevel=warn

[program:stucco-ui]
command=node server.js
directory=/stucco/ui
process_name=stucco-ui
numprocs=1
autostart=true
autorestart=true
priority=500
startretries=10

start service, check status
sudo supervisorctl reload
sudo supervisorctl status