Skip to content
Snippets Groups Projects
Commit 0b99b8e9 authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Debian infrastructure

parent c0e1d664
No related branches found
No related tags found
No related merge requests found
Showing with 955 additions and 0 deletions
tarantool (1.4.4-1) unstable; urgency=low
* Init debian release, closes: #652911.
-- Dmitry E. Oboukhov <unera@debian.org> Sun, 18 Dec 2011 11:35:37 +0400
8
Source: tarantool
Maintainer: Dmitry E. Oboukhov <unera@debian.org>
Build-Depends: cdbs, debhelper (>= 8), gobjc, cmake, libreadline-dev
Section: database
Standards-Version: 3.9.2
Homepage: http://tarantool.org/
Package: tarantool-common
Architecture: all
Priority: optional
Depends: ${misc:Depends}, cronolog, adduser
Description: high performance key/value storage server
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
.
* all data is maintained in RAM
* data persistence is implemented using Write Ahead Log and snapshotting
* supports asynchronous replication and hot standby
* uses coroutines and asynchronous I/O to implement high-performance
lock-free access to data
* available on Linux and FreeBSD
* stored procedures in Lua are supported
.
This package provides configs and logs infrastructure for tarantool.
Package: tarantool
Architecture: any
Priority: optional
Depends: ${shlibs:Depends}, ${misc:Depends}, tarantool-common
Description: high performance key/value storage server
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
.
* all data is maintained in RAM
* data persistence is implemented using Write Ahead Log and snapshotting
* supports asynchronous replication and hot standby
* uses coroutines and asynchronous I/O to implement high-performance
lock-free access to data
* available on Linux and FreeBSD
* stored procedures in Lua are supported
.
This package provides tarantool server.
Package: tarantool-dbg
Architecture: any
Priority: extra
Section: debug
Depends: ${shlibs:Depends}, ${misc:Depends},
tarantool (= ${binary:Version})
Description: high performance key/value storage server
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
.
* all data is maintained in RAM
* data persistence is implemented using Write Ahead Log and snapshotting
* supports asynchronous replication and hot standby
* uses coroutines and asynchronous I/O to implement high-performance
lock-free access to data
* available on Linux and FreeBSD
* stored procedures in Lua are supported
.
This package provides debug symbols for all tarantool packages.
Package: tarantool-client
Architecture: any
Priority: optional
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: high performance key/value storage server
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
.
* all data is maintained in RAM
* data persistence is implemented using Write Ahead Log and snapshotting
* supports asynchronous replication and hot standby
* uses coroutines and asynchronous I/O to implement high-performance
lock-free access to data
* available on Linux and FreeBSD
* stored procedures in Lua are supported
.
This package provides readline client for tarantool.
Package: tarantool-client-dbg
Architecture: any
Priority: extra
Section: debug
Depends: ${shlibs:Depends}, ${misc:Depends},
tarantool-client (= ${binary:Version})
Description: high performance key/value storage server
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
.
* all data is maintained in RAM
* data persistence is implemented using Write Ahead Log and snapshotting
* supports asynchronous replication and hot standby
* uses coroutines and asynchronous I/O to implement high-performance
lock-free access to data
* available on Linux and FreeBSD
* stored procedures in Lua are supported
.
This package provides readline client for tarantool.
This diff is collapsed.
#
# Limit of memory used to store tuples to 100MB
# (0.1 GB)
# This effectively limits the memory, used by
# Tarantool. However, index and connection memory
# is stored outside the slab allocator, hence
# the effective memory usage can be higher (sometimes
# twice as high).
#
slab_alloc_arena = 0.1
#
# Read only and read-write port.
primary_port = 33013
# Read-only port.
secondary_port = 33014
#
# count of file descriptors
#
file_descriptors = 8192
#
# The port for administrative commands.
#
admin_port = 33015
#
# Each write ahead log contains this many rows.
# When the limit is reached, Tarantool closes
# the WAL and starts a new one.
rows_per_wal = 50
# Define a simple space with 1 HASH-based
# primary key.
space[0].enabled = 1
space[0].index[0].type = "HASH"
space[0].index[0].unique = 1
space[0].index[0].key_field[0].fieldno = 0
space[0].index[0].key_field[0].type = "NUM"
#!/usr/bin/make -f
VERSION := $(shell dpkg-parsechangelog|grep ^Version|awk '{print $$2}')
UVERSION := $(shell echo $(VERSION)|sed 's/-[[:digit:]]\+$$//')
DEB_CMAKE_EXTRA_FLAGS := -DDATA_INSTALL_DIR=/usr/share/trarantool \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DENABLE_CLIENT=true
DEB_DH_INSTALLINIT_ARGS := --name=tarantool
DEB_CMAKE_INSTALL_PREFIX := /usr
DEB_CMAKE_NORMAL_ARGS := -DCMAKE_INSTALL_PREFIX="$(DEB_CMAKE_INSTALL_PREFIX)" \
-DCMAKE_C_FLAGS="$(CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON
# -DENABLE_STATIC=ON
# -DCMAKE_C_COMPILER:FILEPATH="$(CC)" \
# -DCMAKE_CXX_COMPILER:FILEPATH="$(CXX)" \
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
DEB_BUILDDIR := build-area
tarball: clean
cd .. && tar --exclude=.git --exclude=debian \
-czf tarantool_$(UVERSION).orig.tar.gz tarantool-$(UVERSION)
clean::
install/tarantool-dbg::
rm -fr debian/tarantool-dbg/usr/share/doc/tarantool-dbg
install/tarantool-client-dbg::
rm -fr debian/tarantool-client-dbg/usr/share/doc/tarantool-client-dbg
install/tarantool::
pod2man -c 'high performance key/value storage server' \
debian/tarantool_box.pod > build-area/tarantool_box.1
install/tarantool-client::
pod2man -c 'readline SQL-client for tarantool.' \
debian/tarantool.pod > build-area/tarantool.1
#!/bin/sh
set -e
CFG=$1
ACTION=$2
CONFIG_DIR=/var/lib/tarantool/started
SNAPSHOT_DIR=/var/lib/tarantool/snapshot
PID_DIR=/var/run/tarantool
LOG_DIR=/var/log/tarantool
BOX=/usr/bin/tarantool_box
SSD=start-stop-daemon
usage="Usage: sh $0 /path/to/config.file start|stop"
if test -z "$CFG"; then
echo $usage
exit 5
fi
if ! echo $ACTION|grep -q '^\(start\|stop\)$'; then
echo $usage
exit 5
fi
if ! test -r "$CFG"; then
echo File $CFG not found
exit 10
fi
NAME=`basename $CFG .cfg`
PID=$PID_DIR/$NAME.pid
SCFG=$CONFIG_DIR/$NAME
RUNDIR=$SNAPSHOT_DIR/$NAME
LOG=$LOG_DIR/$NAME.log
SOCKETS=`grep \
'^[[:space:]]*file_descriptors[[:space:]]*=[[:space:]]*[[:digit:]]\+' $CFG \
| tail -n 1 \
| sed 's/[^[:digit:]]//g'
`
SSDARGS_NO_PID="--quiet --chdir $RUNDIR --chuid tarantool --exec"
SSDARGS="--pidfile $PID $SSDARGS_NO_PID"
if [ $SOCKETS -gt 1024 -a $SOCKETS -lt 65000 ]; then
ulimit -n $SOCKETS
fi
ulimit -c unlimited
comment_str="#### - commented by init script"
sed "s/^[[:space:]]*logger.*/# & $comment_str/" $CFG \
| sed "s/^[[:space:]]*file_descriptors.*/# & $comment_str/" \
| sed "s/^[[:space:]]*pid_file.*/# & $comment_str/" > $SCFG
$BOX -c $SCFG -v --check-config
echo "pid_file = $PID" >> $SCFG
echo "logger = \"cat >> $LOG\"" >> $SCFG
if [ ! -d $RUNDIR ]; then
install -d -otarantool -gtarantool -m0750 $RUNDIR
cd $RUNDIR
if ! $SSD --start $SSDARGS $BOX -- --init-storage -v -c $SCFG;
then
rm -fr $RUNDIR
exit 15
fi
fi
if [ $ACTION = 'start' ]; then
echo -n "\tStarting '$NAME' ... "
else
echo -n "\tStopping '$NAME' ... "
fi
if $SSD --$ACTION $SSDARGS $BOX -- -B -v -c $SCFG >/dev/null 2>&1;
then
echo "ok"
else
ret=$?
if [ $ret -eq 1 ]; then
if [ $ACTION = 'start' ]; then
echo "already started"
else
echo "already stoppped"
fi
else
echo "failed"
fi
fi
3.0 (quilt)
usr/bin/tarantool
build-area/tarantool.1
/etc/tarantool/instances.available
/etc/tarantool/instances.enabled
debian/etc/example.cfg /etc/tarantool/instances.available/
debian/scripts/init_instance.sh /usr/lib/tarantool/
#!/bin/sh
set -e
SYSUSER=tarantool
case "$1" in
configure)
if ! getent passwd $SYSUSER > /dev/null; then
adduser \
--system \
--group \
--quiet \
--home \
/var/spool/$SYSUSER \
--no-create-home \
--disabled-login \
tarantool
install -d -o$SYSUSER -gadm -m2750 /var/log/$SYSUSER
install -d -o$SYSUSER -g$SYSUSER -m750 /var/run/$SYSUSER
install -d -o$SYSUSER -g$SYSUSER -m750 /var/run/$SYSUSER
install -d -o$SYSUSER -g$SYSUSER -m750 /var/lib/tarantool/started
install -d -o$SYSUSER -g$SYSUSER -m750 /var/lib/tarantool/snapshot
fi
;;
esac
#DEBHELPER#
#! /bin/sh
# /etc/init.d/tarantool
### BEGIN INIT INFO
# Provides: tarantool
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Tarantool init script
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
# Author: Dmitry E. Oboukhov <unera@debian.org>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
CONF_DIR=/etc/tarantool/instances.enabled
SCRIPTNAME=/etc/init.d/tarantool
DAEMON=/usr/bin/tarantool_box
INSTANCES=`find $CONF_DIR -xtype f -name '*.cfg'`
INSTSCRIPT=/usr/lib/tarantool/init_instance.sh
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
. /lib/init/vars.sh
if test -z "$INSTANCES"; then
echo "tarantool: There are no instances in $CONF_DIR"
exit 0
fi
#
# Function that starts the daemon/service
#
do_start() {
echo "tarantool: Staring instances"
for inst in $INSTANCES; do
$INSTSCRIPT $inst start
done
return 0
}
#
# Function that stops the daemon/service
#
do_stop() {
echo "tarantool: Stopping instances"
for inst in $INSTANCES; do
$INSTSCRIPT $inst stop
done
return 0
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
do_stop
do_start
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
status)
;;
restart|force-reload)
do_stop
do_start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
usr/bin/tarantool_box
build-area/tarantool_box.1
=head1 NAME
tarantool - readline SQL-client for L<tarantool>.
=head1 SYNOPSIS
tarantool [OPTIONS]
=head1 Command-line options
=over
=item -a <host>, --host <host>
Defines Server address.
=item -p <port>, --port <port>
Defines server port.
=item -m <port>, --port-admin <port>
Defines Server admin port.
=item -h, --help
Displays helpscreen and exits.
=back
=head1 NAME
tarantool_box - open-source NoSQL database
=head1 SYNOPSIS
tarantool_box [OPTIONS]
=head1 DESCRIPTION
Tarantool is an open-source NoSQL database, developed by Mail.ru.
Its key properties include:
=over
=item *
Licence: simplified BSD
=item *
All data is maintained in RAM
=item *
Data persistence is implemented using Write Ahead Log and snapshotting
=item *
Supports asynchronous replication and hot standby
=item *
Uses coroutines and asynchronous I/O to implement
high-performance lock-free access to data
=item *
Available on Linux and FreeBSD
=item *
Stored procedures in Lua are supported.
=back
=head2 Data model
The basic atom of storage in Tarantool is called tuple. A tuple
can have arbitrary number of fields. The first field in the tuple
is always the identifying unique key. Tuples form spaces. It is
possible to search tuples in spaces using the primary or secondary
keys. Fields in a tuple are type-agnostic. It is possible to change,
as well as add or remove fields.
=head1 Command-line options
=over
=item --cfg-get=KEY
Returns a value from configuration file described by B<KEY>.
=item --check-config
Checks configuration file for errors.
=item -c FILE, --config=FILE
Points a path to configuration file (default: B</etc/tarantool.cfg>).
=item --cat=FILE
Cats snapshot file to stdout in readable format and exits.
=item --init-storage
Initializes storage (an empty snapshot file) and exits.
=item -v, --verbose
Increases verbosity level in log messages.
=item -B, --background
Redirects input/output streams to a log file and runs as
daemon.
=item -h, --help
Displays helpscreen and exits.
=item -V, --version
Prints program version and exits.
=back
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment