Modern CI/CD system on GCP – P1

The main content of the post includes

  • Basic CI/CD workflow
  • CI/CD System architecture
  • Practice on GCP

Step 1: Prepare a basic CI/CD workflow

My basic workflow

I have 2 zones, zone for developer zone and zone for dev/staging/production zone.

  • In developer zone : any commit from developer will active CI system to run test case and report to notification center (Slack, telegram, email)
  • In dev/staging/production zone : Any merge request to dev/staging/production environment will be active CI system. Pull code -> application packaging (docker, maven, npm) -> tag packaging -> push to container registry (Nexus, Harbor, Container registry) -> deploy to Kubernetes cluster -> rollback to the recent version if have system error.

Step 2 : CI/CD system architect

Source repository : Bitbucket, Github enterprise

Container registry : Google container registry

CI tool : Google cloudBuild

CD tool : Spinnaker

Kubernetes : Google kubernetes engine

Messaging : Google cloud pub/sub

Storage : Google cloud storage

Cloud load balancing : Load balancer IP

The next post will write more details on how to implement it, thanks you.

Architecture data warehouse at Zitga

Hi everyone, I came back before a long time, recently i received a request build a new dataware-house system at Zitga(game-studio). Several criteria that the system needs to meet :

– Crawling data from multiple resource (bigquery, appsflyer, ironsrc, appstore, playstore, server-to-server ….).
– The system will replace the current google bigquery is usage.
– The size of system about 5TB -> 40TB.
– Build tool to support datSa analysts (query, build machine learning, dashboard).
– Data collection history.
– Open ready for integration with others system.

Zitga dataware house architecture

zitga

HDFS : distributed system storage, data on multiple nodes.
Hive : reading, writing, and managing large datasets residing in distributed storage using SQL.
Spark : Spark-SQL and SparkML to build machine learning model over Hive tables.
Hue : Open source SQL assitant for databases and data warehouses.
Tableau : BI system, analytics platform.
Crawl manager : Management, scheduling data collection from multiple resources.

Sizing of cluster

Screen Shot 2020-02-19 at 4.12.24 PM

********************************

Design resource : https://drive.google.com/file/d/1JCgx1AT6podIU3Ra5cZGkDdDwNs8a1je/view?fbclid=IwAR1ZeyiaSzn-FCZJpJDcOj11bxcDsRN2296mT0tc8gnQM2EN-CRZyPKiMVs

Use HaProxy for load balancing multiple endpoints Socket.IO

Recently, i’m very busy because i have some projects and problems need to resolve, one of my problems is how to improve availability of system ?. I began to find solutions for this problem and i focus on “Load balancing” for system with HaProxy, Redis with Socket.IO to build load balancer system. As you know HaProxy is very fast and reliable solution offering high availabilityload balancing, and proxying for TCP and HTTP-based applications. Some test cases about performance of HaProxy, it so great and it can achieve more 2 million concurrent connections (base on TCP connection). HaProxy appears in many big systems as game-online or banking system that supports load balancing for millions of users and real-time connections. Today i will guide how to install, setup and deploy HaProxy to “load balancing” for multiple nodes run as “server socket.io”. Here i will make a small demo with nodejs-server and socket.io-client.

I will test follow the below model

architech-testI have four servers with

Test1 : 4 core, 16GB Ram
Test2 : 4 core, 16GB Ram
Test3 : 6 core, 32GB Ram
Test4 : 4 core, 16 GB Ram

Ok, let go to build simple example to test HaProxy

Step 1 : Install HaProxy on Test4 server

* yum install haproxy

Step 2 : Open configuration file “/etc/haproxy/haproxy.cfg” and add the below content

frontend http-in
   bind *:9199
   default_backend socketio-nodes
   stats enable
   stats uri /?stats
   stats auth admin:admin

backend socketio-nodes
   option forwardfor
   option http-server-close
   option forceclose
   no option httpclose

   balance url_param session_id check_post 64
   cookie SID insert indirect nocache
   server node1 test1.azstack.com:9100 weight 1 maxconn 1024 check cookie node1
   server node2 test2.azstack.com:9100 weight 1 maxconn 2048 check cookie node2
   server node3 test3.azstack.com:9100 weight 2 maxconn 4096 check cookie node3

You need to note a few configuration:

balance url_param session_id check_post 64 is selection criteria for load distribution.
weight 1 : weight of very nodes.
maxconn 1024 : max concurrent connect on the node.

Step 3 : Start HaProxy 

