Skip to content

Commit

Permalink
Update default cluster configuratuion
Browse files Browse the repository at this point in the history
- Removed default cluster configuration that caused naming errors.
 - Added new default cluster configuration from the base yml config.
- Removed support for v1 host and instance configurations
  • Loading branch information
Alexandr Sorokin committed Sep 19, 2024
1 parent e3388b4 commit b26192f
Show file tree
Hide file tree
Showing 28 changed files with 1,845 additions and 1,300 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ node_modules
/deploy/terraform.tfstate.backup
./*.genin.yml
./*.genin.yaml
!/configs/*.yaml
!/configs/*.yml
!/docs/examples/*
/tests/.*
.geninstate
73 changes: 73 additions & 0 deletions configs/cluster.genin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# List of replicasets as an array
topology:
- name: router
# How many masters we want, by default equal 1
replicasets_count: 1
# Array of roles for this instance
roles:
- router
- failover-coordinator
- name: storage
# How many masters we want, by default equal 1
replicasets_count: 2
# Number of replicas in replicaset, default 0
replication_factor: 2
# Array of roles for this instance
roles:
- storage
# List of regions, datacenters, and servers
hosts:
- name: datacenter-1
# Config with arbitrary key-values pairs
config:
# Specify http port to start counting from
http_port: 8081
# Specify binary port to start counting from
binary_port: 3031
# List of regions, datacenters, and servers
hosts:
- name: server-1
# Config with arbitrary key-values pairs
config:
# Specify http port to start counting from
http_port: 8081
# Specify binary port to start counting from
binary_port: 3031
# Host or instance address (maybe IP or URI)
address: 192.168.16.11
- name: server-2
# Config with arbitrary key-values pairs
config:
# Specify http port to start counting from
http_port: 8081
# Specify binary port to start counting from
binary_port: 3031
# Host or instance address (maybe IP or URI)
address: 192.168.16.12
# Failover management options
failover:
# Failover mode (stateful, eventual, disabled)
mode: stateful
# What is serve failover (stateboard, stateful)
state_provider: stateboard
# Params for chosen in state_provider failover type
stateboard_params:
# Uri on which the stateboard will be available
uri: "192.168.16.11:4401"
# Stateboard password
password: password
# Vars similar to those configured in the cartridge inventory
vars:
# Username under which the ansible will connect to the servers
ansible_user: ansible
# Ansible user password
ansible_password: ansible
# Application name
cartridge_app_name: myapp
# Cookie for connecting to the administrative console of the instances
cartridge_cluster_cookie: myapp-cookie
# Path to the application package
cartridge_package_path: /tmp/myapp.rpm
# Indicates if vshard must be bootstrapped on the cluster
cartridge_bootstrap_vshard: true
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const DEFAULT_STATEBOARD_PORT: u16 = 4401;
const DEFAULT_HTTP_PORT: u16 = 8081;
const DEFAULT_BINARY_PORT: u16 = 3031;

const DEFAULT_CFG_NAME: &str = "cluster.genin.yml";
const DEFAULT_CFG: &[u8] = include_bytes!("../configs/cluster.genin.yml");

fn main() -> Result<(), Box<dyn std::error::Error>> {
task::run_v2()?;
Ok(())
Expand Down
2 changes: 0 additions & 2 deletions src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ pub trait Validate {
type Error: fmt::Debug + ToString;

fn validate(bytes: &[u8]) -> Result<Self::Type, Self::Error>;

fn whole_block(bytes: &[u8]) -> String;
}

trait AsError {
Expand Down
Loading

0 comments on commit b26192f

Please sign in to comment.