diff --git a/README.md b/README.md index c447cc8d4..7936098f9 100644 --- a/README.md +++ b/README.md @@ -1,372 +1,409 @@ -[![codecov](https://codecov.io/gh/valkey-io/valkey/graph/badge.svg?token=KYYSJAYC5F)](https://codecov.io/gh/valkey-io/valkey) + + + -This project was forked from the open source Redis project right before the transition to their new source available licenses. -This README is just a fast *quick start* document. More details can be found under [valkey.io](https://valkey.io/) + +
+
+ + + -# What is Valkey? +

Futriix

-Valkey is a high-performance data structure server that primarily serves key/value workloads. -It supports a wide range of native structures and an extensible plugin system for adding new data structures and access patterns. +

+ Futriix's полная документация (команды идентичны) +
+ Изучить полную документацию +
+ Сообщить об ошибке + · + Предложение новой функциональности +

+
-# Building Valkey using `Makefile` + ## Краткая документация проекта Futriix -Valkey can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD. -We support big endian and little endian architectures, and both 32 bit -and 64 bit systems. + +
+
+ Содержание +
    +
  1. + О проекте +
  2. +
  3. Подготовка
  4. +
  5. Компиляция
  6. +
  7. Использование
  8. +
  9. Кластер
  10. +
  11. Дорожная карта
  12. +
  13. Вклад
  14. +
  15. Лицензия
  16. +
  17. Контакты
  18. +
+
-It may compile on Solaris derived systems (for instance SmartOS) but our -support for this platform is *best effort* and Valkey is not guaranteed to -work as well as in Linux, OSX, and \*BSD. -It is as simple as: + +## О проекте - % make +Проект Futriix является форком проекта Valkey. -To build with TLS support, you'll need OpenSSL development libraries (e.g. -libssl-dev on Debian/Ubuntu). +Futriix-Мультимодельная СУБД на языке С поддержкой плагинов на языке Golang. +Ниже приведён пример того, инструкции по настройке вашего проекта локально. +Чтобы запустить локальную копию проекта, выполните следующие простые шаги. -To build TLS support as Valkey built-in: - % make BUILD_TLS=yes +### Подготовка -To build TLS as Valkey module: +Ниже приведены шаги, которые помогут вам скомпилировать и установить Futriix. +* Устанавливаем язык программирования C, соопутствующие утилиты (autoconf и другие) - % make BUILD_TLS=module +```sh + unix:$ sudo apt-get update + unix:$ sudo apt-get update + unix:$ sudo apt-get install build-essential nasm autotools-dev autoconf libjemalloc-dev tcl tcl-dev uuid-dev libcurl4-openssl-dev git +``` -Note that sentinel mode does not support TLS module. + * Устанавливаем язык программирования Golang по инструкции с [официального сайта](https://go.dev/doc/install) + -To build with experimental RDMA support you'll need RDMA development libraries -(e.g. librdmacm-dev and libibverbs-dev on Debian/Ubuntu). +### Компиляция -To build RDMA support as Valkey built-in: +Для того, чтобы успешно скомпилировать проект, выполните шаги ниже: - % make BUILD_RDMA=yes +1. Скопировать репозиторий + ```sh + git clone https://source.futriix.ru/gvsafronov/Futriix + ``` +2. Перейти в каталог с исходном кодом src + ```sh + cd src/ + ``` +

(К началу)

-To build RDMA as Valkey module: + + 3. Скомпилировать Futriix с помощью утилиты Make - % make BUILD_RDMA=module +Futriix может быть скомпилирован для Linux, OSX, OpenBSD, NetBSD, FreeBSD. +Мы поддерживаем архитектуры endian и little endian, и 32-битные и 64-битные системы. -To build with systemd support, you'll need systemd development libraries (such -as libsystemd-dev on Debian/Ubuntu or systemd-devel on CentOS) and run: +```sh + unix:$ make +``` - % make USE_SYSTEMD=yes +Для сборки проекта с поддержкой TLS, вам необходима библиотека OpenSSL (например, +libssl-dev для Debian/Ubuntu). -To append a suffix to Valkey program names, use: +Для сборки проекта с поддержкой TLS выпоните команды ниже: +```sh + unix:$ make BUILD_TLS=yes +``` +To build TLS as Futriix module: +```sh + unix:$ make BUILD_TLS=module +``` - % make PROG_SUFFIX="-alt" +Для сборки проекта с экспериментальной поддержкой RDMA вам необходимо установить библиотеку разработки RDMA +(например, librdmacm-dev and libibverbs-dev для Debian/Ubuntu). -You can build a 32 bit Valkey binary using: +Для сборки Futriix c поддержкой RDMA просто выполните следующие команды: +```sh + unix:$ make BUILD_RDMA=yes +``` +To build RDMA as Futriix module: - % make 32bit +```sh -After building Valkey, it is a good idea to test it using: + unix:$ make BUILD_RDMA=module +``` +Для сборки проекта с поддержкой systemd, вам необходимо установить соответсвующие библиотеки разработки (такие как +libsystemd-dev для Debian/Ubuntu или systemd-devel для CentOS) и выполнить следующие команды: - % make test +```sh + unix:$ make USE_SYSTEMD=yes +``` +Для добавления суффикса в имя проекта Futriix, выполните следующие команды: -The above runs the main integration tests. Additional tests are started using: +```sh + unix:$ make PROG_SUFFIX="-alt" +``` +После сборки Futriix, мы рекомендуем запустить утилиту для проверки корректности сборки: - % make test-unit # Unit tests - % make test-modules # Tests of the module API - % make test-sentinel # Valkey Sentinel integration tests - % make test-cluster # Valkey Cluster integration tests +```sh + unix:$ make test +``` -More about running the integration tests can be found in -[tests/README.md](tests/README.md) and for unit tests, see -[src/unit/README.md](src/unit/README.md). +Команда выше запустит интегрированные в проект тесты. Additional tests are started using: -## Fixing build problems with dependencies or cached build options +```sh + unix:$ make test-unit # Юнит-тесты + unix:$ make test-modules # Тесты модулей API + unix:$ make test-cluster # Тест Futriix для проверки работы кластера +``` +Более подробную информацию вы найдёте ознакомившись со следующими источниками: +[tests/README.md](tests/README.md) а также [src/unit/README.md](src/unit/README.md). -Valkey has some dependencies which are included in the `deps` directory. -`make` does not automatically rebuild dependencies even if something in -the source code of dependencies changes. +

(К началу)

-When you update the source code with `git pull` or when code inside the -dependencies tree is modified in any other way, make sure to use the following -command in order to really clean everything and rebuild from scratch: +## Исправление проблем сборки с зависимостями или кэшированными параметрами сборки. - % make distclean +Futriix содержит некоторые зависимости, которые хранятся в директории `deps`. +Утилита `make` автоматически не пересобирает зависимости даже если вносятся каие-либо изменения в код зависимостей. -This will clean: jemalloc, lua, hiredis, linenoise and other dependencies. +Когда вы обновляете код проекта командой `git pull` или когда код внутри +дерева зависимостей изменен каким-либо другим способом, обязательно используйте следующее +команду для того, чтобы действительно все почистить и пересобрать с нуля: -Also if you force certain build options like 32bit target, no C compiler -optimizations (for debugging purposes), and other similar build time options, -those options are cached indefinitely until you issue a `make distclean` -command. +```sh + unix:$ make distclean +``` -## Fixing problems building 32 bit binaries +В результате работы команды выше будут очищены: аллокатор памяти jemalloc, язык lua, библиотеку hiredis, библиотеку linenoise а также другие зависимости. -If after building Valkey with a 32 bit target you need to rebuild it -with a 64 bit target, or the other way around, you need to perform a -`make distclean` in the root directory of the Valkey distribution. +Кроме того, если вы принудительно используете определенные параметры сборки, такие как 32-битная версия для 32-битной системы, оптимизации компилятора C в данном случае не будут выполнены. Оптимизации (для целей отладки) и другие подобные параметры времени сборки, +кэшируются на неопределенный срок, пока вы не выполните команду `make distclean`. -In case of build errors when trying to build a 32 bit binary of Valkey, try -the following steps: +

(К началу)

-* Install the package libc6-dev-i386 (also try g++-multilib). -* Try using the following command line instead of `make 32bit`: - `make CFLAGS="-m32 -march=native" LDFLAGS="-m32"` +## Аллокатор -## Allocator +Выбор аллокатора памяти не по умолчанию при сборке Futriix выполняется путем установки +параметра `MALLOC` переменной окружения. Futriix компилируется и компонуется с libc +malloc по умолчанию, за исключением jemalloc, который используется по умолчанию в дистрибутивах Linux. +Это значение по умолчанию было выбрано потому, что в jemalloc меньше +проблем c фрагментацией, чем libc malloc. -Selecting a non-default memory allocator when building Valkey is done by setting -the `MALLOC` environment variable. Valkey is compiled and linked against libc -malloc by default, with the exception of jemalloc being the default on Linux -systems. This default was picked because jemalloc has proven to have fewer -fragmentation problems than libc malloc. +Чтобы принудительно скомпилировать libc malloc, выполните следующую команду: -To force compiling against libc malloc, use: - - % make MALLOC=libc +```sh + unix:$ make MALLOC=libc +``` To compile against jemalloc on Mac OS X systems, use: +```sh + unix:$ make MALLOC=jemalloc +``` - % make MALLOC=jemalloc +## Монотонные часы -## Monotonic clock - -By default, Valkey will build using the POSIX clock_gettime function as the -monotonic clock source. On most modern systems, the internal processor clock -can be used to improve performance. Cautions can be found here: +По умолчанию Futriix будет использовать функцию POSIX clock_gettime в качестве +монотонный источник тактовой частоты. В большинстве современных систем внутреннюю тактовую частоту процессора +можно использовать для улучшения производительности. Предостережения можно найти здесь: http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/ -To build with support for the processor's internal instruction clock, use: +Для сборки с поддержкой внутренней тактовой частоты процессора, используйте команду ниже: - % make CFLAGS="-DUSE_PROCESSOR_CLOCK" - -## Verbose build - -Valkey will build with a user-friendly colorized output by default. -If you want to see a more verbose output, use the following: - - % make V=1 - -# Running Valkey - -To run Valkey with the default configuration, just type: - - % cd src - % ./valkey-server - -If you want to provide your valkey.conf, you have to run it using an additional -parameter (the path of the configuration file): - - % cd src - % ./valkey-server /path/to/valkey.conf - -It is possible to alter the Valkey configuration by passing parameters directly -as options using the command line. Examples: - - % ./valkey-server --port 9999 --replicaof 127.0.0.1 6379 - % ./valkey-server /etc/valkey/6379.conf --loglevel debug - -All the options in valkey.conf are also supported as options using the command -line, with exactly the same name. - -# Running Valkey with TLS: - -## Running manually - -To manually run a Valkey server with TLS mode (assuming `./gen-test-certs.sh` was invoked so sample certificates/keys are available): - -* TLS built-in mode: - ``` - ./src/valkey-server --tls-port 6379 --port 0 \ - --tls-cert-file ./tests/tls/valkey.crt \ - --tls-key-file ./tests/tls/valkey.key \ - --tls-ca-cert-file ./tests/tls/ca.crt - ``` - -* TLS module mode: - ``` - ./src/valkey-server --tls-port 6379 --port 0 \ - --tls-cert-file ./tests/tls/valkey.crt \ - --tls-key-file ./tests/tls/valkey.key \ - --tls-ca-cert-file ./tests/tls/ca.crt \ - --loadmodule src/valkey-tls.so - ``` - -Note that you can disable TCP by specifying `--port 0` explicitly. -It's also possible to have both TCP and TLS available at the same time, -but you'll have to assign different ports. - -Use `valkey-cli` to connect to the Valkey server: -``` -./src/valkey-cli --tls \ - --cert ./tests/tls/valkey.crt \ - --key ./tests/tls/valkey.key \ - --cacert ./tests/tls/ca.crt +```sh + unix:$ make CFLAGS="-DUSE_PROCESSOR_CLOCK" ``` -Specifying `--tls-replication yes` makes a replica connect to the primary. +## Расширенный вариант сборки -Using `--tls-cluster yes` makes Valkey Cluster use TLS across nodes. +Futriix по умолчанию создает удобный для пользователя цветной вывод. +Если вы хотите увидеть более подробный вывод, выполните следующую команду: -# Running Valkey with RDMA: +```sh + unix:$ make V=1 +``` + +4. Если вы хотите запустить сервер Futriix с параметрами по-умолчанию (без указания файла конфигурации) выполните следующую команду: + ```sh + `./futriix-server` + ``` + 5. Также вы можете использовать файл конфигурации, располагающийся в директории "Futriix" `futriix.conf` для конфигурирования вашего сервера. + Для запуска Futriix с файлом конфигурации используйте команду ниже: + + ```sh + ./futriix-server /path/to/futriix.conf + ``` + +6. Запустите утилиту clif (Client Futriix) для подключения к **локальному** серверу Futriix, а также для того чтобы начать работу с инстансом: -Note that Valkey Over RDMA is an experimental feature. -It may be changed or removed in any minor or major version. -Currently, it is only supported on Linux. + ```sh + ./clif + ``` -* RDMA built-in mode: - ``` - ./src/valkey-server --protected-mode no \ - --rdma-bind 192.168.122.100 --rdma-port 6379 +7. Для подключения с помощью утилиты clif к конкретному узлу в сети, добавьте параметр `h`-указание удалённого хоста по его ip-адресу и параметр `p`- указания номера порта: + + ```sh + ./clif -h 11.164.22.7 -p 50000 + ``` + +

(К началу)

+ +## Запуск Futriix с RDMA: + +Обратите внимание, что поддержка RDMA в Futriix— экспериментальная функция. +Она может быть изменена или удалена в любой дополнительной или основной версии. +В настоящее время она поддерживается только в Linux. + +* Команда для включения RDMA : + + ```sh + ./src/futriix-server --protected-mode no \ + --rdma-bind 192.168.122.100 --rdma-port 9880 ``` -* RDMA module mode: - ``` - ./src/valkey-server --protected-mode no \ - --loadmodule src/valkey-rdma.so --rdma-bind 192.168.122.100 --rdma-port 6379 - ``` +* Режим работы модуля RDMA: + +```sh + ./src/futriix-server --protected-mode no \ + --loadmodule src/Futriix-rdma.so --rdma-bind 192.168.122.100 --rdma-port 9880 +``` +Можно изменить адрес/порт привязки RDMA с помощью команды времени выполнения: -It's possible to change bind address/port of RDMA by runtime command: +```sh +unix:$ 192.168.122.100:9880> CONFIG SET rdma-port 9380 +``` - 192.168.122.100:6379> CONFIG SET rdma-port 6380 +Также возможно наличие одновременно RDMA и TCP, но нет +конфликт TCP(9880) и RDMA(9880), например: -It's also possible to have both RDMA and TCP available, and there is no -conflict of TCP(6379) and RDMA(6379), Ex: +```sh +unix:$ ./src/futriix-server --protected-mode no \ + --loadmodule src/Futriix-rdma.so --rdma-bind 192.168.122.100 --rdma-port 9880 \ + --port 9880 +``` - % ./src/valkey-server --protected-mode no \ - --loadmodule src/valkey-rdma.so --rdma-bind 192.168.122.100 --rdma-port 6379 \ - --port 6379 +Примечание: Ваша сетевая карта (с ip-адресом 192.168.122.100 в данном примере) должна поддерживать режим +RDMA. Для того что понять поддерживает сервер режим RDMA или нет, выполните команду ниже: -Note that the network card (192.168.122.100 of this example) should support -RDMA. To test a server supports RDMA or not: +```sh + unix:$ rdma res show (a new version iproute2 package) +``` - % rdma res show (a new version iproute2 package) -Or: +Или команду ниже: - % ibv_devices +```sh + unix:$ ibv_devices +``` + +## Использование -# Playing with Valkey - -You can use valkey-cli to play with Valkey. Start a valkey-server instance, -then in another terminal try the following: - - % cd src - % ./valkey-cli - valkey> ping + unix:$ cd src + unix:$ ./clif + 127.0.0.1:futriix:~> ping PONG - valkey> set foo bar + 127.0.0.1:futriix:~> set foo bar OK - valkey> get foo + 127.0.0.1:futriix:~> get foo "bar" - valkey> incr mycounter + 127.0.0.1:futriix:~> incr mycounter (integer) 1 - valkey> incr mycounter + 127.0.0.1:futriix:~> incr mycounter (integer) 2 - valkey> + 127.0.0.1:futriix:~> -# Installing Valkey -In order to install Valkey binaries into /usr/local/bin, just use: +

(К началу)

- % make install -You can use `make PREFIX=/some/other/directory install` if you wish to use a -different destination. +## Кластер -_Note_: For compatibility with Redis, we create symlinks from the Redis names (`redis-server`, `redis-cli`, etc.) to the Valkey binaries installed by `make install`. -The symlinks are created in same directory as the Valkey binaries. -The symlinks are removed when using `make uninstall`. -The creation of the symlinks can be skipped by setting the makefile variable `USE_REDIS_SYMLINKS=no`. -`make install` will just install binaries in your system, but will not configure -init scripts and configuration files in the appropriate place. This is not -needed if you just want to play a bit with Valkey, but if you are installing -it the proper way for a production system, we have a script that does this -for Ubuntu and Debian systems: +1. Откройте директорию Futriix - % cd utils - % ./install_server.sh +```sh +unix:$ cd futriix -_Note_: `install_server.sh` will not work on Mac OSX; it is built for Linux only. - -The script will ask you a few questions and will setup everything you need -to run Valkey properly as a background daemon that will start again on -system reboots. - -You'll be able to stop and start Valkey using the script named -`/etc/init.d/valkey_`, for instance `/etc/init.d/valkey_6379`. - -# Building using `CMake` - -In addition to the traditional `Makefile` build, Valkey supports an alternative, **experimental**, build system using `CMake`. - -To build and install `Valkey`, in `Release` mode (an optimized build), type this into your terminal: - -```bash -mkdir build-release -cd $_ -cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/valkey -sudo make install -# Valkey is now installed under /opt/valkey ``` -Other options supported by Valkey's `CMake` build system: +2. Откройте файл конфигурации futriix.conf в любом текстовом редакторе, например nano, как в примере приведённом ниже: -## Special build flags +```sh +unix:$ nano futriix/futriix.conf -- `-DBUILD_TLS=` enable TLS build for Valkey. Default: `no` -- `-DBUILD_RDMA=` enable RDMA module build (only module mode supported). Default: `no` -- `-DBUILD_MALLOC=` choose the allocator to use. Default on Linux: `jemalloc`, for other OS: `libc` -- `-DBUILD_SANITIZER=` build with address sanitizer enabled. Default: disabled (no sanitizer) -- `-DBUILD_UNIT_TESTS=[yes|no]` when set, the build will produce the executable `valkey-unit-tests`. Default: `no` -- `-DBUILD_TEST_MODULES=[yes|no]` when set, the build will include the modules located under the `tests/modules` folder. Default: `no` -- `-DBUILD_EXAMPLE_MODULES=[yes|no]` when set, the build will include the example modules located under the `src/modules` folder. Default: `no` - -## Common flags - -- `-DCMAKE_BUILD_TYPE=` define the build type, see CMake manual for more details -- `-DCMAKE_INSTALL_PREFIX=/installation/path` override this value to define a custom install prefix. Default: `/usr/local` -- `-G""` generate build files for "Generator Name". By default, CMake will generate `Makefile`s. - -## Verbose build - -`CMake` generates a user-friendly colorized output by default. -If you want to see a more verbose output, use the following: - -```bash -make VERBOSE=1 ``` -## Troubleshooting +3. Найдите и установите значения "yes" для параметров "active-replica" и "multi-master". После чего добавьте в файл конфигурации ip-адреса, узлов вашего кластера. Если вы всё сделали правильно у вас должны отробразится строки в файле конфигурации `futriix.conf` как показано ниже: -During the `CMake` stage, `CMake` caches variables in a local file named `CMakeCache.txt`. All variables generated by Valkey -are removed from the cache once consumed (this is done by calling to `unset(VAR-NAME CACHE)`). However, some variables, -like the compiler path, are kept in cache. To start a fresh build either remove the cache file `CMakeCache.txt` from the -build folder, or delete the build folder completely. +```sh -**It is important to re-run `CMake` when adding new source files.** +active-replica yes +multi-master yes +replicaof 192.168.11.5 9880 +replicaof 192.168.11.6 9880 +replicaof 192.168.11.7 9880 -## Integration with IDE - -During the `CMake` stage of the build, `CMake` generates a JSON file named `compile_commands.json` and places it under the -build folder. This file is used by many IDEs and text editors for providing code completion (via `clangd`). - -A small caveat is that these tools will look for `compile_commands.json` under the Valkey's top folder. -A common workaround is to create a symbolic link to it: - -```bash -cd /path/to/valkey/ -# We assume here that your build folder is `build-release` -ln -sf $(pwd)/build-release/compile_commands.json $(pwd)/compile_commands.json ``` -Restart your IDE and voila +4. Сохраните внесённые вами изменния, выйдите из редактора, воспользовавшись командами ниже: -# Code contributions +```sh +unix:$ ctrl+O +unix:$ ctrl+x +``` -Please see the [CONTRIBUTING.md][2]. For security bugs and vulnerabilities, please see [SECURITY.md][3]. +5. Перейдите в директорию Futriix и запустите скрипт `cluster.sh` с параметрами `pick` (скрипт запущенный с данным параметром "соберёт кластер"), и `run`,(скрипт запущенный с данным параметром "запустит кластер") как указано ниже: -# Valkey is an open community project under LF Projects +```sh +unix:$ ./cluster pick +unix:$ ./cluster run +``` -Valkey a Series of LF Projects, LLC -2810 N Church St, PMB 57274 -Wilmington, Delaware 19802-4447 +6. Для остановки кластера запустите скрипт `cluster.sh` с параметром `stop` -[1]: https://github.com/valkey-io/valkey/blob/unstable/COPYING -[2]: https://github.com/valkey-io/valkey/blob/unstable/CONTRIBUTING.md -[3]: https://github.com/valkey-io/valkey/blob/unstable/SECURITY.md +```sh +unix:$ ./cluster stop +``` + + +

(К началу)

+ + + +## Дорожная карта + +- [x] Добавить поддержку хранимых процедур +- [x] Изменить приглашение командной строки клиента clif +- [x] Переписать скрипт cluster.sh, формирующий кластер Futriix +- [x] Убрать поддержку sentinel из проекта +- [ ] Добавить в проект поддержку модуля, позволяющего запускать команды терминала операционной системы +- [ ] Реализовать поддержку алгоритма Raft +- [ ] Добавить поддержку языка запросов SQL + + +См. [Открытые проблемы](https://source.futriix.ru/gvsafronov/Futriix/issues) полный список предлагаемых функций (и известных проблем). + +

(К началу)

+ + +## Вклад + +Вклады — это то, что делает сообщество открытого исходного кода таким замечательным местом для обучения, вдохновения и творчества. Любой ваш вклад **очень ценится**. + +Если у вас есть предложение, которое могло бы улучшить ситуацию, создайте форк репозитория и создайте запрос на включение. Также можно просто открыть задачу с тегом «улучшение». +Не забудьте поставить проекту звезду! Еще раз спасибо! + +1. Форкните проект +2. Создайте свою ветку функций (`git checkout -b Feature/AmazingFeature`) +3. Зафиксируйте свои изменения (git commit -m 'Add some AmazingFeature'`) +4. Отправьте в ветку (`git push origin Feature/AmazingFeature`) +5. Откройте запрос на включение + + +## Лицензия + +Проект распространяется под 3-пунктной лицензией BSD. Подробнсти смотрите в файле `COPYING.txt`. + +

(К началу)

+ + + + +## Контакты + +Григорий Сафронов - [E-mail](gvsafronov@yandex.ru) + +Ссылка на проект (https://source.futriix.ru/gvsafronov/Futriix) + +

(К началу)

\ No newline at end of file