* /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg 

Endpoint of HaProxy : test4.azstack.com:9199

Step 4 : Create simple socket.io server and listen on port 9100 

https://github.com/kimxuyenthien/socketio-demo/blob/master/server

duplicate socket.io server instance for the other two nodes and run it

start_socketio_server

* node socketio-server.js 

Step 5 : Create simple websocket client to connect. 

https://github.com/kimxuyenthien/socketio-demo/tree/master/client

Step 6 : Try to connect to HaProxy (Invite your friends join to test)

HaProxy endpoint (test4.azstack.com:9199)

client-connect

Step 7 : Check log on socket.io server

my connection

have_new_connection_node2

and more connection from my friend

have_new_connection_note3have_new_connection_node1

Ok, you can see ip client allway is 128.199.123.119, that great because all packet is forwarded by HaProxy.

Some advance topics for you

  • How to setup SSL for HaProxy.
  • How to use Redis to run cluster socket.io server.

Maybe i can write above problem, thank for reading. Have a nice day.

Create customize map with data OpenStreetMap

Recently my company is developing smart parking application and is very important path is map. Google map is great system with a lots of function but when use for particular application, there are quite a few limitations as

  • Ability to customize low
  • Slow update if you want to add new data
  • Access restriction and charge requests
  • Not self-control

So many companies choose to build their own system with high customization and fully independent. I began to learn how to build map system and search for answer for a few questions

  •  What is OpenStressMap ?
  • How to load a small area map data ?
  • What database management for saving map data ?
  • How to import map ?
  • How to render map ?
  • How to preview map on web platform ?

Find out related issues, i obtained the following result

Openstressmap (OSM) : the map database open worldwide and you can download and use it.
PostgresSQL : database management be used to store map data for OpenStressMap .
PostGIS : extend of PostgresSQL to support query and search with geographic data.
Osm2pgsql : tool support import data to PostGIS-PostgresSQL from file .osm
Mapnik : open source C/C++ support geographic data modeling and render tiles
Apache HTTP : webserver open source to serve request map tiles
GEOS : C/C++ library support process geographic data
Carto : CSS map-styling

Ok Let’s get started on creating on your own map system

Step 1 : Check python current version and upgrade to 2.7.6 version

-) Download python source, compile and build

$ wget –no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
$ tar xf Python-2.7.6.tar.xz
$ cd Python-2.7.6
$ ./configure –prefix=/usr/local
$ make && make altinstall

-) Backup current pythond version

$ mv /usr/bin/python /usr/bin/python2.6.6

-) Apply the python new version to default system

$ ln -sf /usr/local/bin/python2.7 /usr/bin/python
$ head -1 /usr/bin/yum
$ sed -i -e ‘s|python|python2.6.6|’ /usr/bin/yum
$ head -1 /usr/bin/yum

Step 2 : Install development tools

$ yum update
$ yum groupinstall ‘Development Tools’
$ yum install libpng libtiff libjpeg freetype gdal cairo pycairo sqlite geos boost curl libcurl libicu bzip2-devel libpng-devel libtiff-devel zlib-devel libjpeg-devel libxml2-devel python-setuptools proj-devel proj proj-epsg proj-nad freetype-devel libicu-devel gdal-devel sqlite-devel libcurl-devel cairo-devel pycairo-devel geos-devel protobuf-devel protobuf-c-devel lua-devel cmake proj boost-thread proj-devel autoconf automake libtool pkgconfig ragel gtk-doc glib2 glib2-devel libpng libpng-devel libwebp libtool-ltdl-devel python-devel harfbuzz harfbuzz-devel harfbuzz-icu boost-devel cabextract xorg-x11-font-utils fontconfig perl-DBD-Pg mesa-libGLU-devel postgresql-devel

Step 3 : Upgrade GCC version

$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
$ /opt/rh/devtoolset-2/root/usr/bin/gcc –version
$ scl enable devtoolset-2 bash
$ source /opt/rh/devtoolset-2/enable

Step 4 : Install PostgresSQL

$ wget https://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-3.noarch.rpm
$ rpm -ivh pgdg-centos94-9.4-3.noarch.rpm
$ yum install postgresql94-server postgis2_94
$ yum install postgresql94-contrib

Step 5 : Build Boot library

$ wget https://downloads.sourceforge.net/project/boost/boost/1.65.1/boost_1_65_1.tar.bz2
$ tar -xvf boost_1_65_1.tar.bz2
$ ./bootstrap.sh
$ ./b2
$ ./b2 install

