Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save akashgoswami/3840c1097dda765156966a7473adb8c9 to your computer and use it in GitHub Desktop.

Select an option

Save akashgoswami/3840c1097dda765156966a7473adb8c9 to your computer and use it in GitHub Desktop.

Revisions

  1. Darren Bathgate revised this gist Mar 24, 2016. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions install-scylla-on-aws-with-dpdk.sh
    Original file line number Diff line number Diff line change
    @@ -51,8 +51,13 @@ curl http://downloads.scylladb.com/rpm/centos/scylla.repo -s -o /etc/yum.repos.d
    yum install scylla-server scylla-jmx scylla-tools -y
    #########################################

    # Starts scylla in foreground to verify that DPDK is working
    cd /var/lib/scylla; /usr/bin/scylla --network-stack native --dpdk-pmd

    /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
  2. Darren Bathgate renamed this gist Mar 13, 2016. 1 changed file with 0 additions and 0 deletions.
  3. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ yum install -y kernel-devel

    ######### Install DPDK ##################
    PCI_SLOT=00:04.0
    NR_HUGEPAGES=64

    yum install -y gcc pciutils

    @@ -25,6 +26,10 @@ 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 ############
  4. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,9 @@ yum install scylla-server scylla-jmx scylla-tools -y
    #########################################

    # Starts scylla in foreground to verify that DPDK is working
    cd /var/lib/scylla; /usr/bin/scylla --network-stack native --dpdk-pmd

    # 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
    cd /var/lib/scylla; /usr/bin/scylla --network-stack native --dpdk-pmd
    # 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
  5. Darren Bathgate revised this gist Mar 13, 2016. No changes.
  6. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -46,7 +46,7 @@ curl http://downloads.scylladb.com/rpm/centos/scylla.repo -s -o /etc/yum.repos.d
    yum install scylla-server scylla-jmx scylla-tools -y
    #########################################

    # Starts scylla in foreground to verify that DPDK is is working
    # Starts scylla in foreground to verify that DPDK is working
    # 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
    cd /var/lib/scylla; /usr/bin/scylla --network-stack native --dpdk-pmd
  7. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@ yum install -y kernel-devel
    # REBOOT instance to load into new kernel
    #########################################

    ######### Install DPDK ##################
    PCI_SLOT=00:04.0

    yum install -y gcc pciutils
    @@ -24,7 +25,9 @@ modprobe uio
    insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko

    ./tools/dpdk_nic_bind.py --bind=igb_uio $PCI_SLOT
    #########################################

    ######### Create RAID0 Array ############
    yum install mdadm -y

    umount /dev/xvdb
    @@ -33,12 +36,15 @@ 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
    #########################################

    # Starts scylla in foreground to verify that DPDK is is working
    # Scylla needs to be started as 'root' in order to start in DPDK mode
  8. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,10 @@
    # 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
    @@ -33,3 +40,7 @@ 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

    # Starts scylla in foreground to verify that DPDK is is working
    # 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
    cd /var/lib/scylla; /usr/bin/scylla --network-stack native --dpdk-pmd
  9. Darren Bathgate revised this gist Mar 13, 2016. 1 changed file with 8 additions and 10 deletions.
    18 changes: 8 additions & 10 deletions aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,22 @@
    #!/bin/bash

    ########## DO THIS FIRST ################
    # Fetch the latest linux kernel
    yum update -y
    yum install -y kernel-devel

    # REBOOT instance to load into new kernel
    #########################################

    yum install -y kernel-devel gcc pciutils
    PCI_SLOT=00:04.0

    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 config T=x86_64-native-linuxapp-gcc
    make
    make install T=x86_64-native-linuxapp-gcc

    modprobe uio
    insmod build/kmod/igb_uio.ko

    ./tools/dpdk_nic_bind.py --bind=igb_uio 00:04.0
    insmod x86_64-native-linuxapp-gcc/kmod/igb_uio.ko

    ./tools/dpdk_nic_bind.py --bind=igb_uio $PCI_SLOT

    yum install mdadm -y

    @@ -34,4 +33,3 @@ 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

    systemctl start scylla-server
  10. Darren Bathgate created this gist Mar 13, 2016.
    37 changes: 37 additions & 0 deletions aws_scylladb_dpdk_setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    #!/bin/bash

    # Fetch the latest linux kernel
    yum update -y
    yum install -y kernel-devel

    # REBOOT instance to load into new kernel

    yum install -y kernel-devel 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 config T=x86_64-native-linuxapp-gcc
    make

    modprobe uio
    insmod build/kmod/igb_uio.ko

    ./tools/dpdk_nic_bind.py --bind=igb_uio 00:04.0


    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

    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

    systemctl start scylla-server