mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 04:26:48 +00:00
posix_net_conf.sh wants -sq/-mq options, so detect number of queues and specify the option in scylla_prepare.
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/bin/bash -e
|
|
|
|
. /etc/os-release
|
|
if [ "$ID" = "ubuntu" ]; then
|
|
. /etc/default/scylla-server
|
|
else
|
|
. /etc/sysconfig/scylla-server
|
|
fi
|
|
for i in /etc/scylla.d/*.conf; do
|
|
if [ "$i" = "/etc/scylla.d/*.conf" ]; then
|
|
break
|
|
fi
|
|
. "$i"
|
|
done
|
|
|
|
if [ "$AMI" = "yes" ] && [ -f /etc/scylla/ami_disabled ]; then
|
|
rm /etc/scylla/ami_disabled
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$NETWORK_MODE" = "virtio" ]; then
|
|
ip tuntap del mode tap dev $TAP
|
|
ip tuntap add mode tap dev $TAP user $USER one_queue vnet_hdr
|
|
ip link set dev $TAP up
|
|
ip link set dev $TAP master $BRIDGE
|
|
chown $USER.$GROUP /dev/vhost-net
|
|
elif [ "$NETWORK_MODE" = "dpdk" ]; then
|
|
modprobe uio
|
|
modprobe uio_pci_generic
|
|
/usr/lib/scylla/dpdk_nic_bind.py --force --bind=uio_pci_generic $ETHPCIID
|
|
for n in /sys/devices/system/node/node?; do
|
|
echo $NR_HUGEPAGES > $n/hugepages/hugepages-2048kB/nr_hugepages
|
|
done
|
|
else # NETWORK_MODE = posix
|
|
if [ "$SET_NIC" = "yes" ]; then
|
|
NRXQ=`find /sys/class/net/$IFNAME/queues -name "rx-*"|wc -l`
|
|
if [ $NRXQ -gt 1 ]; then
|
|
CONF_ARGS=-mq
|
|
else
|
|
CONF_ARGS=-sq
|
|
fi
|
|
/usr/lib/scylla/posix_net_conf.sh $IFNAME $CONF_ARGS
|
|
fi
|
|
fi
|
|
if [ "$ID" = "ubuntu" ]; then
|
|
hugeadm --create-mounts
|
|
fi
|