Posts
All the articles I've posted.
zookeeper c client封装
Published: at 07:20 AM我们只实现两个需求 master选举,当master切换后需要收到通知 注册服务信息 注册到zookeeper上的目录结构如下: /myproject 项目顶层节点 /myproject/master 临时节点,用来实现master选举 /myproject/nodes node父节点 /...
zookeeper单机集群部署
Published: at 06:42 AM什么是Apache ZooKeeper Apache ZooKeeper是由集群(节点组)使用的一种服务,用于在自身之间协调,并通过稳健的同步技术维护共享数据。ZooKeeper本身是一个分布式应用程序,为写入分布式应用程序提供服务。 ZooKeeper提供的常见服务如下 命名服务 - 按名称标识集群中...
go showapi.com接口
Published: at 02:59 PMshowapi.com提供了很多有意思的api,现在用go语言简单的封装下就可以用了。url的组装规则见文档(https//www.showapi.com/helpcenter/go/sign) 目前提供了三个接口 获取组装后的url http请求返回字符串 http请求返回json 源码如下: package showapi ...
go http get post json
Published: at 04:01 PMget和post请求使用比较频繁,这里只考虑json格式,做一下简单封装。 get请求 func HttpGetJson(url string, resp interface{}) error { result, err = http.Get(url) if err == nil { defer result.Body.Close() return json.NewDecoder(result.Body).De...
corosync + pacemaker高可用部署
Published: at 10:29 AMcorosync简介 Corosync是OpenAIS发展到Wilson版本后衍生出来的开放性集群引擎工程,corosync最初只是用来演示OpenAIS集群框架接口规范的一个应用,可以说corosync是OpenAIS的一部分,但后面的发展明显超越了官方最初的设想,越来越多的厂商尝试使用corosync作为集群解决方...
linux 解压缩(.tar .tar.gz .gz .rar .zip)
Published: at 01:05 AMlinux下常用解压缩命令 tar -c 建立压缩档案 -x:解压 -t:查看内容 -r:向压缩归档文件末尾追加文件 -u:更新原压缩包中的文件 这五个是独立的命令,压缩解压都要用到其中一个,可以和别的命令连用但只能用其中一个。下面的参数是根据需要在压缩或解压档案时可...
go 第三方github登录
Published: at 03:41 PM给本网站加了一个第三方github登录的功能 在github上新建oauth app 登录github,在用户菜单中选择Settings->Deleloper settings->OAuth Apps->New OAuth App 记住Client ID,Client Secret,Authorization callback URL 点击github登录 html标签 <a href="...
vi、vim键盘图
Published: at 09:53 AM如果图片没有显示请右键菜单选择“复制图片链接”粘贴在浏览器地址栏查看!!! 简体中文版(https//img-blog.csdn.net/20160907133419436?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center...
超实用的 Nginx 极简教程,覆盖了常用场景
Published: at 06:06 AM超实用的 Nginx 极简教程,覆盖了常用场景 概述 -- 什么是 Nginx? Nginx (engine x) 是一款轻量级的 Web 服务器 、反向代理服务器及电子邮件(IMAP/POP3)代理服务器。 (https//pic1.zhimg.com/v2-146ae6441ed292ca107c641a60ceaf24b.jpg) (...
git常用命令
Published: at 05:58 AM分支操作 一、如何把本地新建分支同步到远程分支上(注:该分支在远程上没有)? 二、又如何在本地把远程分支上新建分支同步到本地(本地没有该分支)? 1.其实在从远程分支分出来的分支都是跟踪分支(track),当对该分支进行push和pull时,如果该分支和远程分支同名git会知...