Leaf Spine design based on CLOS Architecture

As we move towards the Cloud and the given disruptive changes in technology space there has been a lot of improvements changes in data center network architecture. Traditional Datacenter architectures are based on a three-tier architecture which consists of Access →Distributin →Core switches.T his worked well and there has been a lot of advantages to this design.

Three tier architecture has its own advantages in terms of

  1. Failures can be easily isolated to Pods.
  2. Security and performance issues can be isolated on a Pod level and an easy to identify and troubleshoot.

Now, what changes were virtualization and cloud-scale architecture.E-W traffic constitutes to 80% of the data center traffic nowadays which caused increased need of bandwidth inside the DC .3 tier architecture was designed with N-S traffic in mind and so was the case for older infrastructures. Servers which are connected to different pods have to go through increased hops to reach the destination and thereby increasing the traffic congestion overall.

Networks based on Clos network architecture aka Leaf-spine architecture are specifically designed for large-scale computing needs.

This is a clos switching 3 stage architecture. Invented by Edson Erwin and formalized by Charles clos .

Coming to DC network the design looks like this.

Here the major problems if hop count and scalability problems with 3 tier architecture have been addressed as each server connected to Leaf switch are equidistant from one another and all packets in E-W traffic has to go through same hop count. Regarding scalability here, we are free to do horizontal scaling and in case if we need to add more computers and more bandwidth adding a Leaf (if requires spine) will do the job.

Sources

https://www.nanog.org/sites/default/files/monday.general.hanks.multistage.10.pdf

https://lenovopress.com/lp0573.pdf

