Skip to content

Instantly share code, notes, and snippets.

@goors
Created October 21, 2024 09:49
Show Gist options
  • Save goors/f7db235a27303d6a8bba01f8c502ed04 to your computer and use it in GitHub Desktop.
Save goors/f7db235a27303d6a8bba01f8c502ed04 to your computer and use it in GitHub Desktop.
sudo apt-get install -y rsync
sudo mkfs.ext4 /dev/disk/azure/scsi1/lun$1
sudo mkdir -p /mnt/data
sudo mount /dev/disk/azure/scsi1/lun$1 /mnt/data
sudo rsync -av /var/lib/elasticsearch/ /mnt/data/
echo "/dev/disk/azure/scsi1/lun$1 /mnt/data ext4 defaults 0 0" | sudo tee -a /etc/fstab
sudo sed -i 's|path.data: /var/lib/elasticsearch|path.data: /mnt/data|g' /etc/elasticsearch/elasticsearch.yml
sudo systemctl restart elasticsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment