Commit 0f3776a9 by 孙龙

init

parent ee06b3f0
......@@ -5,7 +5,7 @@ import (
"net"
"time"
"strconv"
"github.com/owenliang/crontab/common"
"go-crontab/common"
"encoding/json"
)
......
......@@ -3,7 +3,7 @@ package master
import (
"github.com/coreos/etcd/clientv3"
"time"
"github.com/owenliang/crontab/common"
"go-crontab/common"
"encoding/json"
"context"
"github.com/coreos/etcd/mvcc/mvccpb"
......
package master
import (
"github.com/mongodb/mongo-go-driver/mongo"
"go.mongodb.org/mongo-driver/mongo"
"context"
"github.com/mongodb/mongo-go-driver/mongo/clientopt"
"time"
"github.com/owenliang/crontab/common"
"github.com/mongodb/mongo-go-driver/mongo/findopt"
"go.mongodb.org/mongo-driver/mongo/options"
"go-crontab/common"
)
// mongodb日志管理
......@@ -25,10 +23,10 @@ func InitLogMgr() (err error) {
)
// 建立mongodb连接
// 建立mongodb连接
clientOptions := options.Client().ApplyURI("mongodb://ichunt:huntmon6699@192.168.1.237:27017/ichunt?authMechanism=SCRAM-SHA-1")
if client, err = mongo.Connect(
context.TODO(),
G_config.MongodbUri,
clientopt.ConnectTimeout(time.Duration(G_config.MongodbConnectTimeout) * time.Millisecond)); err != nil {
context.TODO(),clientOptions); err != nil {
return
}
......
......@@ -4,7 +4,7 @@ import (
"github.com/coreos/etcd/clientv3"
"time"
"context"
"github.com/owenliang/crontab/common"
"go-crontab/common"
"github.com/coreos/etcd/mvcc/mvccpb"
)
......
......@@ -2,7 +2,7 @@ package main
import (
"runtime"
"github.com/owenliang/crontab/master"
"go-crontab/master"
"fmt"
"flag"
"time"
......
......@@ -9,7 +9,7 @@
"apiWriteTimeout": 5000,
"etcd的集群列表": "配置多个, 避免单点故障",
"etcdEndpoints": ["36.111.184.221:2379"],
"etcdEndpoints": ["192.168.2.232:2379"],
"etcd的连接超时": "单位毫秒",
"etcdDialTimeout": 5000,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment