Versions Compared

Key

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

Anchor
top1
top1


  • Expand
    titlePrerequisite

    OS - Linux 


    Tip
    titleFind all the steps for EBS volume poc for Neo4j



    Expand
    title
Implementation Steps
  • To 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 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

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

                        sudo file -s /dev/xvdf

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

                Format the volume to ext4 filesystem  using the following command

                      sudo mkfs -t ext4 /dev/xvdf

                Create a directory of your choice to mount our new ext4 volume. I am using the name “newvolume”

                      sudo mkdir /newvolume

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

                      sudo mount /dev/xvdf /newvolume/

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

                      cd /newvolume

                      df -h .


    Step 4: 

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




    Expand
Step 12
  • titleExtend 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

13
  • 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
Info
titleResources used to complete the POC which are still active for now:

34.229.39.112 and 54.211.161.112 as EC2 Instances

EBS Volume : InsightsStorage : vol-022ad0b5e3f799d87

 

Useful link :

https://devopscube.com/mount-ebs-volume-ec2-instance/


Top Section