• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






张伯雨

学习使人快乐
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页

2017年8月31日

安装使用
摘要: 下载地址直接官网下载就好,非常简单。https://influxdata.com/downloads/#influxdb安装sudo dpkg -i influxdbName.deb 启动sudo service influxdb start 使用启动成功之后,我们就可以开始使用influxDB啦!命令行在命令行中直接输入influx,就可以管理数据库了。root@xtutu:~# influx ... 阅读全文
posted @ 2017-08-31 10:00 张伯雨 阅读(267) 评论(0) 推荐(0)
 
InfluxDB介绍
摘要: InfluxDB介绍InfluxDB用Go语言编写的一个开源分布式时序、事件和指标数据库,和传统是数据库相比有不少不同的地方。类似的数据库有Elasticsearch、Graphite等。特点提供了Http接口的API来操作数据提供了类似sql的数据库语句其它...用途一般用来储存实时数据,配合一套UI界面来展示信息。 阅读全文
posted @ 2017-08-31 09:56 张伯雨 阅读(262) 评论(0) 推荐(0)
 
proxy.go
摘要: package mainimport ( "net" "time")// 初始化代理服务func initProxy() { Log.Infof("Proxying %s -> %s\n", Config.Bind, Config.Backend) server, err := net.Listen("tcp", Config.Bind) if err != nil ... 阅读全文
posted @ 2017-08-31 09:54 张伯雨 阅读(987) 评论(0) 推荐(0)
 
balancer.go
摘要: package mainimport ( "math/rand" "net" "time" "stathat.com/c/consistent")// 代理服务的结构type BackendSvr struct { identify string //代理服务器地址 isLive bool // 服务是否存活 failTimes int //失败... 阅读全文
posted @ 2017-08-31 09:53 张伯雨 阅读(279) 评论(0) 推荐(0)
 
monitor.go
摘要: package mainimport ( "fmt" "net/http")// 查询监控信息的接口func statsHandler(w http.ResponseWriter, r *http.Request) { _str := "" for _, v := range BackendSvrs { _str += fmt.Sprintf("Server:... 阅读全文
posted @ 2017-08-31 09:53 张伯雨 阅读(176) 评论(0) 推荐(0)
 
log.go
摘要: package mainimport ( "os" "github.com/Sirupsen/logrus")// 初始化日志模块func initLogger() error { logFilePath := Config.Log.Path //日志文件存放位置 file, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_... 阅读全文
posted @ 2017-08-31 09:52 张伯雨 阅读(298) 评论(0) 推荐(0)
 
config.go
摘要: package mainimport ( "io/ioutil" "github.com/go-yaml/yaml")// 代理配置数据结构type ProxyConfig struct { Bind string `yaml:"bind"` //前置服务器地址 WaitQueueLen int `yaml:"wait_queue_len... 阅读全文
posted @ 2017-08-31 09:50 张伯雨 阅读(183) 评论(0) 推荐(0)
 
Golang 的内存管理(上篇)
摘要: Golang 的内存管理基于 tcmalloc,可以说起点挺高的。但是 Golang 在实现的时候还做了很多优化,我们下面通过源码来看一下 Golang 的内存管理实现。下面的源码分析基于 go1.8rc3。1.tcmalloc 介绍关于 tcmalloc 可以参考这篇文章 tcmalloc 介绍,原始论文可以参考 TCMalloc : Thread-Caching Malloc。2. Golan... 阅读全文
posted @ 2017-08-31 09:49 张伯雨 阅读(1159) 评论(0) 推荐(0)
 
main.go
摘要: package mainimport ( "flag" "fmt" "log" "os" "os/signal" "syscall" "github.com/Sirupsen/logrus")var ( Config ProxyConfig //配置文件解析后的结构体 Log *logrus.Logger c... 阅读全文
posted @ 2017-08-31 09:49 张伯雨 阅读(267) 评论(0) 推荐(0)
 
Go 1.9 sync.Map揭秘
摘要: Go 1.9 sync.Map揭秘目录 [−]有并发问题的mapGo 1.9之前的解决方案sync.MapLoadStoreDeleteRangesync.Map的性能其它在Go 1.6之前, 内置的map类型是部分goroutine安全的,并发的读没有问题,并发的写可能有问题。自go 1.6之后, 并发地读写map会报错,这在一些知名的开源库中都存在这个问题,所以go 1.9之前的解决方案是额外... 阅读全文
posted @ 2017-08-31 09:47 张伯雨 阅读(492) 评论(0) 推荐(0)
 
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 37 下一页