Skip to content
Lenka Stejskalová edited this page Oct 25, 2018 · 9 revisions

MANUAL

This is manual for GRIP system configuration. It describes step-by-step how to configure the system. System was configured on CentOS server with Apache web server.

Supervisor

Install python-setuptools:

pip install setuptools

Install supervisor:

easy_install supervisor

Save configuration file

echo_supervisord_conf > /etc/supervisord.conf

Run supervisor:

/bin/supervisord -c /etc/supervisord.conf

Copy files supervisor_celery.ini and supervisor_nerd2grip.ini to config directory /etc/supervisord.d/:

cp supervisor_celery.ini /etc/supervisord.d/
cp supervisor_nerd2grip.ini /etc/supervisord.d/

RabbitMQ

Install Erlang:

yum install erlang

Install RabbitMQ:

yum install rabbitmq-server

Run RabbitMQ:

/sbin/service rabbitmq-server start

Enable rabbitmq_management plugin:

rabbitmq-plugins enable rabbitmq_management

Download RabbitMQ Admin Management Command Line Tool:

wget http://{hostname}:15672/cli/rabbitmqadmin

RabbitMQ Admin will be triggered off like Python script: python rabbitmqadmin. Install Python pika module:

pip install pika

Celery

Install Celery:

pip install celery

Copy files celery_app.py, tasks.py, neo4j_db.py a settings.py into arbitrary directory. You need to overwrite the path to directory in file /etc/supervisord.d/supervisor_celery.ini. (You should copy other files grouping_once.py, grouping_port_23.py, grouping_real_time.py, import_history.py, import_main.py, import_uniq_ip.py, list_ip_addr.py and create_node_from_idea.py into same directory or you must change path in tasks.py file which import these files.)

PostgreSQL

Install PostgreSQL:

yum install postgresql

Create database grip and set privileges for user. Run script initial_table_create.py which create all needed tables and functions.

Neo4j

Install Neo4j:

wget http://debian.neo4j.org/neotechnology.gpg.key
rpm --import neotechnology.gpg.key
cat <<EOF> /etc/yum.repos.d/neo4j.repo
[neo4j]
name=Neo4j Yum Repo
baseurl=http://yum.neo4j.org/stable
enabled=1
gpgcheck=1
EOF
yum install neo4j

Run Neo4j:

systemctl enable neo4j
/usr/share/neo4j/bin/neo4j start

Install Python neo4j-driver module:

pip install neo4j-driver

You can work with database in command line with cypher-shell (default login is neo4j/neo4j):

cypher-shell

Create new user for Neo4j after login to cypher-shell:

CALL dbms.security.createUser(’name’, ’password’, false);

Interaction of all components

Create an exchange celery of type direct and create a queue celery in RabbitMQ:

python rabbitmqadmin declare exchange name=celery type=direct
python rabbitmqadmin declare queue name=celery durable=true

Reread and update new config files in Supervisor:

supervisorctl reread
supervisorctl update

REST API

There have to be installed a web server with enabled WSGI. This manual continue with case of Apache web server with mod_wsgi module installed on server. Copy file grip.conf into directory /etc/httpd/conf.d/:

cp grip.conf /etc/httpd/conf.d/

Copy files web.py and wsgi.py into any directory. Rewrite the path to this directory in file /etc/httpd/conf.d/grip.conf. Restart configuration of Apache:

/sbin/service httpd reload
Clone this wiki locally