EBS Volume for Neo4j

Steps to add EBS volume for Neo4j

 Prerequisite

OS: Linux 

Software: Neo4j

 To use AWS storage volume for neo4j graph database

Step 1:

  • Create an EBC Volume: (Type GP2)

Step 2:

  • Attach EBS Volume to Instance:

Step 3:

  • Mount the drive on that instance:

    Login to your ec2 instance and list the available disks using the following command
    1. Lsblk

          2. Check if the volume has any data using the following command

                 sudo file -s /dev/xvdf

          3. If the above command output shows “/dev/xvdf: data”, it means your volume is empty

          4. Format the volume to ext4 filesystem  using the following command

                 sudo mkfs -t ext4 /dev/xvdf

          5. Create a directory of your choice to mount our new ext4 volume. For Example the name used is “newvolume”

                 sudo mkdir /newvolume

          6. Mount the volume to “newvolume” directory using the following command

                 sudo mount /dev/xvdf /newvolume/

          7. cd into newvolume directory and check the disk space for confirming the volume mount

                 cd /newvolume

                 df -h

Step 4: 

  • Change neo4j.conf file to point to new mounted space
    1. Stop neo4j
    2. Uncomment line “dbms.directories.data=data”
    3. Change to “dbms.directories.data=/newvolume/data”

Step 5: 

  • Verify neo4j
    1. Start neo4j
    2. Create nodes and verify data

Step 6:

  • Unmount
    1. umount /dev/xvdf

Step 7:

  • Detach EBS volume
    1. Go to EC2 Volume section
    2. Select the volume
    3. Under Action select detach, if that does not works go for Force detach

Step 8:

  • Increase the size
    1. Go to EC2 Volume section
    2. Resize the volume by modifying the volume to desired levels

Step 9:

Step 10:

  • Mount the volume to newly attached instance
    1. Follow step 3 above

Step 11:

  • Neo4j conf updates and data verification
    1. Follow steps 5 and 6



 To extend AWS storage volume for neo4j graph database

Step 1:

  • To make the extend size of EBS volume to be useful we need to resize it with formatting
    1. sudo resize2fs /dev/xvdf

Step 2:

  • EBS Automount On Reboot
    1. Back up the /etc/fstab file
    2. sudo cp /etc/fstab /etc/fstab.bak
    3. Open /etc/fstab file and make an entry in the following format
    4. device_name mount_point file_system_type fs_mntops fs_freq fs_passno

©2021 Cognizant, all rights reserved. US Patent 10,410,152