Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using datacenter as zone #147

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Using datacenter as zone #147

merged 4 commits into from
Apr 24, 2024

Conversation

lowitea
Copy link
Collaborator

@lowitea lowitea commented Dec 7, 2023

Proof of concept

@avprotsenko
Copy link
Collaborator

Cluster topology:

---
topology:
  - name: router
    replicasets_count: 2
    failure_domains: [router-1-1, router-2-1]
    roles:
      - ttc.roles.router
      - failover-coordinator
  - name: storage
    replicasets_count: 2
    replication_factor: 2
    failure_domains: [storage-1-1, storage-2-1]
    roles:
      - ttc.roles.storage
hosts:
  - name: DC1
    config:
      http_port: 8081
      binary_port: 3031
    hosts:
      - name: router-1-1
        hosts:
          - name: c1-rt1
            config:
              address: 192.168.137.3
      - name: storage-1-1
        hosts:
          - name: c1-db1
            config:
              address: 192.168.137.4
  - name: DC2
    config:
      http_port: 8081
      binary_port: 3031
    hosts:
      - name: router-2-1
        hosts:
          - name: c2-rt1
            config:
              address: 192.168.137.13
      - name: storage-2-1
        hosts:
          - name: c2-db1
            config:
              address: 192.168.137.14
failover:
  mode: disabled
vars:
  ansible_user: vagrant
  ansible_password: vagrant
  cartridge_app_name: app
  cartridge_cluster_cookie: cookie
  cartridge_package_path: "../app.tar.gz"

Steps to reproduce:

genin upgrade --old cluster.genin.old.yml --new cluster.genin.new.yml --fd-as-zone
genin upgrade --from-latest-state --new cluster.genin.new.yml -f --fd-as-zone

Error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: GeninError { err_kind: UnknownFailureDomain, err: "none of the hosts [c1-rt1 ] are eligible for the failure domain [router-1-1]" }', src/task/cluster/hst/v2.rs:283:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@alrsorokin alrsorokin requested review from Kasen and ftelnov April 19, 2024 12:22
@alrsorokin alrsorokin self-assigned this Apr 19, 2024
@alrsorokin alrsorokin marked this pull request as ready for review April 19, 2024 12:23
@alrsorokin
Copy link
Collaborator

Closes #157
Комментарий Алексея чинит PR #156

@alrsorokin alrsorokin changed the title Add dirty hack for using datacenter as zone Using datacenter as zone Apr 22, 2024
Alexandr Sorokin added 2 commits April 23, 2024 12:43
…what level

nesting `hosts` contains the required name `zone`

For example, when configuring:
```yaml
hosts:
  - name: region
    hosts:
      - name: datacenter
        hosts:
          - name: host
```
Team:
```shell
genin build --fd-as-zone=2
```
We get:
```yaml
hosts:
  role:
    zone: datacenter
    config:
```
    ---

    After each execution of the `genin build` command, the cluster state will be generated.
    By default, the state will be stored in the `.geninstate` directory.
    For all cluster changes, Genin is based on the "latest" state and
    after updating it overwrites it.

    ❗ Loss of `.geninstate` directory or `latest` state, `genin build` command recreates
    configuration with new state
    ❗ `genin build --recreate` recreates the configuration with a new state

    ---

    The `--fd-as-zone` option takes the value 1..255, which indicates at what level
        nesting `hosts` contains the required name `zone`

        For example, when configuring:
        ```yaml
        hosts:
          - name: region
            hosts:
              - name: datacenter
                hosts:
                  - name: host
        ```
        Team:
        ```shell
        genin build --fd-as-zone=2
        ```
        We get:
        ```yaml
        hosts:
          role:
            zone: datacenter
            config:
        ```
@Kasen Kasen merged commit f51da44 into master Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants