open-falcon-archive / fe Goto Github PK
View Code? Open in Web Editor NEWGo版本的UIC
Go版本的UIC
根據 http://book.open-falcon.com/zh/install/prepare.html 操作,
使用 http://7xiumq.com1.z0.glb.clouddn.com/open-falcon-binary-0.0.4.tar.gz 部署,
無法設置 fe 的 root 帳號的密碼為 abc,也無法註冊普通用戶。
[ORM] - 2015-08-05 04:04:11 - [Queries/default] - [FAIL / db.Exec / 2.6ms] - [INSERT INTO user
(name
, cnname
, passwd
, email
, phone
, im
, qq
, role
, created
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)] - root
, ,
df5ec8cce00f2fe6d09a9807421f1eb7,
, ,
, ``,2
,`` - Error 1048: Column 'created' cannot be null
Docker 版本 https://github.com/frostynova/open-falcon-docker 可以成功註冊帳號。
我在前台需要访问一个参数,我加在了cfg.json文件的shortcut下,对应我修改了cfg.go。但是我前台访问时候,还是报错,不能读取这变量。
请问我还需要修改哪里?多谢
通过fe统一界面上的“平台登录”后,再退出,点击“监控portal”不需要密码,进去后,显示的是之前在“平台登录”的用户账号。
UIC的英文缩写是什么呢?看了些相关资料,但不是很了解这是一个什么概念
User Identity Center ?
引用官网gitbook上 --“我们把用户的联系信息维护在一个叫UIC(新用户推荐使用Go版本的UIC,即:falcon-fe项目)的系统里,以后如果要修改手机号、邮箱,只要在UIC中修改一次即可。报警接收人也不是单个的人,而是一个组(UIC中称为Team),比如falcon这个系统的任何组件出问题了,都应该发报警给falcon的运维和开发人员,发给falcon这个团队,这样一来,新员工入职只要加入falcon这个Team即可;员工离职,只要从falcon这个Team删掉即可。
浏览器访问UIC,如果启用了LDAP,那就用LDAP账号登陆,如果没有启用,那就注册一个或者找管理员帮忙开通。创建一个Team,名称姑且叫falcon,把自己加进去,待会用来做测试”
这段代码中:
...
"cache": {
"enabled": true,
"redis": "127.0.0.1:6379", # 这个redis跟judge、alarm用的redis不同,这个只是作为缓存来用
"idle": 10,
"max": 1000,
"timeout": {
"conn": 10000,
"read": 5000,
"write": 5000
}
}
...
用于redis启动的配置redis.conf中配置了requirepass(访问redis的密码),上述代码如何传参?
RT.
错误日志如下:
2015/06/26 12:54:58 read config file: cfg.json successfully
2015/06/26 12:54:59 [app.go:103] [I] http server Running on 0.0.0.0:10003
2015/06/26 12:55:09 [router.go:871] [C] the request url is /auth/login
2015/06/26 12:55:09 [router.go:872] [C] Handler crashed with error runtime error: invalid memory address or nil pointer dereference
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/asm_amd64.s:401
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/panic.go:387
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/panic.go:42
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/sigpanic_unix.go:26
2015/06/26 12:55:09 [router.go:878] [C] /home/laiwei/gopath-open-falcon/src/github.com/toolkits/cache/cache.go:126
2015/06/26 12:55:09 [router.go:878] [C] /home/laiwei/gopath-open-falcon/src/github.com/open-falcon/fe/model/uic/user.go:71
2015/06/26 12:55:09 [router.go:878] [C] /home/laiwei/gopath-open-falcon/src/github.com/open-falcon/fe/model/uic/user.go:82
2015/06/26 12:55:09 [router.go:878] [C] /home/laiwei/gopath-open-falcon/src/github.com/open-falcon/fe/http/uic/auth_controller.go:98
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/asm_amd64.s:401
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/reflect/value.go:419
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/reflect/value.go:296
2015/06/26 12:55:09 [router.go:878] [C] /home/laiwei/gopath-open-falcon/src/github.com/astaxie/beego/router.go:794
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/net/http/server.go:1703
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/net/http/server.go:1204
2015/06/26 12:55:09 [router.go:878] [C] /usr/local/go/src/runtime/asm_amd64.s:2232
如果main.go代码里引入 pprof,会有冲突
import (
_ "net/http/pprof"
"github.com/open-falcon/fe/http"
)
func main() {
...
model.InitDatabase()
cache.InitCache()
go func() {
log.Println(http.ListenAndServe("localhost:6060", nil))
}()
http.Start()
}
编译
[root@fe]# ./control build
# _/opt/open-falcon/fe
./main.go:37: undefined: "github.com/open-falcon/fe/http".ListenAndServe
fe日志
登录
[ORM] - 2016-04-01 17:21:19 - [Queries/default] - [ OK / db.Query / 1.7ms] - [select id from user where name = ?] - `root`
[ORM] - 2016-04-01 17:21:29 - [Queries/default] - [ OK / db.QueryRow / 1.8ms] - [SELECT `id`, `name`, `cnname`, `passwd`, `email`, `phone`, `im`, `qq`, `role`, `created` FROM `user` WHERE `id` = ?] - `1`
[ORM] - 2016-04-01 17:21:29 - [Queries/default] - [ OK / db.Exec / 194.3ms] - [INSERT INTO `session` (`uid`, `sig`, `expired`) VALUES (?, ?, ?)] - `1`, `1d97167cf7eb11e58cfffa163e728d19`, `1462094489`
2016/04/01 17:21:29 [router.go:828][D] | POST | /auth/login | 20.20048836s | match | /auth/login
退出登录
[ORM] - 2016-04-01 17:23:33 - [Queries/default] - [ OK / db.QueryRow / 1.9ms] - [SELECT `id`, `uid`, `sig`, `expired` FROM `session` WHERE `sig` = ?] - `1d97167cf7eb11e58cfffa163e728d19`
[ORM] - 2016-04-01 17:23:43 - [Queries/default] - [ OK / db.QueryRow / 1.7ms] - [SELECT `id`, `name`, `cnname`, `passwd`, `email`, `phone`, `im`, `qq`, `role`, `created` FROM `user` WHERE `id` = ?] - `1`
[ORM] - 2016-04-01 17:23:43 - [Queries/default] - [ OK / db.Query / 0.8ms] - [SELECT T0.`id`, T0.`sig` FROM `session` T0 WHERE T0.`uid` = ? LIMIT 1000] - `1`
[ORM] - 2016-04-01 17:23:43 - [Queries/default] - [ OK / db.Exec / 201.9ms] - [DELETE FROM `session` WHERE `id` = ?] - `1`
2016/04/01 17:23:53 [router.go:828][D] | GET | /me/logout | 30.208005618s | match | /me/logout |
db.Exec
每次都在200 ms 左右,而 完成整个登录 需要20s 这是为什么
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.