diff --git a/README.md b/README.md index 530b7ae..e72b819 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ * [About](#about) * [Installation](#installation) - [RHEL, Fedora, Rockylinux](#rhel-centos-rockylinux-fedora) - - [Debian, Ubuntu](#debian-ubuntu) - - [macOS](#macos) + - [Ubuntu](#ubuntu) + - [Debian](#debian) + - [macOS](#macosx) - [Windows](#windows) * [Usage guide](#usage-guide) + [Inventory generation](#inventory-generation) @@ -25,7 +26,7 @@ --- ## About -Genin is an inventory generator for Ansible Cartridge. It provides a command-line +Genin is an inventory generator for `Ansible Cartridge`. It provides a command-line tool that allows quick inventory creation for clusters of any size. For example, an inventory file for a cluster of 50 replicasets can easily be of thousand lines or more. Any slight change of the configuration, eg. adding a new configuration @@ -42,40 +43,110 @@ Download and unzip the archive for the desired architecture. --- +#### Linux binary file + +Universal executable: +```shell +curl -sLO https://binary.picodata.io/repository/raw/genin/bin/genin-0.4.8-x86_64-musl.tar.gz +tar -xvf genin-0.4.8-x86_64-musl.tar.gz ; sudo install genin /usr/local/bin/ +``` + +--- + #### RHEL, CentOS, Rockylinux, Fedora There are two installation methods supported for RHEL, CentOS, Rockylinux and Fedora. 1. Installation using the package manager. -Copy and paste the following command into your terminal window: +At first install picodata gpg key: ```shell -sudo bash -c 'cat <<\EOF >> /etc/yum.repos.d/picotools.repo -[picodata.io] -name=picodata.io public repository -baseurl=https://binary.picodata.io/repository/yum/el/$releasever/$basearch/os/ -enabled=1 -gpgcheck=0 -EOF' +sudo rpm --import https://download.picodata.io/tarantool-picodata/el/RPM-GPG-KEY-kdy ``` -After that install **Genin**: +Now add `picodata-release` repository. +RHEL 8.x, CentOS 8.x, Rockylinux 8.x, recent Fedora version ```shell -sudo yum install -y genin +sudo yum install -y https://download.picodata.io/tarantool-picodata/el/8/x86_64/picodata-release-1.1.0.11-1.el8.x86_64.rpm +``` +RHEL 7.x, CentOS 7.x +```shell +sudo yum install -y https://download.picodata.io/tarantool-picodata/el/7/x86_64/picodata-release-1.1.0.11-1.el7.x86_64.rpm +``` +Update yum metadata. +```shell +sudo yum update ``` +Install latest **Genin** package: +```shell +sudo yum install -y genin + +> **Note:** with this installation method, all updates will +> also be available to you using `yum upgrade genin` -2. If you want to install `rpm` packages directly without adding our repository. +2. If you want to install `rpm` packages directly without +adding our repository. ```shell -# RHEL 8.x, CentOS 8.x, Rockylinux 8.x, recent Fedora version -sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.10-1.el8.x86_64.rpm -# RHEL 7.x, CentOS 7.x -sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.10-1.el7.x86_64.rpm +sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.8-1.el8.x86_64.rpm ``` +RHEL 7.x, CentOS 7.x +```shell +sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.8-1.el7.x86_64.rpm +``` + +--- > **Note:** please don't forget to pick the right package for your OS version. +--- + +#### Ubuntu -#### Debian, Ubuntu -We provide the `deb` Genin package for `debian`-based Linux distributions including the Ubuntu family. Use the following command to download and install the package: +A `deb` package with `Genin` is available for installation on `ubuntu`. +Install package possible in two ways. + +1. From the `picodata` repository: +Download and install gpg key: ```shell -curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb +wget -q -O - https://download.picodata.io/tarantool-picodata/ubuntu/picodata.gpg.key | sudo apt-key add - ``` +Add `Picodata` repository: +```shell +sudo add-apt-repository 'deb [arch=amd64] https://download.picodata.io/tarantool-picodata/ubuntu/ focal main' +``` +Install `Genin` package. +```shell +sudo apt install -y genin +``` + +2. Downloading and installing the package directly: +```shell +curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.8.amd64.deb && sudo dpkg -i genin-0.4.8.amd64.deb +``` + +--- + +#### Debian + +A `deb` package with `Genin` is available for installation on `debian`. Install package +possible in two ways. + +1. From the `picodata` repository: +Download and install gpg key: +```shell +wget -q -O - https://download.picodata.io/tarantool-picodata/ubuntu/picodata.gpg.key | sudo apt-key add - +``` +Add `Picodata` repository: +```shell +sudo add-apt-repository 'deb [arch=amd64] https://download.picodata.io/tarantool-picodata/debian/ bullseye main' +``` +Install `Genin` package. +```shell +sudo apt install -y genin +``` + +2. Downloading and installing the package directly: +```shell +curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.8.amd64.deb && sudo dpkg -i genin-0.4.8.amd64.deb +``` + +--- #### MacOSX Installing with the `homebrew` package manager is the easiest way to @@ -92,18 +163,27 @@ brew install genin Use the following command to grab and install Genin in macOS (10.10+) wihtout homebrew: ```shell -curl -L https://binary.picodata.io/repository/raw/genin/apple/genin-0.4.10-darwin-amd64.zip -o genin-0.4.10-darwin-amd64.zip -unzip genin-0.4.10-darwin-amd64.zip -d ~/bin/ +curl -L https://binary.picodata.io/repository/raw/genin/apple/genin-0.4.8-darwin-amd64.zip -o genin-0.4.8-darwin-amd64.zip +unzip genin-0.4.8-darwin-amd64.zip -d ~/bin/ ``` > **Note:** The application can then be found under the `~/bin` directory. > Make sure the directory is in your `$PATH`. +If you want to install a specific version, you can see the list of versions +using the command: +```shell +brew search genin +``` +Install specific version: +```shell +brew install genin@0.3.8 +``` #### Windows Use the following command to grab and install Genin in Windows 7 64 bit or newer: ```shell -curl.exe -L https://binary.picodata.io/repository/raw/genin/windows/genin-0.4.10-darwin-amd64.zip -o genin-0.4.10-windows-amd64.zip -unzip.exe genin-0.4.10-windows-amd64.zip -d %HOME%/.cargo/bin/ +curl.exe -L https://binary.picodata.io/repository/raw/genin/windows/genin-0.4.8-darwin-amd64.zip -o genin-0.4.8-windows-amd64.zip +unzip.exe genin-0.4.8-windows-amd64.zip -d %HOME%/.cargo/bin/ ``` > **Note:** The application can then be found under the `.cargo/bin` folder inside > your user profile folder. Make sure it is in your `%PATH%`. @@ -119,23 +199,31 @@ genin --version ### Inventory generation First, let's generate a simple cluster for the `Vagrant` virtual environment. -For that `Genin` will need a `yaml` file with a concise list of cluster details. That is a minimal cluster -configuration file that features `Genin's` own formatting. As long as users will likely need to have a descriptive template of that file, `Genin` can automatically generate it with a built-in dedicated subcommand: +For that `Genin` will need a `yaml` file with a concise list of cluster +details. That is a minimal cluster configuration file that features `Genin's` +own formatting. As long as users will likely need to have a descriptive +template of that file, `Genin` can automatically generate it with a built-in +dedicated subcommand: ```shell genin init ``` -This will result in creating the `cluster.genin.yaml` file in the current directory. +This will result in creating the `cluster.genin.yaml` file in the current +directory. -> **Note:** If the `cluster.genin.yml` file already exists in current directory, then the new file will be named `cluster.genin.copy.yaml`. -> The `genin init` command will always append the `.copy` suffix to the file's name if the expected file exists. +> **Note:** If the `cluster.genin.yml` file already exists in current +> directory, then the new file will be named `cluster.genin.copy.yaml`. +> The `genin init` command will always append the `.copy` suffix to the +> file's name if the expected file exists. Also, you can explicitly set the configuration file name: ```shell genin init --output mycluster.yml ``` -> **Note:** Use the `--output` flag together with the full path to `mycluster.yml` to specify the directory where the final cluster files will be saved. +> **Note:** Use the `--output` flag together with the full path to +> `mycluster.yml` to specify the directory where the final cluster +> files will be saved. Now you can open the file and examine the syntax. @@ -143,7 +231,7 @@ Now you can open the file and examine the syntax. --- # list of replicasets as an array topology: - # replicaset looks like item in array + # List of replicasets as an array of arrays, where each element is a replicaset with a replica set - name: router # (mandatory) replicaset name replicasets_count: 1 # (optional) how many masters we want, by default equal 1 replication_factor: 0 # (optional) number of replicas in replicaset, default for router 0 @@ -166,7 +254,7 @@ topology: # map of regions, datacenters, and hosts hosts: - - name: cloud # (mandatory) hostname or domain name + - name: cloud # (mandatory) hostname or domain name # in this example, both hosts are in the same cloud data center config: # (optional) begin binary and http port, by default 8081, 3031 # ports can be defined on all levels @@ -198,32 +286,41 @@ vars: # put here you personally key/value ansible cartridge vars ``` -Replace the stubs with the actual values of your hosts and their parameters and save the file. - +Replace the stubs with the actual values of your hosts and their parameters +and save the file. -So far you are already halfway through getting things done! Use the resulted `Genin` configuration file to generate the final inventory file. -Here is the required command for that: +So far you are already halfway through getting things done! Use the resulted +`Genin` configuration file to generate the final inventory file. Here is the +required command for that: ```shell genin build ``` -Done! The `inventory.yaml` file will appear in the same directory where you launched `Genin`. Now we -can set up the cluster: +Done! The `inventory.yaml` file will appear in the same directory where you +launched `Genin`. Now we can set up the cluster: ```shell ansible-playbook -i inventory.yaml playbook.yaml ``` -### Editing config +--- + +### Editing the cluster configuration + +--- + +#### Minimal configuration -The initial cluster configuration file can be slimmed down to the following minimal variant: +The initial cluster configuration file can be slimmed down to the following +minimal variant: ```yaml --- topology: - - name: router # since the number of replicasets is not set, - # the default will be 1 replicase with 1 replica + - name: router # since replicasets_count is not set for this replicaset, + # and also no roles are set, then the genin will automatically determine it by name as + # router and set the number of replicas in the replication set to 1 (replication count: 1) - name: storage replicasets_count: 3 replication_factor: 2 @@ -231,22 +328,31 @@ topology: hosts: - name: cloud config: - address: 192.168.16.12/32 + address: 192.168.12/32 hosts: - - name: host-1 # ip will be set 192.168.16.12 - - name: host-2 # ip will be set 192.168.16.13 + - name: host-1 # ip 192.168.16.12 will be automatically allocated from the above subnet + - name: host-2 # ip 192.168.16.13 will be automatically allocated from the above subnet ``` -This is a perfectly valid and working configuration file. The rest of the parameters wil use their default values. +This is a perfectly valid and working configuration file. The rest of the +parameters wil use their default values. + +--- + +#### Changing the Topology -Let's now extend the configuration file with a more real-world example featuring 10 hosts, 10 routers, 10 storages, and a default number of storage -replicas (1). We will also define a different replicaset type - `cache`. +--- + +Now let's change the file, and expand our cluster to make the inventory more +similar to the real one. To do this, we will increase the number of routers of +hosts, routers, stacks up to 10. Change the number of storage replicas to 1, +and add a custom replicaset `cache` in the amount of 5 pieces. ```yaml --- topology: - name: router - replication_factor: 10 # this replicaset has no roles defined and its name is a router, + replication_factor: 10 # this replicaset has no roles defined and its name is a router, # so the replicasets_count parameter will be ignored # and the default number of replicasets will be set to 1 - name: storage @@ -289,70 +395,304 @@ hosts: config: address: 192.168.16.20 ``` -The actual difference between the 2 replicasets configuration and a large cluster configuration -is not that great, whereas the resulting inventory file for the large cluster will be 5 times bigger. +The actual difference between the 2 replicasets configuration and a large +cluster configuration is not that great, whereas the resulting inventory file +for the large cluster will be 5 times bigger. -Let's take a look at few more helpful configuration flags, this time regarding the failover capability: +--- + +#### Redefining failover + +--- + +Until now, our cluster has always been with `stateful failover` , now let's +change it to `disabled` and run the generation with the command: ```shell -genin init --failover-mode disabled +genin build --failover-state-provider etcd2 ``` -The above option completely removes all failover parameters for all stages. +> **Note:** All options have a short version, for example for provider +> failover is `genin build -F etcd2` +This flag will override the failover type we specified in `cluster.genin.yaml`, +and add default values based on those recommended for `etcd2`. + +The options related to failover and other subcommands work in the same way. ```shell -genin build --failover-state-provider etcd2 # eg genin build -F etcd2 +genin init --failover-mode disabled ``` -The above option will redefine the type of the entity serving the failover. +`disabled` argument for `failover-mode` and `failover-state-provider` disable +failover. + +You can learn more about the operation of the failover and the possible options +in the documentation. [Tarantool documentation](https://www.tarantool.io/ru/doc/1.10/book/cartridge/topics/failover/). -For more options see the [Tarantool documentation](https://www.tarantool.io/ru/doc/1.10/book/cartridge/topics/failover/). +--- -> **Note:** Failover options work for all `genin` subcommands. +#### Balancing and distribution control -### Flags and options +By default, `Genin` always allocates instances based on the current host load. +For example the following configuration for a genin would be distributed in +the following way: + +```yaml +--- +topology: + - name: router + replicasets_count: 4 + roles: + - router + - failover-coordinator + - name: storage + replicasets_count: 2 + replication_factor: 4 + roles: + - storage + - name: cache + replicasets_count: 2 + roles: + - cache +hosts: + - name: dc-1 + hosts: + - name: server-1 + address: 192.168.16.11 + - name: server-2 + address: 192.168.16.12 + - name: dc-2 + hosts: + - name: server-3 + address: 192.168.16.13 + - name: server-4 + address: 192.168.16.14 +... +``` + +![default-spreading](docs/images/default-spreading.gif) + +Although for most automatic distribution clusters `Genin` should be enough, +there can always be a situation where some replicasets must be allocated to +a specific host or group of hosts. For this there is a special option +`failure_domains` in the `Genin` configuration. + +```yaml +--- +topology: + - name: router + replicasets_count: 4 + roles: + - router + - failover-coordinator + - name: storage + replicasets_count: 2 + replication_factor: 4 + roles: + - storage + - name: cache + replicasets_count: 2 + failure_domains: [dc-2] + roles: + - cache +hosts: + - name: dc-1 + hosts: + - name: server-1 + address: 192.168.16.11 + - name: server-2 + address: 192.168.16.12 + - name: dc-2 + hosts: + - name: server-3 + address: 192.168.16.13 + - name: server-4 + address: 192.168.16.14 +... +``` +This will cause Genin to allocate the cache replicaset as follows: + +![failure-domains-1](docs/images/failure-domains-1.gif) + +If you specify several host names in `failure_domains` at once +`[ server-2, server-3 ]`, then `cache` replicaset instances are guaranteed +will be on the specified hosts. + +![failure-domains-2](docs/images/failure-domains-2.gif) + +--- + +### Reverse parsing config + +Since `Genin` is a relatively new tool, and `picodata` is far from full +`tarantool` clusters were generated with it, then to simplify transition +there is a `reverse` command. -Here we describe few other useful flags and options that you might want to use with `genin`. -First, you can always change paths of both source and target configuration files usin the `--source` (short `-s`) and `--output` (short `-o`) flags respectively. -We recommend using the `.genin.` suffix for naming convenience. Here is the example command in two variants: ```shell -genin build --source /home/user/path/my_cluster.genin.yml --output /home/tarantool/cluster-new/my_hosts.yml -genin build -s /home/user/path/my_cluster.genin.yml -o /home/tarantool/cluster-new/my_hosts.yml +genin reverse -s inventory.yml -o cluster.genin.yml ``` -Next, there is a very useful option for controlling the log output. There are three supported log levels that you can enable using the `-v` flag with a desired number of extra `v` letters for more verbosity (up to `-vvv`). Single `v` means *INFO*, double means -*DEBUG*, and three or more mean *TRACE*. +This command allows you to parse the already finished inventory and get the +configuration `cluster.genin.yml` for `genin build`. Why might this be needed? +For example for the `upgrade` command. which serves to add new replicasets or +instances and requires 2 configuration files. + +The `reverse` command has several important features: +1. Since the inventory is a flat list, without division by domains, data +centers, regions, then `genin` cannot know anything about the structure and +will generate a flat configuration too. + +For example, if we go through a loop, then we will lose all information about +`failure` domains: +```shell +genin init -o cluster.genin.yml +genin build -s cluster.genin.yml -o inventory.yml +genin reverse -o inventory.yml ``` -genin build -vvv + +The last command, the `reserve` call, will display the table without domains. +```text ++-------------+-------------+ +| cluster | ++-------------+-------------+ +| server-1 | server-2 | ++-------------+-------------+ +| router-1-1 | storage-1-1 | +| 8081 8081 | 8081 8081 | ++-------------+-------------+ +| storage-1-2 | storage-2-1 | +| 8082 8082 | 8082 8082 | ++-------------+-------------+ +| storage-2-2 | | +| 8083 8083 | | ++-------------+-------------+ +``` + +2. The configuration file received in using `reverse` will also have +slightly different configuration. + +```yaml +--- +topology: + - name: router + replicasets_count: 1 + replication_factor: 1 + roles: + - router + - failover-coordinator + config: + http_port: 8081 + binary_port: 8081 + address: 192.168.16.11 + - name: storage + replicasets_count: 2 + replication_factor: 2 + roles: + - storage + config: + http_port: 8082 + binary_port: 8082 + address: 192.168.16.11 +hosts: + - name: server-1 + config: + address: 192.168.16.11 + - name: server-2 + config: + address: 192.168.16.12 +failover: + mode: stateful + state_provider: stateboard + stateboard_params: + uri: "192.168.16.11:4401" + password: password +vars: + ansible_user: ansible + ansible_password: ansible + cartridge_app_name: myapp + cartridge_cluster_cookie: myapp-cookie + cartridge_package_path: /tmp/myapp.rpm + cartridge_bootstrap_vshard: true ``` -> **Note:** All commands without source and output options always check for files in the current -> directory (namely cluster.genin.yaml, inventory.yaml) -The `--print-opts` (short `-p`) flag allows you to select the print output options. By default, -only the distribution of replicasets over the hosts is shown. +#### Cluster reconfiguration +To update a deployed cluster using the generated `Genin` inventory, there is +a special `upgrade` command for adding new instances. Unlike inventory +regeneration, when which all instances are redistributed each time anew, +`upgrade` will leave distribution as is, and will only add new instances. +This will allow painlessly upgrade the cluster, without a full redeploy. -Sometimes it can be useful to quickly change the `failover-mode` using the flag without changing -the cluster configuration. This can be done during the first initialization stage (`genin init`), or later on with other `Genin` subcommands. Possible variants of the flag values are `stateful` (default), `eventual`, -`disabled`. +To run `upgrade` you need to pass two required arguments `--old` +and `--new`. ```shell -genin init --failover-mode eventual +genin upgrade --old cluster.genin.yml --new upgrade.genin.yml -s inventory.yml ``` -> **Note:** Setting the failover mode to *stateful* allows using the *failover-state-provider* flag (possible values are `stateboard` or `etcd2`). +The `--old` option specifies the path to the old cluster config we want +to do an `upgrade`. +Option `--new` path to new cluster configuration based on which `Genin` +will make `diff` and add those instances that were not in the config passed to +`--old`. + +| Old | New | Diff | +|---------------------------------------------------------------------------|---------------------------------------------------------------------------|---------------------------------------------------------------| +|
- name: router
replicasets_count: 2 |
- name: router
replicasets_count: 4 |
router-3
router-4 | +|
- name: storage
replicasets_count: 2
replication_factor: 2 |
- name: storage
replicasets_count: 2
replication_factor: 4 |
storage-1-3
storage-1-4
storage-2-3
storage-2-4 | + +--- + +> **Note:** currently, cluster `downgrade` is only partially implemented and +> requires manual verification of the resulting inventory. + +--- +### Flags and options + +Here we describe few other useful flags and options that you might want to +use with `genin`. +First, you can always change paths of both source and target configuration +files using the `--source` (short `-s`) and `--output` (short `-o`) flags +respectively. We recommend using the `.genin.` suffix for naming convenience. +Here is the example command in two variants: ```shell -genin init --failover-mode stateful --failover-state-provider etcd2 +genin init --output /home/tarantool/custom_cluster_name.yml +genin show --source /home/tarantool/custom_cluster_name.yml +genin build --source /home/user/path/my_cluster.genin.yml --output /home/tarantool/cluster-new/my_hosts.yml +genin build -s /home/user/path/my_cluster.genin.yml -o /home/tarantool/cluster-new/my_hosts.yml +``` +> **Note:** It is worth reiterating that if any of the subcommands +> `build`, `init` etc. `Genin` will look for files with default names +> (such as cluster.genin.yaml, inventory.yaml) + +Next, there is a very useful option for controlling the log output. There +are three supported log levels that you can enable using the `-v` flag with +a desired number of extra `v` letters for more verbosity (up to`-vvv`). +Single `v` means *INFO*, double means *DEBUG*, and three or more mean *TRACE*. ``` +genin build -vvv +``` + +--- + +> **Note** The number of displayed information increases with the addition of new +> occurrences of `-v`. For example `-vv` will be equivalent to *TRACE* level + +--- + +There is an option `--scheme` to control how the schema is displayed (short +option -p) which accepts a sequence of equivalent characters display options. + +// Character table under development + +In addition, flags exist to convey sensitive information. -You can also provide personal information or credentials using these options, such as user and -password for the server where the cluster is being deployed, or the cluster cookie. ```shell genin build --ansible-user dmitry.travyan --ansible-password ddfqd genin build --cartridge-cluster-cookie R68sJfV4C2hLrWC3 ``` -As we have known from earlier paragraphs, by default `Genin` will create the copy of the file -if the target file already exists in the specified path. Use the`--force` flag (or short `-f`) -to explicitly overwrite the target. +As mentioned earlier, by default, `Genin` will create copies of files if +The target file already exists in the specified path. In order to force +overwrite the target file, there is a `--force` flag (or short `-f`). ```shell genin build -o my-cluster.yml genin build -o my-cluster.yml --force @@ -360,7 +700,7 @@ genin build -o my-cluster.yml --force ## Building from sources -At first you need to clone the source code. +At first, you need to clone the source code. ```shell git clone https://github.com/picodata/genin.git ``` @@ -369,7 +709,10 @@ Second, you need to install Rust build tools. ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` + +--- > **Note:** You should refresh the `$PATH` variable to get access to locally installed `rust binaries`. +--- After installing all required tools it is time to build and install `genin`. ```shell @@ -379,6 +722,7 @@ cargo +nightly build --release install -m 001 target/release/genin /usr/local/bin/ ``` +--- > **Note:** Do not forget to install build tools and dependencies before building `genin`. > > For Debian-based distributions: @@ -390,21 +734,24 @@ install -m 001 target/release/genin /usr/local/bin/ > sudo yum install -y gcc > ``` > For macOS make sure you have `Command Line Developer Tools` installed (`xcode-select --install`). +--- -Сheck that the installation was successful: +Check that the installation was successful: ```shell genin --version ``` ## Contributing -Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. +Pull requests are welcome. For major changes, please open an issue first to +discuss what you would like to change. Please make sure to update tests as appropriate. ## Versioning -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/picodata/genin/tags). +We use [SemVer](http://semver.org/) for versioning. For the versions available, +see the [tags on this repository](https://github.com/picodata/genin/tags). ## Authors diff --git a/README.ru.md b/README.ru.md index 0c80a53..52cfde5 100644 --- a/README.ru.md +++ b/README.ru.md @@ -9,6 +9,7 @@ - [GENIN](#genin) * [Что такое генин?](#что-такое-genin) * [Установка](#установка) + - [Linux bin файл](#linux-bin-файл) - [RHEL, Fedora, Rockylinux](#rhel-centos-rockylinux-fedora) - [Ubuntu](#ubuntu) - [Debian](#debian) @@ -49,8 +50,8 @@ Genin уже заранее скомпилирован под разные ар Универсальный исполняемый файл: ```shell -curl -sLO https://binary.picodata.io/repository/raw/genin/bin/genin-0.4.10-x86_64-musl.tar.gz -tar -xvf genin-0.4.10-x86_64-musl.tar.gz ; sudo install genin /usr/local/bin/ +curl -sLO https://binary.picodata.io/repository/raw/genin/bin/genin-0.4.8-x86_64-musl.tar.gz +tar -xvf genin-0.4.8-x86_64-musl.tar.gz ; sudo install genin /usr/local/bin/ ``` --- @@ -74,7 +75,10 @@ RHEL 7.x, CentOS 7.x ```shell sudo yum install -y https://download.picodata.io/tarantool-picodata/el/7/x86_64/picodata-release-1.1.0.11-1.el7.x86_64.rpm ``` - +Обновите метаданные yum. +```shell +sudo yum update +``` Теперь можно запустить установку последней версии genin **Genin**: ```shell sudo yum install -y genin @@ -84,11 +88,11 @@ sudo yum install -y genin 2. Так же вы можете установить пакет `rpm` напрямую без добавления нашего репозитория. RHEL 8.x, CentOS 8.x, Rockylinux 8.x, recent Fedora version ```shell -sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.10-1.el8.x86_64.rpm +sudo rpm -i https://binary.picodata.io/repository/yum/el/8/x86_64/os/genin-0.4.8-1.el8.x86_64.rpm ``` RHEL 7.x, CentOS 7.x ```shell -sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.10-1.el7.x86_64.rpm +sudo rpm -i https://binary.picodata.io/repository/yum/el/7/x86_64/os/genin-0.4.8-1.el7.x86_64.rpm ``` > **Note:** будьте внимательны, так как при выборе не правильной версии ос могут быть ошибки > при установке `rpm` @@ -115,7 +119,7 @@ sudo apt install -y genin 2. Загрузкой и установкой пакета напрямую: ```shell -curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb +curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.8.amd64.deb && sudo dpkg -i genin-0.4.8.amd64.deb ``` --- @@ -140,7 +144,7 @@ sudo apt install -y genin 2. Загрузкой и установкой пакета напрямую: ```shell -curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.10.amd64.deb && sudo dpkg -i genin-0.4.10.amd64.deb +curl -sLO https://binary.picodata.io/repository/raw/genin/deb/genin-0.4.8.amd64.deb && sudo dpkg -i genin-0.4.8.amd64.deb ``` --- @@ -160,14 +164,24 @@ brew install genin Для установки без помощи homebrew используйте следующие команды для загрузки и установки Genin на macOS (10.10+): ```shell -curl -sLO https://binary.picodata.io/repository/raw/genin/osx/genin-0.4.10-x86_64-macosx.tar.gz -unzip genin-0.4.10-darwin-amd64.zip -d ~/bin/ +curl -sLO https://binary.picodata.io/repository/raw/genin/osx/genin-0.4.8-x86_64-macosx.tar.gz +unzip genin-0.4.8-darwin-amd64.zip -d ~/bin/ ``` --- - > **Note:** Genin будет распакован в директорию `~/bin`. Перед использованием приложения > пожалуйста удостоверьтесь что `~/bin` добавлена в переменную окружения `$PATH` +--- + +Если вы хотите установить какую то конкретную версию, то список версий можно посмотреть +с помощью команды: +```shell +brew search genin +``` +Установить конкретную версию: +```shell +brew install genin@0.3.8 +``` --- @@ -175,8 +189,8 @@ unzip genin-0.4.10-darwin-amd64.zip -d ~/bin/ Используйте следующие команды для скачивания и установки Genin на операционных системах Windows 7 64 и новее. ```shell -curl.exe -sLO https://binary.picodata.io/repository/raw/genin/win/genin-0.4.10-win64.zip -unzip.exe genin-0.4.10-win64.zip -d %HOME%/.cargo/bin/ +curl.exe -sLO https://binary.picodata.io/repository/raw/genin/win/genin-0.4.8-win64.zip +unzip.exe genin-0.4.8-win64.zip -d %HOME%/.cargo/bin/ ``` > **Note:** Genin будет распакован в директорию `.cargo/bin` которая находится в домашнем > каталоге важего пользователя. Перед использованием приложения пожалуйста удостоверьтесь @@ -186,7 +200,7 @@ unzip.exe genin-0.4.10-win64.zip -d %HOME%/.cargo/bin/ ``` genin --version ``` -Если вы видите сообщение `genin 0.4.10` значит установка прошла успешно. +Если вы видите сообщение `genin 0.4.8` значит установка прошла успешно. --- ## Руководство по использованию @@ -255,7 +269,7 @@ topolgy: # список хостов на который будет устанавливаться кластер hosts: - - name: cloud # (обязательно) имя хоста или домена + - name: cloud # (обязательно) имя хоста или домена # в данном примере оба хоста находятся в одном датацентре cloud config: # (опционально) порты с которых начнется распределение, по умолчанию 8081, 3031 # для удобства, что бы не задавать порты для каждого сервера на нижний уровнях @@ -314,6 +328,7 @@ ansible-playbook -i inventory.yaml playbook.yaml --- #### Минимальная конфигурация + Для начала давайте посмотрим как выглядел бы файл конфигурации в минималистичном варианте. @@ -404,7 +419,7 @@ hosts: Количество изменений в конфигурации для `Genin` совсем небольшое по сравнению с первым примером , а размер итогового `invetory.yaml` для отредактированного кластера отличается в 5 раз. А теперь попробуйте увличить количество `storage` -до 100шт. +до 100шт. Now try increasing the amount of `storage` up to 100pcs. ---