Skip to content

fanyeren/golang_notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hashicorp: datacentre
    https://github.com/hashicorp
    Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.
    consul & serf

The key features of Terraform are:

Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used.

Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure.

Resource Graph: Terraform builds a graph of all your resources, and parallelizes the creation and modification of any non-dependent resources. Because of this, Terraform builds infrastructure as efficiently as possible, and operators get insight into dependencies in their infrastructure.

Change Automation: Complex changesets can be applied to your infrastructure with minimal human interaction. With the previously mentioned execution plan and resource graph, you know exactly what Terraform will change and in what order, avoiding many possible human errors.

HasshiCorp把旗下的几个开源产品整合为一个商业产品Atlas,感觉一个好的PaaS就应该具有这些组件。唯一需要改进的是在Deployment阶段,采用Mesos这种声明式的部署方式,可能比Terraform这种命令式部署更有前途。http://t.cn/Rz3Df29



myssh是个简单的程序远程执行命令的程序,小公司可以把所有的密码存在这个文件里,再打成二进制包,分发给OP和RD
大一点的企业都有跳板机,可以把跳板机的密码记录在里面

cd myssh && go build myssh.go && ./myssh -host=192.168.12.48 --user=work -run="cat /etc/passwd"

myssh.go.erb内含ERB模板,查询数据库将用户名密码导出,并生成go map,这样可以建立一个定时任务,定时导出,并打包成二进制程序分发给RD和OP

通常情况,设置跳板机每日更改root密码,并更新myssh,打包新的二进制包分发到开发机上

也可以调用此程序,批量修改线上root和work密码,再重新打包此程序
    两套密码:新的和旧的,这样如果因为网络问题,执行失败,可以重新执行
            先尝试新密码,有问题再回退到旧密码
        对于死机的机器,不更新旧密码

Scala过于复杂,又一个C++
Golang
  1) 静态编译,易于分发,同时开发效率又非常高
  2)GC可能对某些业务是个大问题,但是在我的工作范围里,暂时还是不许要考虑的

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published