Step 6 : Build and install Mapnik

$ git clone https://github.com/mapnik/mapnik.git
$ cd mapnik
$ git checkout v2.3.x

$ ./configure –prefix=/opt/mapnik
$ make
$ make install
$ sudo ldconfig

Step 7 : Build GEOS

$ wget http://download.osgeo.org/geos/geos-3.6.1.tar.bz2
$ tar -xvf geos-3.6.1.tar.bz2
$ ./configure && make && sudo make install

Step 8 : Build Osm2pgsql

$ sudo yum install cmake make gcc-c++ boost-devel expat-devel zlib-devel \
bzip2-devel postgresql-devel proj-devel proj-epsg lua-devel
$ git clone git://github.com/openstreetmap/osm2pgsql.git
$ cd osm2pgsql
$ mkdir build && cd build && cmake .. -DCMAKE_PREFIX_PATH=/usr/pgsql-9.4/
$ make && make install

Step 9 : Install Apache HTTP

$ yum install httpd
$ yum install httpd-devel

Step 10 : Install tile mod

$ git clone git://github.com/openstreetmap/mod_tile.git
$ cd mod_tile
$ ./autogen.sh
$ ./configure -with-apxs=/usr/sbin/apxs

$ cp -rf mapnik/include/mapnik/* /usr/include/mapnik
$ cp mapnik/include/mapnik/geometry/box2d.hpp /usr/include/mapnik
$ make
$ sudo make install
$ sudo make install-mod_tile
$ sudo ldconfig

Step 11 : Install Casto use node package manage

$ npm install -g carto

Step 12 : Config render tile mod

$ vi /usr/local/etc/renderd.conf

append the below content

[renderd]
;socketname=/var/run/renderd/renderd.sock
num_threads=4
tile_dir=/var/lib/mod_tile
stats_file=/var/run/renderd/renderd.stats

[mapnik]
plugins_dir=/usr/local/lib/mapnik/input
font_dir=/usr/local/lib/mapnik/fonts
font_dir_recurse=1

[default]
URI=/osm_tiles/
TILEDIR=/var/lib/mod_tile
XML=/root/openstreetmap-carto/mapnik.xml
HOST=map.azstack.com
TILESIZE=256

Step 13 : Config mod tile

$ vi /etc/httpd/conf.d/mod_tile.conf

LoadModule tile_module /etc/httpd/modules/mod_tile.so

ServerName map.azstack.com
ServerAlias map.azstack.com
DocumentRoot /var/www/html

ModTileTileDir /var/lib/mod_tile
LoadTileConfigFile /usr/local/etc/renderd.conf
ModTileEnableStats On
ModTileBulkMode Off
ModTileRequestTimeout 3
ModTileMissingRequestTimeout 10
ModTileMaxLoadOld 16
ModTileMaxLoadMissing 50
ModTileVeryOldThreshold 31536000000000
ModTileRenderdSocketName /var/run/renderd/renderd.sock
ModTileCacheDurationMax 604800
ModTileCacheDurationDirty 900
ModTileCacheDurationMinimum 10800
ModTileCacheDurationMediumZoom 13 86400
ModTileCacheDurationLowZoom 9 518400
ModTileCacheLastModifiedFactor 0.20
ModTileEnableTileThrottling Off
ModTileEnableTileThrottlingXForward 0
ModTileThrottlingTiles 10000 1
ModTileThrottlingRenders 128 0.2
LogLevel debug

Step 14 : Setup PostGiS

$ su -i postgres
$ createuser root
$ psql -d template1 -c “ALTER USER root WITH PASSWORD ‘password’;”
$ psql postgres
$ CREATE DATABASE gis;
$ psql gis
$ CREATE EXTENSION postgis;
$ CREATE EXTENSION postgis_topology;

Step 15 : Import data .osm (download from OpenStressMap)

$ osm2pgsql –slim -d gis_az -C 1600 –number-process 1 -S /usr/local/share/osm2pgsql/default.style map-hieu.osm

Step 16 : Install Casto

$ git clone git://github.com/gravitystorm/openstreetmap-carto.git
$ cd openstreetmap-carto
$ git checkout `git rev-list -n 1 –before=”2016-12-04 00:00″ master`

# Compile and download shape files
$ carto project.mml > mapnik.xml
$ scripts/get-shapefiles.py

Step 17 : Start Apache HTTP with render mode

$ systemctl start httpd
$ mkdir /var/run/renderd
$ mkdir /var/lib/mod_tile
$ renderd -f -c /usr/local/etc/renderd.conf &
$ render_list -m default -a -z 0 -Z 17 -s /var/run/renderd/renderd.sock

Map client to show map
https://github.com/kimxuyenthien/map_openstressmap.git

 

Zookeeper multiple-nodes cluster setup

In the previous post, i was overview about Zookeeper and explained how to it work (post). Zookeeper is core system, it provide an API to manage the status of application nodes in distributed environment,  Zookeeper is very important component so what happens when a server Zookeeper is died ? Maybe the whole system will stop working and this is serious. To resolve this problem then Zookeeper support it can be run as cluster go when leader node die all of the nodes will run “Algorithm election” and a new node will became leader. So Zookeeper cluster is high availability, and below i will present details how to setup Zookeeper on multiple-nodes.

Pre-requisites : you have some servers to setup, with me i have 4 server need to setup Zookeeper cluster

Node1 : 10.3.0.100
Node2 : 10.3.0.101
Node3 : 10.3.0.102
Node4 : 10.3.0.103

Step 1 : Add information servers to DNS hostname configuration

vi /etc/hosts

10.3.0.100 cloud1
10.3.0.101 cloud2
10.3.0.102 cloud3
10.3.0.103 cloud4

Step 2 : You need download Zookeeper stable version from page (Zookeeper homepage) and save into node1

wget http://mirror.downloadvn.com/apache/zookeeper/stable/zookeeper-3.4.10.tar.gz
tar -xvf zookeeper-3.4.10.tar.gz

Step 3 : Create path folder to store Zookeeper data (all nodes).

mkdir /data/hdfs/zookeeper

Step 4 : Setup memory use to run Zookeeper instance, create java.env to add the below configuration

vi $ZOOKEEPER_HOME/conf/java.env

Add this below content to file

export JAVA_OPTS="-Xms4096m -Xmx4096m"

(i was changed memory to run Zookeeper instance to 4GB)

Step 5 : Config zookeeper

cp zoo_sample.cfg zoo.cfg
vi zoo.cfg

add this below configuration to file

tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/hdfs/zookeeper
clientPort=2181
maxClientCnxns=2000
server.1=cloud1:2888:3888
server.2=cloud2:2888:3888
server.3=cloud3:2888:3888
server.4=cloud4:2888:3888

Explain some parameters is used

maxClientCnxns : max clients number connection to node.
clientPort : current node listen on port 2181
dataDir : path to store data.
3888 : port listen connect from other nodes in cluster.
2888 : port listen if that is leader node.

Step 6 : Copy zookeeper folder to all of them

rsync -avz zookeeper-3.4.10/ cloud2:/data/zookeeper-3.4.10/
rsync -avz zookeeper-3.4.10/ cloud3:/data/zookeeper-3.4.10/
rsync -avz zookeeper-3.4.10/ cloud4:/data/zookeeper-3.4.10/

Step 7 : Config ID of node to run cluster

on cloud1

echo "1" >> /data/hdfs/zookeeper/myid

on cloud2

echo "2" >> /data/hdfs/zookeeper/myid

on cloud3

echo "3" >> /data/hdfs/zookeeper/myid

on cloud4

echo "4" >> /data/hdfs/zookeeper/myid

Step 8 : Start all instance with command

./bin/zkServer.sh start

Run command jps to check

Done, If you have any question about setup Zookeeper cluster please contact me (facebook or linked) we can discuss about it. Thank for reading.

 

 

Zookeeper coordination service for distributed system :)

Zookeeper open source very powerful for distributed applications. It is used very popular in Hadoop ecosystem and the fist i knew it is when i build cloud message for AZStack-SDK, we use Hbase + Hadoop + Zookeeper  build cluster to store message and query over hundred GB data. Hadoop and Hbase are distributed application, with Hadoop  (multiple namenode, datanode) and Hbase (regionserver). Zookeeper is really excellent coordinator. After use Zoo for cloud message, i started to learn more about it so it really cool for me. In fact, the way information in zookeeper is organized is quite similar to a file system. At the top there is  a root simply referred to as /, below root are znodes.

zknamespace

Unlike an ordinary distributed file system. Zookeeper supports the concepts of ephemeral zNode and sequential zNode. An ephemeral zNode is a node that will disappear when the session of its owner ends. In distributed application every server cam be defined public ip in an ephemeral node, when server loose connectivity with Zookeeper and fail to reconnect within session timeout then all information about that server is deleted. The below figure is a illustration  how to use ephemeral node for manage distributed services

 

zookeeper_ephemeral

 

Sequential nodes are nodes whose names are automatically assigned a sequence number suffix. This suffix is auto increment and assigned by Zookeeper when the zNode is created. An easy way of doing leader election with Zookeeper is to let every server publish it information in a zNode that is both sequential and ephemeral. Then whichever server has the lowest sequential zNode is the leader. If the leader or any other server goes offline, its session dies and its ephemeral node is removed, and all other servers can observe who is the new leader.

How to Zookeeper cluster work with client ?

Zookeeper cluster have 2 types (Leader, Follower) system run load balance when client connect to cluster, every instance zookeeper can be served many clients. If client request read data to Follower instance then it response direct by local data, however when client request write data this request will be forwarded to leader and leader broadcast into all node  to update data on follower instance.

 

fig01

The main objective of the post is introduce the overview about Zookeeper. The next post i will give you instructions how to install, config and how to use Zookeeper in distributed application. Thank you for reading.

 

Kamailio add user and test with softphone (Linphone, Zoiper)

In the previous post, i guided how to build and config Kamailio with MySQL as database engine to work, if you have not read it yet then read at post. Today i will guide how to create user and demo basic VoIP system with softphone. Linphone and Zoiper are used to test, these are popular opensource softphone nowadays, support multiple platform (Desktop, Android and IOS).

Dowload Linphone : http://www.linphone.org
Download Zoiper : https://www.zoiper.com

According to the previous post, i have Kamailio is installed with path “/data/kamailio”. The first i need to create some account to register Kamailio server.

To add new user please remote to server and run command

/data/kamailio/sbin/kamctl add

example

/data/kamailio/sbin/kamctl add 01632796542 hieu1234
/data/kamailio/sbin/kamctl add 01643934930 abc123

After add users, you should check records in database. All users information are stored in table “kamalio.subcriber”. The image below is result

Selection_031

Start Kamailio server to test

/data/kamailio/sbin/kamctl start

The next step i install Linphone on my desktop and zoiper on my phone (Android). Register account 01632796542/hieu1234 by Linphone

Selection_033

Register 01643934930/abc123 on Zoiper and make call to account 01632796542

22833444_1299800916798771_308804700_o          22810395_1299801823465347_913952245_o

When make call to 01632796542, on my desktop get a notification “incoming call” as below

Selectio

 

Ok i introduced you how to build and setup a basic VoIP system, how to manage account and test call with softphone. Thank you and see you next time.

Build and config Kamailio 5.0.3 integrate MySQL database

I usually work with VoIP system and integrate it with SDK support communication platform.  Kamailio is very powerful asynchronous TCP, UDP and SCTP secure communication via TLS, support some advance features load balancing, routing fail-over, accouting, authentication and authorization. Kamailio is one of the best performance flatform VoIP, so i choose Kamailio to build VoIP system and integrate with our AZStack SDK.

Some main features is supported by Kamailio

  • Registrar server
  • Location server
  • Proxy server
  • SIP application server
  • Redirect server

Do not support by Kamailio

  • Sip phone.
  • Media server

I will have some chapters about Kamailio as build, config,  run and demo with SIP client (softphone). In the post, i focus guide step by step to build Kamailio from source and deploy over network. Ok let begin

Step 1 : You have to install mysql on server, you can reference how to install MySQl the latest version at post 

Step 2 : Install prerequisite tool

apt-get install flex gcc bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev libxml2-dev libpcre3-dev

Step 3 : Download and extract Kamailio the latest version

wget https://www.kamailio.org/pub/kamailio/latest/src/kamailio-5.0.3_src.tar.gz
tar -xvf kamailio-5.0.3_src.tar.gz

Step 4 : Build  source

mkdir /data/kamailio
make prefix=/data/kamailio/ include_modules="db_mysql dialplan" cfg
make all
make install

Step 5 : Setup database connection to MySQL

vi /data/kamailio/etc/kamctlrc

Edit some of configurations as follows

## your SIP domain
SIP_DOMAIN=docker.azstack.com

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
DBENGINE=MYSQL

## database host
DBHOST=localhost

## database host
DBPORT=3306

## database name (for ORACLE this is TNS name)
DBNAME=kamailio

# database path used by dbtext, db_berkeley or sqlite
# DB_PATH="/usr/local/etc/kamailio/dbtext"

## database read/write user
DBRWUSER="kamailio"

## password for database read/write user
DBRWPW="kamailiorw"

## database read only user
DBROUSER="kamailioro"

## password for database read only user
DBROPW="kamailioro"

Step 6 : Setup alias and port for run service

vi /data/kamailio/etc/kamailio/kamailio.cfg

edit content

alias="docker.azstack.com"
port=5060

Step 7 : Init setup database

/data/kamailio/sbin/kamdbctl create

Please enter your password to authentication MySQL server, Kamailio will auto create database to work. If you have some errors please check status MySQL database.

Step 8 : Start Kamailio and check result

/data/kamailio/sbin/kamctl start

start

check server be listening on port 5060

netstat -apn | grep 5060

listen

It ok! in the next post i will guide how to create user and use SIP-Phone connect Kamailio to Call and message. See you next time!

SIP – Session Initiation Protocol Overview

Session Initiation Protocol is an ASCII-base, application-layer control protocol that can be used to establish, maintain and terminate calls between two or more endpoints (Wiki..). Ok let go with simple things about SIP, it is protocol enable supported voice and multimedia calls over IP networks and you can communication between  hard-phone (GSM, CDMA)  and soft-phone or browser. You can make calls to phone from web, desktop applications or vice versa, support manage calls session provide recording, limit duration call bla bla. It is very effective for your business, customer care or support call-center.

webrtc2sip-click-to-call

Some information about SIP

SIP components : SIP is peer-to-peer protocol. The peers in a session are called user agents (UA). UA can function in one of the following roles

  • User-agent client (UAC) client application that initiates the SIP request.
  • User-egent server (UAS) server application that contacts the user when a SIP request is received and return a response on behalf of the user.

Selection_024

SIP clients : Sip client to send SIP request and receive SIP response

  • Softphones : Cisco SIP IP phones can initiate SIP request and response.
  • EPhones :  IP phones that are not configured on the gateway.
  • Gateways : Provide call control, it provider many services. The most common being a translation function between SIP endpoints.

SIP Servers

  • Proxy server : receives SIP request from a SIP client and forward them on the client’s behalf. Basically, proxy servers receive SIP messages and forward them to the next SIP server in the network. Proxy server can provide functions authentication, authorization, network access control, routing, reliable request retransmission and security.
  • Redirect server : Providers the client with information about the next hop or hops that a message should take and then the client contacts the next-hop server.
  • Registrar server : Processes requests from UAC for registration of the their current location.
  • Location server : a server which record and maintain contact information of it and every UA with in a typical enterprise.

location_server

Some products for VoIP system

Client : LinPhone, Zoiper, 3CX.
Open source server : Sems, Kamailio, Janus gateway, Freeswitch, Asterisk.
Service provider : Twillio, VHT.

Ok in the post, i will just guide to you overview information about SIP. In the next posts i will talk how to install an config some open source for product. Please read it.

********** Notice **********

Our product is AZStack SDK is provide functions for VoIP, if you have problems SIP trunk or you are looking for a solution for you business please contact me, we can discuss about it.

Setup and config Go environment on Ubuntu 16.04 and Centos 7

Recently somebody have some questions for me.

  • Why i can’t run go get ?
  • How to change workspace project with Go ?
  • Why after i exit session on terminal then all config is reset and go command not found ?

Ok, the following below i will detail, how i installed Go ? You can get more information about it at page https://golang.org/doc/install. 

Step 1 : Download the latest or the stable version Go. Currently i use Go version 1.9.1 for my project.
wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz

Step 2: Check Go is installed on system and clear it.
sudo rm -rf /usr/local/go

Step 3 : Extract compress file to folder “/usr/local”
sudo tar -C /usr/local -xzf go1.9.1.linux-amd64.tar.gz

Step 4 : Setup environment for user (the step is very important)
[Centos] Add the configuration to file “~/.bashrc”
[Ubuntu] Add the configuration to file “~/.profile”

export GOPATH=/usr/local/go/workspace
export GOROOT=/usr/local/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Apply all config environment with command

[Centos]
source ~/.bashrc

[Ubuntu]
source ~/.profile

******* Note *******
GOPATH : this is the directory where you want to save projects.
GOROOT : the directory of root Go (Step 3)
*******************

Step 5 : Verify installation
Check current version Go
go version

Selection_022

Show all information configuration of Go
go env
Selection_019

Done ! If you have a question for me please inbox facebook, linkedIn, we can discuss about it.
Good luck!