forked from Lainports/freebsd-ports
KeyDB is a high performance fork of Redis with a focus on multithreading, memory efficiency, and high throughput. In addition to performance improvements, KeyDB offers features such as Active Replication, FLASH Storage and Subkey Expires. KeyDB has a MVCC architecture that allows you to execute queries such as KEYS and SCAN without blocking the database and degrading performance. KeyDB maintains full compatibility with the Redis protocol, modules, and scripts. This includes the atomicity guarantees for scripts and transactions. Because KeyDB keeps in sync with Redis development KeyDB is a superset of Redis functionality, making KeyDB a drop in replacement for existing Redis deployments. On the same hardware KeyDB can achieve significantly higher throughput than Redis. Active-Replication simplifies hot-spare failover allowing you to easily distribute writes over replicas and use simple TCP based load balancing/failover. KeyDB's higher performance allows you to do more on less hardware which reduces operation costs and complexity. WWW: https://docs.keydb.dev/
67 lines
1.5 KiB
Bash
67 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: keydb
|
|
# REQUIRE: LOGIN
|
|
# BEFORE: securelevel
|
|
# KEYWORD: shutdown
|
|
|
|
# Add the following line to /etc/rc.conf to enable `keydb':
|
|
#
|
|
#keydb_enable="YES"
|
|
#
|
|
# Define profiles here to run separate keydb instances:
|
|
#
|
|
#keydb_profiles="foo bar" # Script uses %%PREFIX%%/etc/keydb-NAME.conf respectively.
|
|
# For correct script working please update pidfile entries in
|
|
# keydb-NAME.conf files.
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="keydb"
|
|
rcvar="${name}_enable"
|
|
|
|
extra_commands="reload"
|
|
|
|
command="%%PREFIX%%/bin/keydb-server"
|
|
pidfile="%%KEYDB_RUNDIR%%/$name.pid"
|
|
|
|
# read configuration and set defaults
|
|
load_rc_config "$name"
|
|
: ${keydb_enable="NO"}
|
|
: ${keydb_user="%%KEYDB_USER%%"}
|
|
: ${keydb_config="%%PREFIX%%/etc/$name.conf"}
|
|
|
|
command_args="${keydb_config}"
|
|
required_files="${keydb_config}"
|
|
|
|
_profile_exists() {
|
|
for _p in ${keydb_profiles}; do
|
|
[ "${_p}" = "$1" ] && return 1;
|
|
done
|
|
return 0
|
|
}
|
|
|
|
if [ $# -eq 2 ]; then
|
|
_profile=$2
|
|
_profile_exists $_profile
|
|
_exists=$?
|
|
[ ${_exists} -ne 1 ] && {
|
|
echo "`basename %%PREFIX%%/etc/rc.d/keydb`: no '$2' in 'keydb_profiles'"
|
|
exit 1
|
|
};
|
|
echo "-- Profile: ${_profile} --"
|
|
config_file="%%PREFIX%%/etc/${name}-${_profile}.conf"
|
|
command_args="${config_file}"
|
|
pidfile="%%KEYDB_RUNDIR%%/${_profile}.pid"
|
|
required_files="${config_file}"
|
|
elif [ -n "${keydb_profiles}" ]; then
|
|
_swap=$*; shift; _profiles=$*
|
|
_profiles=${_profiles:-${keydb_profiles}}
|
|
set -- ${_swap}
|
|
for _profile in ${_profiles}; do
|
|
%%PREFIX%%/etc/rc.d/keydb $1 ${_profile}
|
|
done
|
|
exit 0
|
|
fi
|
|
|
|
run_rc_command "$1"
|