Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Anchortop1top1Image Removed

Anchor
top77
top77


Tip

Steps to add EBS volume for Neo4j


Expand
titlePrerequisite

OS

-

: Linux 

TiptitleFind all the steps for EBS volume poc for

Software: Neo4j


Expand
titleTo use AWS storage volume for neo4j graph database

Step 1:

  • Create an EBC Volume: (Type GP2)

  • EBS volume should be in exact same region and sub region as the instance you wish to mount

.

Step 2:

  • Attach EBS Volume to Instance:

Step 3:

Now we need to mount
  • Mount the drive on that instance:

    Panel
    borderColorgreen
    bgColorwhite
    titleColorgreen
    borderWidth2
    borderStylesolid
    titleLogin 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
  •  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
  •              sudo mkfs -t ext4 /dev/xvdf

         

   
  • 5. Create a directory of your choice to mount our new ext4 volume.

I am using
  • For Example the name used is “newvolume”

                sudo
  •              sudo mkdir /newvolume

         

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

.
  •            

    sudo
  •  sudo mount /dev/xvdf /newvolume/

         

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

.
  •            

    cd
  •  cd /newvolume

               

    df
  •  df -h

.

Step 4: 

Now we need to change the
  • 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: 

Now verify
  • 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:

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

Step 9:

  • Attach the volume to the new fresh instance
    1. From volumes section - attach the volume to the instance
.

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




Expand
title
Extend
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
.
    1. sudo cp /etc/fstab /etc/fstab.bak
    2. Open /etc/fstab file and make an entry in the following format
.
    1. device_name mount_point file_system_type fs_mntops fs_freq fs_passno