OpenStack DB Error : (pymysql.err.InternalError) (1071,1071 – Specified key was too long; max key length is 767 bytes

Openstack Liberty

DB Error : (pymysql.err.InternalError) (1071,1071 – Specified key was too long; max key length is 767 bytes

 

1) Replace all instances of ‘utf8mb4’ with ‘utf8’ in /etc/mysql/mariadb.conf.d/*2) Add the below to /etc/mysql/conf.d/mysqld_openstack.cnf:

cat /etc/mysql/conf.d/mysqld_openstack.cnf:
[client]
default-character-set = utf8
[mysqld]
bind-address = <<IP>>
default-storage-engine =###
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8’
character-set-server = utf8
[mysql]
default-character-set = utf8

3) Drop the keystone database
4) Restart mysql service
5) Run ‘keystone-manage db_sync’

 Modify the files in /etc/mysql/mariadb.conf.d/ was also necessary to fix.

Using Git/GitHub for Linux configuration management

Create a public repository in GitHub

https://help.github.com/articles/create-a-repo/

  

 
root@web01:/home/sree/conf_git# git clone https://github.com/stackerboy/firstrepo.git
Cloning into ‘firstrepo’…remote: Counting objects: 15, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 15 (delta 0), reused 9 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), done.
Checking connectivity… done..


This command will clone your repository created on GitHub to your local directory

my local directory

root@web01:/home/sree/conf_git#

For illustration purpose what we are going to do here is to use git to save the configuration files of Nginx proxy server.
The file needs to be in git directory for the git to track the changes .What we do here is to move the reverse-proxy.conf from /etc/nginx/sites-available/reverse-proxy.conf to /home/sree/conf_git/firstrepo and create a softlink in /etc/nginx/sites-available/reverse-proxy.conf so that we can find the file in the right configuration directory ,this serves two purpose.


root@web01:/etc/nginx/sites-available# ll
total 16
drwxr-xr-x 2 root root 4096 Feb 19 05:46 ./
drwxr-xr-x 6 root root 4096 Jan 15 09:19 ../
-rw-r--r-- 1 root root 2074 Apr 26 2016 default
-rw-r--r-- 1 root root 2074 Jan 15 05:51 default_bkp
lrwxrwxrwx 1 root root 48 Feb 19 05:45 reverse-proxy.conf -> /home/sree/conf_git/firstrepo/reverse-proxy.conf


Status check
1) Created Git repo
2) Clone git repo to local server
3) Created a soft link and moved file to git directory

Our config file is in

root@web01:/home/sree/conf_git/firstrepo# cat reverse-proxy.conf
http {
upstream backend {
server 192.168.1.20;
server 192.168.1.21;
server 192.0.0.1 backup;
}
server {
location / {
proxy_pass http://backend;
}
}
}

Now we can start playing with git

Will open reverse-proxy.conf and edit file.

root@web01:/home/sree/conf_git/firstrepo# cat reverse-proxy.conf
http {
upstream backend {
server 192.168.1.20;
server 192.168.1.21;
server 192.0.0.1 backup;
}
server {
location / {
proxy_pass http://backend;
}
}
}
##
i have added the last line here to test
 
[simterm]
root@web01:/home/sree/conf_git/firstrepo# git status
HEAD detached at 4866d61
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout --- …” to discard changes in working directory)
modified: reverse-proxy.conf
no changes added to commit (use “git add” and/or “git commit -a”)
[/simterm
Shows file is modified
next step is to add,commit and push to git public repo.
[simterm]
root@web01:/home/sree/conf_git/firstrepo# git add reverse-proxy.conf
root@web01:/home/sree/conf_git/firstrepo# git status
HEAD detached at 4866d61
Changes to be committed:
(use “git reset HEAD …” to unstage)
modified: reverse-proxy.conf

shows there are changes which needs to be commited to local git.

root@web01:/home/sree/conf_git/firstrepo# git commit -m “changed reverse-proxy.conf to test git”
[detached HEAD db3fffc] changed reverse-proxy.conf to test git
1 file changed, 1 insertion(+), 4 deletions(-)

Pushing changes to remote repo

root@web01:/home/sree/conf_git/firstrepo# git push origin master
Username for ‘https://github.com’: stackerboy
Password for ‘https://stackerboy@github.com’:
Counting objects: 3, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 327 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/stackerboy/firstrepo.git
4866d61..985f6be master -> master

Any changes can be pushed and pull back to the local repository.

Accidental deletion of configuration files or going back to last known good configuration

find the latest best commit id


root@web01:/home/sree/conf_git/firstrepo# rm reverse-proxy.conf
root@web01:/home/sree/conf_git/firstrepo# ll
total 28
drwxr-xr-x 3 root root 4096 Feb 19 09:54 ./
drwxr-xr-x 4 root root 4096 Feb 19 09:48 ../
-rw-r–r– 1 root root 32 Feb 19 09:48 1
drwxr-xr-x 8 root root 4096 Feb 19 09:50 .git/
-rw-r–r– 1 root root 32 Feb 19 09:48 README
-rw-r–r– 1 root root 48 Feb 19 09:48 README.md
-rw-r–r– 1 root root 220 Feb 19 09:48 site_avail_rev_git
lrwxrwxrwx 1 root root 45 Feb 19 09:48 site_avail_rev_git_symlink -> /etc/nginx/sites-available/reverse-proxy.conf


Deleted reverse-proxy.conf file

To get it back attach head to last know configuration.

root@web01:/home/sree/conf_git/firstrepo# git checkout — 985f6be1a1da2a4b9ef82a93fda98b92aba4ad79
error: pathspec ‘985f6be1a1da2a4b9ef82a93fda98b92aba4ad79’ did not match any file(s) known to git.
root@web01:/home/sree/conf_git/firstrepo# git checkout 985f6be1a1da2a4b9ef82a93fda98b92aba4ad79
D reverse-proxy.conf
Note: checking out ‘985f6be1a1da2a4b9ef82a93fda98b92aba4ad79’.

 

You are in ‘detached HEAD’ state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at 985f6be… changes reverse-proxy.conf to test git
root@web01:/home/sree/conf_git/firstrepo# ll
total 28
drwxr-xr-x 3 root root 4096 Feb 19 09:54 ./
drwxr-xr-x 4 root root 4096 Feb 19 09:48 ../
-rw-r–r– 1 root root 32 Feb 19 09:48 1
drwxr-xr-x 8 root root 4096 Feb 19 09:56 .git/
-rw-r–r– 1 root root 32 Feb 19 09:48 README
-rw-r–r– 1 root root 48 Feb 19 09:48 README.md
-rw-r–r– 1 root root 220 Feb 19 09:48 site_avail_rev_git
lrwxrwxrwx 1 root root 45 Feb 19 09:48 site_avail_rev_git_symlink -> /etc/nginx/sites-available/reverse-proxy.conf

Checkout the file from the repo.


root@web01:/home/sree/conf_git/firstrepo# git checkout — reverse-proxy.conf
root@web01:/home/sree/conf_git/firstrepo# ll
total 32
drwxr-xr-x 3 root root 4096 Feb 19 09:58 ./
drwxr-xr-x 4 root root 4096 Feb 19 09:48 ../
-rw-r–r– 1 root root 32 Feb 19 09:48 1
drwxr-xr-x 8 root root 4096 Feb 19 09:58 .git/
-rw-r–r– 1 root root 32 Feb 19 09:48 README
-rw-r–r– 1 root root 48 Feb 19 09:48 README.md
-rw-r–r– 1 root root 258 Feb 19 09:58 reverse-proxy.conf
-rw-r–r– 1 root root 220 Feb 19 09:48 site_avail_rev_git
lrwxrwxrwx 1 root root 45 Feb 19 09:48 site_avail_rev_git_symlink -> /etc/nginx/sites-available/reverse-proxy.conf

Recovered the file .


root@web01:/home/sree/conf_git/firstrepo# cat reverse-proxy.conf
#http {
upstream backend {
server 192.168.1.20;
server 192.168.1.21;
# server 192.0.0.1 backup;
}
server {
location / {
proxy_pass http://backend;
}
}
#}
########### edit to test git ########