15 Kasım 2021 Pazartesi

Vitess Cell Nedir?

Açıklaması şöyle. Cell içinde read, write ve topoloji işlemleri için sunucular bulunur
A cell is a group of servers and associated network infrastructure collocated in an area, and isolated from failures in other cells. It is typically either a full data center or a subset of a data center, sometimes called a zone or availability zone. Vitess gracefully handles cell-level failures, such as when a cell is isolated from other cells by a network failure. A useful way to think of a cell is as a failure domain.
Bir başka açıklama şöyle. Aşağıdaki 2. maddeye denk geliyor. Burada cell, cloud terminoloji ile düşünülünce region ile aynı şey.
Vitess supports cross region deployments. Vitess has a concept called cells. A cell is a grouping of hosts that is considered to have a separate failure boundary from other cells. For example a deployment of Vitess might use AWS regions as Vitess cells.
Yani cell denilince 
1. eğer data center birden fazla availability zone içeriyorsa availability zone  
2. eğer içermiyorsa direkt data center anlaşılabilir. 

Benim gördüğüm örnekte her data center 3 tane availability zone'dan oluşuyordu yani 3 tane cell vardı.

Her cell kendi topolojisini bilir. Açıklaması şöyle
Each cell in a Vitess implementation has a local Topology Service, which is hosted in that cell. The Topology Service contains most of the information about the Vitess tablets in its cell. This enables a cell to be taken down and rebuilt as a unit.
Vitess read sorgularını cell içinden getirir, write sorgularını ise başka cell'lere gönderir. Açıklaması şöyle
Vitess limits cross-cell traffic for both data and metadata. Vitess currently serves reads only from the local cell. Writes will go cross-cell as necessary, to wherever the master for that shard resides.
Örnek
Şöyle yaparız
for keyspace in commerce; do
  for shard in 0; do
    for tabletCount in 0 1 2; do
      CELL=$cell TABLET_UID=$tabletId ./scripts/mysqlctl-up.sh
      CELL=$cell KEYSPACE=$keyspace SHARD=$shard TABLET_UID=$tabletId ./scripts/vttablet-up.sh
      echo "Tablet id created $tabletId"
      tabletId=`expr $tabletId + 1`
      echo "Tablet id incremented $tabletId"
    done
  done
done

set +e

# set one of the replicas to master
vtctlclient InitShardMaster -force commerce/0 zone1-100
echo "Master 1 Initalized>>>>>>>>>>>>>>"

for keyspace in commerce; do
  for shard in 1; do
    for tabletCount in 0 1 2; do
      CELL=$cell TABLET_UID=$tabletId ./scripts/mysqlctl-up.sh
      CELL=$cell KEYSPACE=$keyspace SHARD=$shard TABLET_UID=$tabletId ./scripts/vttablet-up.sh
      echo "Tablet id created $tabletId"
      tabletId=`expr $tabletId + 1`
      echo "Tablet id incremented $tabletId"
    done
  done
done

vtctlclient InitShardMaster -force commerce/1 zone1-103
echo "Master 2 Initalized>>>>>>>>>>>>>>"

Hiç yorum yok:

Yorum Gönder

CREATE EVENT - Scheduled Task İçindir

Örnek Şöyle yaparız CREATE EVENT myevent     ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR     DO       UPDATE myschema.mytable SET myc...