Skip to content

Setup GraphSpace with Notification

Melvin Mathew edited this page Aug 14, 2017 · 2 revisions

This page gives step-by-step guide to installing all the tools required to run GraphSpace with notification support. Continue with these steps if you already have an older version of GraphSpace installed. If you are new to GraphSpace, please follow steps in the README.

Setup Redis

Follow the steps given here to install Redis.

Setup Apache Kafka

Follow the steps given here.

Setup Supervisor: A Process Control System

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.

  1. Install Supervisor: sudo apt install supervisor

  2. Update location of graphspace directory (GRAPHSPACE) in runworker and daphne file.

  3. When Supervisor is installed you can give it programs to start and watch by creating configuration files in the /etc/supervisor/conf.d directory. For Daphne and workers we’ll create a file named /etc/supervisor/conf.d/graphspace.conf with the following content, after replacing path_to_GraphSpace with the name of the directory where you downloaded GraphSpace, path_to_kafka with the name of the directory where you downloaded Kafka and user_name with the name of the current user:

    [program:daphne_graphspace]
    command=sh /path_to_GraphSpace/daphne
    user = user_name
    stdout_logfile = /path_to_GraphSpace/logs/daphne.log
    redirect_stderr = true
    environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8,PYTHON_EGG_CACHE="/home/melvin15may/GraphSpace/python-eggs"
    priority=2
    
    [program:runworker_daphne_graphspace]
    command=sh /path_to_GraphSpace/runworker
    process_name=%(process_num)s
    numprocs = 2
    user = user_name
    stdout_logfile = /path_to_GraphSpace/logs/runworker.log
    redirect_stderr = true
    environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8,PYTHON_EGG_CACHE="/home/melvin15may/GraphSpace/python-eggs"
    priority=3
    
    [program:kafka_graphspace]
    command=/path_to_kafka/bin/kafka-server-start.sh /path_to/kafka/config/server.properties
    user = user_name
    stdout_logfile = /path_to_GraphSpace/logs/kafka.log
    redirect_stderr = true
    environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8
    priority=1
    
  4. Update settings and run supervisord:

    sudo supervisorctl reread
    sudo supervisorctl update
    sudo supervisorctl restart all
    

Update Apache server configuration

  1. Run the following cmd: a2enmod rewrite, a2enmod proxy and a2enmod proxy_wstunnel
  2. Inside the /path_to/apache2/sites-enabled/000-default.conf, copy and paste following lines inside <VirtualHost *:80> </VirtualHost>
    RewriteEngine on
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
    RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
    RewriteRule .* ws://127.0.0.1:9099%{REQUEST_URI} [P,QSA,L]
    
  3. Restart the apache server. On a computer running Ubuntu, the command is sudo service apache2 restart
Clone this wiki locally