How to use separate volumes for the commit log and data in EBS environment?

339 views Asked by At

I use Cassandra 3.9.

I've learned that I should create separate EBS volumes for the commit log and data when using Cassandra with AWS.

My problem is how?

The followings are what I've done and failed.

  1. Created volumes for the commit log and data on launching instances.

enter image description here

  1. I made the EBS volumes available for use by executing following commands. (You can find these commands here.)

    sudo mkfs -t ext4 /dev/xvdk
    sudo mkfs -t ext4 /dev/xvdf
    sudo mkdir /commitlog
    sudo mkdir /data
    sudo mount /dev/xvdk /commitlog
    sudo mount /dev/xvdf /data
    
  2. I changed the directories for the commit log and data in cassandra.yaml.

    commitlog_directory: /commitlog
    data_file_directories: /data
    

After all these setups done, I ran cassandra but I received an error message.

ERROR 20:49:22 Doesn't have write permissions for /data directory
ERROR 20:49:22 Insufficient permissions on directory /data

So, I changed the ownership of these two directories.

    sudo chown ubuntu:ubuntu /commitlog
    sudo chown ubuntu:ubuntu /data

I ran cassandra again. I got another error.

ERROR 20:52:44 Unable to verify sstable files on disk

What can be done to solve this problem?

1

There are 1 answers

0
tet On

It turned out that every process I took was fine. The problem was that I was using t2.micro instance because of the advantage of free tier.

Once I scaled up every instance from t2.micro to C4.large, everything worked fine.

I considered deleting this post, but I decided to keep it because someone might find it helpful.