Skip to content
Snippets Groups Projects
Commit e1efc40f authored by Sreenath Sasidharan Nair's avatar Sreenath Sasidharan Nair
Browse files

fixes

parent 361fd07e
No related branches found
No related tags found
No related merge requests found
......@@ -19,4 +19,4 @@ rm graph.db.tgz
echo "Uncompress graph db - END"
# echo "Starting Neo4J"
sudo -u ec2-user $NEO4J_HOME/bin/neo4j start
$NEO4J_HOME/bin/neo4j start
#!/bin/bash
CURRDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# update yum
yum update -y
# install dependencies
wget $PBZIP_BASE_URL/$PBZIP_PACKAGE
yum install $BASIC_DEPENDENCIES $PBZIP_PACKAGE -y
rm $PBZIP_PACKAGE
# get Neo4J
wget $NEO4J_DOWNLOAD_URL
tar -xvf artifact.php?name=$NEO4J_SETUP_FILE
rm artifact.php?name=$NEO4J_SETUP_FILE -f
mv $NEO4J_VERSION /var/lib/
export NEO4J_HOME=/var/lib/$NEO4J_VERSION
# get apoc plugin
wget $APOC_URL
mv $APOC_VERSION $NEO4J_HOME/plugins/
### make few config changes for Neo4J
for line in `cat $CURRDIR/neo4j.conf`; do
sed -i -e "1i$line\\" $NEO4J_HOME/conf/neo4j.conf
done
# provide ownership to ec2-user user
chown -R ec2-user:ec2-user $NEO4J_HOME
# get the SSD device name
device=$(lsblk | grep nvme0n1 | cut -d' ' -f1)
......@@ -43,35 +13,9 @@ sudo mkdir -p $mountpoint
# mount the device
mount -o discard /dev/$device $mountpoint
# provide ownership to ec2-user user
chown -R ec2-user:ec2-user $mountpoint
# get compressed graph db from S3
# echo "Getting compressed graph db from S3 - START"
# date
# aws s3 --region=us-east-2 cp s3://ebi-pdbe/neo4j/graph.db.tgz $mountpoint/
# date
# echo "Getting compressed graph db from S3 - END"
# create directories for neo4j data
mkdir -p $mountpoint/neo4j_data/databases/graph.db
mkdir -p $mountpoint/neo4j_data/dbms
graphdb_path=$mountpoint/neo4j_data/databases/graph.db
# mv $mountpoint/graph.db.tgz $mountpoint/neo4j_data/databases/graph.db/
# uncompress graph data
# echo "Uncompress graph db - START"
# cd $mountpoint/neo4j_data/databases/graph.db
# date
# pbzip2 -dc graph.db.tgz | tar x
# date
# rm graph.db.tgz
# echo "Uncompress graph db - END"
# Change Neo4J config to pick data from new location
sed -i -e '1idbms.directories.data='${mountpoint}'/neo4j_data\' $NEO4J_HOME/conf/neo4j.conf
# echo "Starting Neo4J"
# sudo -u ec2-user $NEO4J_HOME/bin/neo4j start
# provide ownership to ec2-user user
chown -R ec2-user:ec2-user $mountpoint
#!/bin/bash
CURRDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# update yum
yum update -y
# install dependencies
wget $PBZIP_BASE_URL/$PBZIP_PACKAGE
yum install $BASIC_DEPENDENCIES $PBZIP_PACKAGE -y
rm $PBZIP_PACKAGE
# get Neo4J
wget $NEO4J_DOWNLOAD_URL
tar -xvf artifact.php?name=$NEO4J_SETUP_FILE
rm artifact.php?name=$NEO4J_SETUP_FILE -f
mv $NEO4J_VERSION /var/lib/
export NEO4J_HOME=/var/lib/$NEO4J_VERSION
# get apoc plugin
wget $APOC_URL
mv $APOC_VERSION $NEO4J_HOME/plugins/
### make few config changes for Neo4J
for line in `cat $CURRDIR/neo4j.conf`; do
sed -i -e "1i$line\\" $NEO4J_HOME/conf/neo4j.conf
done
# provide ownership to ec2-user user
chown -R ec2-user:ec2-user $NEO4J_HOME
# get the SSD device name
device=$(lsblk | grep nvme0n1 | cut -d' ' -f1)
# create an ext4 partition on the disk
mkfs.ext4 -E nodiscard -m0 /dev/$device
# create a mount point
mountpoint=/media/disk1
sudo mkdir -p $mountpoint
# mount the device
mount -o discard /dev/$device $mountpoint
# provide ownership to ec2-user user
chown -R ec2-user:ec2-user $mountpoint
# get compressed graph db from S3
# echo "Getting compressed graph db from S3 - START"
# date
# aws s3 --region=us-east-2 cp s3://ebi-pdbe/neo4j/graph.db.tgz $mountpoint/
# date
# echo "Getting compressed graph db from S3 - END"
# create directories for neo4j data
mkdir -p $mountpoint/neo4j_data/databases/graph.db
mkdir -p $mountpoint/neo4j_data/dbms
graphdb_path=$mountpoint/neo4j_data/databases/graph.db
# mv $mountpoint/graph.db.tgz $mountpoint/neo4j_data/databases/graph.db/
# uncompress graph data
# echo "Uncompress graph db - START"
# cd $mountpoint/neo4j_data/databases/graph.db
# date
# pbzip2 -dc graph.db.tgz | tar x
# date
# rm graph.db.tgz
# echo "Uncompress graph db - END"
# Change Neo4J config to pick data from new location
sed -i -e '1idbms.directories.data='${mountpoint}'/neo4j_data\' $NEO4J_HOME/conf/neo4j.conf
# echo "Starting Neo4J"
# sudo -u ec2-user $NEO4J_HOME/bin/neo4j start
......@@ -7,6 +7,4 @@ git clone https://gitlab.ebi.ac.uk/sreenath/pdbe-neo4j-aws.git
cd pdbe-neo4j-aws
chmod -R 755 .
./setup.sh highspec
cp highspec/get_db.sh /usr/local/bin
chmod 777 /usr/local/bin/get_db.sh
#!/bin/bash
yum update -y
yum install git -y
git clone https://gitlab.ebi.ac.uk/sreenath/pdbe-neo4j-aws.git
cd pdbe-neo4j-aws
chmod -R 755 .
./setup.sh highspec
cp highspec/get_db.sh /usr/local/bin
chmod 777 /usr/local/bin/get_db.sh
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment