Skip to content

Instantly share code, notes, and snippets.

@dbathgate
Last active March 29, 2023 12:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dbathgate/04b69b10e50038706a94 to your computer and use it in GitHub Desktop.
Save dbathgate/04b69b10e50038706a94 to your computer and use it in GitHub Desktop.
Installing ScyllaDB in AWS with DPDK enabled
# Installing ScyllaDB in AWS with DPDK enabled
# Prerequisites:
# - Red Hat Enterprise Linux 7.2 (HVM)
# - Instance type that supports enhanced networking (see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enhanced_networking_instance_types)
# - Secondary NIC installed via Network Interfaces in AWS
# - Instance type with 2 hard drives for RAID0 array
########## DO THIS FIRST ################
# Fetch the latest linux kernel
yum update -y
yum install -y kernel-devel
# REBOOT instance to load into new kernel
#########################################
######### Install DPDK ##################
PCI_SLOT=00:04.0
NR_HUGEPAGES=64
yum install -y gcc pciutils
curl http://dpdk.org/browse/dpdk/snapshot/dpdk-2.2.0.tar.gz -s | tar -xz -C /usr/local/
cd /usr/local/dpdk-2.2.0
make install T=x86_64-native-linuxapp-gcc
modprobe uio
insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
./tools/dpdk_nic_bind.py --bind=igb_uio $PCI_SLOT
for n in /sys/devices/system/node/node?; do
echo $NR_HUGEPAGES > $n/hugepages/hugepages-2048kB/nr_hugepages
done
#########################################
######### Create RAID0 Array ############
yum install mdadm -y
umount /dev/xvdb
yes | mdadm --create --verbose /dev/md0 --level=0 --name=MY_RAID --raid-devices=2 /dev/xvdb /dev/xvdc
mkfs.xfs -f -K /dev/md0
mkdir /var/lib/scylla
mount /dev/md0 /var/lib/scylla
#########################################
######### Install ScyllaDB ##############
curl -s -o epel-release-latest-7.noarch.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
curl http://downloads.scylladb.com/rpm/centos/scylla.repo -s -o /etc/yum.repos.d/scylla.repo
yum install scylla-server scylla-jmx scylla-tools -y
#########################################
/usr/lib/scylla/scylla_io_setup
. /etc/scylla.d/io.conf
ulimit -n 200000
# Starts scylla manually
cd /var/lib/scylla; nohup /usr/bin/scylla --network-stack native --dpdk-pmd $SCYLLA_IO </dev/null >/var/log/scylla.log 2>&1 &
# Scylla needs to be started as 'root' in order to start in DPDK mode
# Currently the 0.19 build of Scylla has an issue where systemctl will not start as root, even if USER is set to root in sysconfig
# Additionally, the scylla_prepare script attempts to bind the NIC to driver 'uio_pci_generic' as opposed to 'igb_uio'
# For these reasons, I was unable to start ScyllaDB in DPDK mode using systemctl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment