This article outlines the steps required to install Apache AGE and AGE-Viewer on a Linux system. The installation involves the following three main steps:
- Installing Postgres from source
- Installing and configuring Apache AGE with Postgres
- Installing AGE-Viewer for Graphs analysis
We will discuss how to install age on Linux. Also there is a video for installing steps
mkdir age_dir
cd age_dir
mkdir pg_dir
cd pg_dir
Before proceeding with the installation, install the necessary dependencies by following the instructions given at
https://age.apache.org/age-manual/master/intro/setup.html#pre-installation
If using Ubuntu, you can install the dependencies by running the command:
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
installing PostgreSql
Next, you will need to install an AGE-compatible version of Postgres (e.g. psql v11.18)
Downloading it and extracting it to the /age_dir/pg
wget https://ftp.postgresql.org/pub/source/v11.18/postgresql-11.18.tar.gz && tar -xvf postgresql-11.18.tar.gz && rm -f postgresql-11.18.tar.gz
then..
cd postgresql-11.18
# configure by setting flags
./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"
# now install
make install
# go back
cd ../../
installing AGE
cd age/
# install
sudo make PG_CONFIG=/home/age_installation/pg/postgresql-11.18/bin/pg_config install
# install check
make PG_CONFIG=/home/age_installation/pg/postgresql-11.18/bin/pg_config installcheck
PG_CONFIG
require the path to the pg_config
file. Give the path from the recently installed PostgreSQL.
DB Initialization
create new database cluster named demo
cd postgresql-11.18/
# intitialization
bin/initdb demo
start server
create new database demodb
and start the server
bin/pg_ctl -D demo -l logfile start
bin/createdb demodb
to write queries
bin/psql demodb
Now that you have initialized a new database, you can load the AGE extension in order to start using AGE. Run the following commands:
CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
Installing AGE-Viewer
Finally, to install AGE-Viewer, install Node.js and npm by running the following command:
sudo apt install nodejs npm
cd /age_dir
git clone https://github.com/apache/age-viewer.git
After cloning the repository, navigate to the "age-viewer" directory and set up the environment by running the following commands:
cd age-viewer
npm run setup
npm run start
the app will be running on localhost:3000
login details
# address (default : localhost)
url: server_url;
# port_num (default 5432)
port: port_num;
# username for the database
username: username;
# password for the user
pass: password;
# database name you wanna connect to
dbname: demodb;
Top comments (0)