EBS Volume for Neo4j
- MadanaGopal.Ragupathy@cognizant.com (Unlicensed)
- Abirami
- Akshay Sharma (Unlicensed)
Steps to add EBS volume for Neo4j
OS: Linux
Software: Neo4j
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
Reference Link : http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html
Step 2:
Attach EBS Volume to Instance:
From volumes section - attach the volume to the instance
Reference Link :http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html
Step 3:
Mount the drive on that instance:
Login to your ec2 instance and list the available disks using the following command- 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
- Stop neo4j
- Uncomment line “dbms.directories.data=data”
- Change to “dbms.directories.data=/newvolume/data”
Step 5:
- Verify neo4j
- Start neo4j
- Create nodes and verify data
Step 6:
- Unmount
- umount /dev/xvdf
Step 7:
- Detach EBS volume
- Go to EC2 Volume section
- Select the volume
- Under Action select detach, if that does not works go for Force detach
Step 8:
- Increase the size
- Go to EC2 Volume section
- Resize the volume by modifying the volume to desired levels
Step 9:
- Attach the volume to the new fresh instance
- From volumes section - attach the volume to the instance
- Reference Link : http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html
Step 10:
- Mount the volume to newly attached instance
- Follow step 3 above
Step 11:
- Neo4j conf updates and data verification
- Follow steps 5 and 6
Step 1:
- To make the extend size of EBS volume to be useful we need to resize it with formatting
- sudo resize2fs /dev/xvdf
Step 2:
- EBS Automount On Reboot
- Back up the /etc/fstab file
- sudo cp /etc/fstab /etc/fstab.bak
- Open /etc/fstab file and make an entry in the following format
- device_name mount_point file_system_type fs_mntops fs_freq fs_passno
©2021 Cognizant, all rights reserved. US Patent 10,410,152