1.  
  2. 主页
  3.  / 
  4. ferry 教程文档
  5.  / 
  6. 手动部署

手动部署

需注意因使用到了json类型的字段,因此MySQL需是5.7以上的版本。

MySQL > 5.7

Go >= 1.14

Redis

node >= v12 (稳定版本)

npm >= v6.14.8

若是安装出错,请先确认redis及MySQL是否安装配置成功,若是还有问题,可在群内提问。

本地文件上传地址

# 默认上传图片
http://ipaddress:port/api/v1/public/uploadFile

# 上传文件配置
http://ipaddress:port/api/v1/public/uploadFile?file_type=files

# 注意
ipaddress 需要配置成你程序访问的地址,域名或者IP。
port 后端程序监听的端口。

Go编译超时

若出现Go语言编译超时,请先配置代理,推荐配置《使用goproxy》。

https://fdevops.com/2020/03/22/fix-go-get

配置文件介绍

script:
  path: ./static/scripts
settings:
  application:
    domain: localhost:8002
    host: 0.0.0.0
    ishttps: false
    mode: dev
    name: ferry-test
    port: "8002"
    readtimeout: 1
    writertimeout: 2
  database:
    dbtype: mysql
    host: 127.0.0.1
    name: ferry
    password: ferry@2020
    port: 3306
    username: ferry
  domain:
    gethost: 1
    url: localhost:9527
  email:
    alias: ferry
    host: smtp.163.com
    pass: your password
    port: 465
    user: fdevops@163.com
  gorm:
    logmode: 0
    maxidleconn: 0
    maxopenconn: 20000
  jwt:
    secret: ferry
    timeout: 86400
  ldap:
    anonymousquery: 0
    basedn: dc=fdevops,dc=com
    bindpwd: 123456
    binduserdn: admin
    host: localhost
    port: 389
    tls: 0
    userfield: uid
  log:
    compress: 1
    consolestdout: 1
    filestdout: 0
    level: debug
    localtime: 1
    maxage: 30
    maxbackups: 300
    maxsize: 10240
    path: ./logs/ferry.log
  redis:
    url: redis://ferry123456@127.0.0.1:6379
  ssl:
    key: keystring
    pem: temp/pem.pem

本地开发

后端程序启动:

# 1. 拉取代码,以下命令二选一即可:
git clone https://github.com/lanyulei/ferry.git
git clone https://gitee.com/yllan/ferry.git

# 2. 进入工作路径
cd ferry

# 3. 修改配置
vim config/settings.dev.yml
  1). 修改为自己的数据库信息
  2). 修改为自己的邮件服务器地址
其他的根据情况来修改调整

# 4. 安装依赖
go get

# 5. 连接数据库,并创建数据库
create database ferry charset 'utf8mb4';

# 6. 初始化数据结构
go run main.go init -c=config/settings.dev.yml

# 7. 测试启动程序,没有报错及没有问题
go run main.go server -c=config/settings.dev.yml

# 8. 热加载方式启动
air

前端程序启动:

# 1. 拉取代码,以下命令二选一即可:
git clone https://github.com/lanyulei/ferry_web.git
git clone https://gitee.com/yllan/ferry_web.git

# 2. 进入工作路径
cd ferry_web

# 3. 安装依赖
npm config set registry https://registry.npm.taobao.org
npm install
# 若npm install安装失败,可尝试使用一下命令安装
npm install --unsafe-perm

# 推荐使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install

# 4. 启动程序
npm run dev

# 5. 访问http://localhost:9527,是否可正常访问

部署线上

后端部署:

# 1. 拉取代码,以下命令二选一即可:
git clone https://github.com/lanyulei/ferry.git
git clone https://gitee.com/yllan/ferry.git

# 2. 进入工作路径
cd ferry

# 3. 交叉编译(centos)
env GOOS=linux GOARCH=amd64 go build
更多交叉编译内容,请访问 https://fdevops.com/2020/03/08/go-locale-configuration

# 4. config目录上传到项目根路径下,并确认配置信息是否正确
vim config/settings.yml
  1). 修改为自己的数据库信息
  2). 修改为自己的邮件服务器地址
其他的根据情况来修改调整

# 4. 创建日志路径及静态文件经历
mkdir -p log static/uploadfile static/scripts static/template

# 5. 将本地项目下static/template目录下的所有文件上传的到,服务器对应的项目目录下static/template

# 6. 连接数据库,并创建数据库
create database ferry charset 'utf8mb4';

# 7. 初始化数据
./ferry init -c=config/settings.yml

# 8. 启动程序,推荐通过"进程管理工具"进行启动维护
nohup ./ferry server -c=config/settings.yml > /dev/null 2>&1 &

前端部署:

# 1. 拉取代码,以下命令二选一即可:
git clone https://github.com/lanyulei/ferry_web.git
git clone https://gitee.com/yllan/ferry_web.git

# 2. 进入工作路径
cd ferry_web

# 3. 安装依赖
npm config set registry https://registry.npm.taobao.org
npm install
# 若npm install安装失败,可尝试使用一下命令安装
npm install --unsafe-perm

# 推荐使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install

# 4. 修改 .env.production 文件
# base api
VUE_APP_BASE_API = 'https://fdevops.com:8001'  # 修改为您自己的域名

# 5. 编译
npm run build:prod

# 6. nginx配置,根据业务自行调整即可

nginx配置演示:

server {
  listen 8001; # 监听端口
  server_name fdevops.com:8001; # 域名可以有多个,用空格隔开

  #charset koi8-r;

  #access_log  logs/host.access.log  main;
  location / {
    root /data/ferry/web;
    index index.html index.htm; #目录内的默认打开文件,如果没有匹配到index.html,则搜索index.htm,依次类推
  }

  #ssl配置省略
  location /api {
    # rewrite ^.+api/?(.*)$ /$1 break;
    proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址
    proxy_redirect off;
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  # 登陆
  location /login {
    proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址
    proxy_redirect off;
    proxy_ignore_client_abort on;
    proxy_max_temp_file_size 256m;
    proxy_connect_timeout      90;
    proxy_send_timeout         90;
    proxy_read_timeout         90;
    proxy_buffer_size          4k;
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    32k;
    proxy_temp_file_write_size 64k;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

  # 刷新token
  location /refresh_token {
    proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  # 接口地址
  location /swagger {
    proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  # 后端静态文件路径
  location /static/uploadfile {
    proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址
    proxy_set_header Host $host:$server_port;
  }

  #error_page  404              /404.html;    #对错误页面404.html 做了定向配置

  # redirect server error pages to the static page /50x.html
  #将服务器错误页面重定向到静态页面/50x.html
  #
  error_page 500 502 503 504 /50x.html;
  location = /50x.html {
    root html;
  }
}
这篇文章对您有用吗? 20 2

我们要如何帮助您?

回复 兰玉磊

您的电子邮箱地址不会被公开。 必填项已用*标注

评论列表(75条)

  • 可乐
    可乐 2020年9月7日 14:56

    我是一个小白,请问一下安装上的配置文件等能否详细具体一些,实在有点迷糊,感谢大佬

    • 兰玉磊
      兰玉磊 2020年9月7日 15:48

      @可乐配置文件已经仅可能的描述的非常清晰了哈,若是有问题,可以加群,一起讨论哈,群号就在github首页哈。

    • 付费了
      付费了 2021年7月14日 08:22

      @兰玉磊根本看不懂 能否再出一次小白完全教程

  • 蓝天
    蓝天 2020年10月29日 16:31

    您好,我是小白,请问如何在本地创建看一下前端操作一下呢?

  • gogo
    gogo 2020年11月4日 16:54

    做成docker 部署 就方便了

  • 多力葵花籽油
    多力葵花籽油 2020年11月6日 16:38

    这个部署是基于centos8操作系统的吧?我试着用centos7部署,部署到一半发现7上安装不了指定版本的npm

  • 零峰
    零峰 2020年11月10日 10:56

    大佬,我发现火狐浏览器对于流程管理里面拖节点不能支持,刚开始以为是个人安装的问题(反复重装了两天。。。),结果发现使用Demo访问也是一样的,拖节点时火狐浏览器变成另开了一个标签页,用google浏览器完全没问题,。。。。大佬有时间看一下这个问题

  • 老七
    老七 2020年11月18日 17:22

    我是一个小白, 本地的Windows 启动 ,按照上面的操作 还是不行啊

  • 春哥
    春哥 2020年11月25日 13:36

    {“level”:”error”,”ts”:”2020-11-25 12:58:18.631442″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: ERR Client sent AUTH, but no password is set”}
    WARNING: 2020/11/25 12:58:18 retry.go:20 Retrying in 1 seconds
    服务端运行报错

  • 胖子
    胖子 2020年11月26日 14:08

    [root@datasets ferry]# go run main.go init -c=config/settings.yml
    start init
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8cd342]

    goroutine 1 [running]:
    go.uber.org/zap.(*SugaredLogger).log(0x0, 0x5, 0x0, 0x0, 0xc0003cbca8, 0x1, 0x1, 0x0, 0x0, 0x0)
    /root/go/pkg/mod/go.uber.org/zap@v1.10.0/sugar.go:233 +0x62
    go.uber.org/zap.(*SugaredLogger).Fatal(…)
    /root/go/pkg/mod/go.uber.org/zap@v1.10.0/sugar.go:128
    ferry/pkg/logger.Fatal(…)
    /home/ferry/pkg/logger/logger.go:116
    ferry/tools/config.ConfigSetup(0x7ffc3feb86c6, 0x13)
    /home/ferry/tools/config/config.go:29 +0x4d3
    ferry/cmd/migrate.run()
    /home/ferry/cmd/migrate/server.go:36 +0xc6
    ferry/cmd/migrate.glob..func1(0x35d2b80, 0xc000d82270, 0x0, 0x1)
    /home/ferry/cmd/migrate/server.go:22 +0x25
    github.com/spf13/cobra.(*Command).execute(0x35d2b80, 0xc000d82260, 0x1, 0x1, 0x35d2b80, 0xc000d82260)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0x35d2640, 0x0, 0x0, 0x0)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375
    github.com/spf13/cobra.(*Command).Execute(…)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
    ferry/cmd.Execute()
    /home/ferry/cmd/cobra.go:39 +0x2d
    main.main()
    /home/ferry/main.go:8 +0x25
    exit status 2

    • 兰玉磊
      兰玉磊 2020年11月26日 14:24

      @胖子检查一下配置文件是否正常呢?

    • qlyang
      qlyang 2020年12月16日 00:22

      @兰玉磊-c在windows下可以尝试使用配置文件的全路径

    • 赤与赤赤
      赤与赤赤 2021年2月21日 00:04

      @qlyang# 6. 初始化数据结构
      go run main.go init -c=C:\Users\iama_\go\src\ferry\config\settings.dev.yml

      # 7. 测试启动程序,没有报错及没有问题
      go run main.go server -c=C:\Users\iama_\go\src\ferry\config\settings.dev.yml

    • 泪无痕
      泪无痕 2021年3月24日 17:16

      @胖子你好,这个问题你解决了吗?我也遇到同样的问题

    • hello golang
      hello golang 2021年4月23日 16:37

      @泪无痕windows下面路径于要用引号包起来go run main.go server -c=”C:\Users\iama_\go\src\ferry\config\settings.dev.yml”

    • 唐大大
      唐大大 2021年12月4日 17:02

      @泪无痕我了解了下,目前是因为air有bug,air配置文件里面 full_bin = “./tmp/main server -c=config/settings.dev.yml”
      这个命令行中的最后一个参数,会被自动解析添加上.exe后缀,会导致配置文件不存在然后就报这个错误了,已经去air git上面提交了issues,目前自己初步解决办法就是
      full_bin = “./tmp/main server -c=config/settings.dev.yml -p=8002” ,这样的话只是8002被解析成8002.exe,前面的配置文件路径不会出问题

  • 雄仔
    雄仔 2020年12月14日 16:50

    你好,我安装本地开发前端环境后,访问时登陆页面没有验证码希纳是,请问是什么原因呢?

    • 雄仔
      雄仔 2020年12月14日 16:51

      @雄仔没有验证码显示出来

    • 兰玉磊
      兰玉磊 2020年12月15日 10:22

      @雄仔没有连接上后端程序。

    • 兰玉磊
      兰玉磊 2020年12月15日 10:22

      @雄仔前端和后端没有交互,后端程序没有启动或者报错了吧。

    • Capricorn
      Capricorn 2023年11月29日 17:02

      @雄仔同一个问题,服务启动没有看到报错日志

  • sy
    sy 2020年12月15日 15:36

    楼主!我点击【新建工单】按钮,然后右上角有一个报错:参数不正确,请确定参数processld是否传递

    • tiger
      tiger 2022年12月8日 19:42

      @sy我也是,请问解决了吗?

  • 木木
    木木 2021年4月15日 09:20

    redis密码如果有特殊字符会有问题,比如$符合

  • Forward Technology
    Forward Technology 2021年5月8日 17:00

    能否出一篇 centos7下的部署文档,我整了半天整不明白

  • 乐可
    乐可 2021年5月18日 13:46

    你好 可以提供一下cmdb开源的地址吗

    • 兰玉磊
      兰玉磊 2021年5月18日 14:51

      @乐可统一搜索还有点小问题,暂未开放github地址。后续优化后会开放,敬请关注。

  • 大幅
    大幅 2021年5月27日 17:15

    手动部署 centos6 如何判断后端正常启动了?

  • JC
    JC 2021年6月21日 18:52

    邮箱服务在setting.yml设置后,工单申请的时候,还是不能发出邮件通知

    • 兰玉磊
      兰玉磊 2021年6月22日 09:58

      @JC百度一下,你所使用的邮件厂商,是否有安全限制。

    • JC
      JC 2021年6月23日 10:12

      @兰玉磊谢谢你,我试下,还需要在cent os7 上单独配置postfix吗?

    • JC
      JC 2021年6月23日 16:15

      @兰玉磊谢谢!在同事的帮助下,邮件问题解决了,邮件配置为:邮箱开启三方的授权码;很长的一串英文大写字母;再次衷心感谢开发者提供的程序;

    • zhaoxixc
      zhaoxixc 2021年10月14日 20:35

      @JC我在settings.yml里用的授权码,但是工单申请及处理过程都没邮件通知。。。好尴尬

  • jlzoe
    jlzoe 2021年6月25日 11:47

    能在WIN系统上搭建吗?

  • xiaochen
    xiaochen 2021年8月20日 15:57

    任务类型为啥没法改掉在哪里能够改?

    • 兰玉磊
      兰玉磊 2021年8月22日 20:00

      @xiaochen可以修改呢,不能修改的话,就是有问题,可加群详聊。

  • 十元
    十元 2021年9月29日 17:30

    您好,請問我在執行這段 go run main.go server -c=config/settings.dev.yml 的時候,跳出線面的錯誤訊息
    {“level”:”error”,”ts”:”2021-09-29 05:20:33.299656″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    請問是什麼原因呢?

    • 兰玉磊
      兰玉磊 2021年9月29日 17:41

      @十元Redis 连接的问题,缺人一下是否有密码,根据有无密码的情况,修改配置文件中的 redis 部分。

    • 十元
      十元 2021年10月1日 11:58

      @兰玉磊謝謝,解決了
      那想在请问一下,如果我架好後,想要修改配置文件config/settings.yml的话,流程是这样吗?
      1.kill ferry server
      2.vim config/settings.yml
      3.nohup ./ferry server -c=config/settings.yml > /dev/null 2>&1 &

    • 兰玉磊
      兰玉磊 2021年10月8日 15:16

      @十元是的。

  • 十元
    十元 2021年10月1日 11:45

    想请问一下,如果我想要去修改配置文件 config/settings.yml,流程是這樣嗎?
    1.kill ferry server
    2.vim config/settings.yml
    3.nohup ./ferry server -c=config/settings.yml > /dev/null 2>&1 &
    感谢大佬

  • la0jin
    la0jin 2021年11月9日 17:35

    跑着跑着就报错了。
    我创建的、与我相关、所有工单 都看不到了,报错:服务器连接异常,请检查服务器!
    {“level”:”info”,”ts”:”2021-11-09 17:34:13.716349″,”caller”:”middleware/permission.go:24″,”msg”:”admin/api/v1/work-order/listGET”}
    2021/11/09 17:34:13 http: panic serving 10.20.14.120:58155: interface conversion: interface {} is nil, not []interface {}
    goroutine 527 [running]:
    net/http.(*conn).serve.func1()
    D:/Program Files/Go/src/net/http/server.go:1801 +0xb9
    panic({0x198d200, 0xc002ded650})
    D:/Program Files/Go/src/runtime/panic.go:1047 +0x266
    ferry/middleware.CustomError.func1()
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/customerror.go:44 +0x47f
    panic({0x198d200, 0xc002ded650})
    D:/Program Files/Go/src/runtime/panic.go:1038 +0x215
    ferry/pkg/service.(*WorkOrder).WorkOrderList(0xc002f07488)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/pkg/service/workOrderList.go:198 +0xa38
    ferry/apis/process.WorkOrderList(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/apis/process/workOrder.go:96 +0x65
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.AuthCheckRole.func1(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/permission.go:28 +0x523
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/pkg/jwtauth.(*GinJWTMiddleware).middlewareImpl(0xc000568000, 0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/pkg/jwtauth/jwtauth.go:406 +0x338
    ferry/router/process.RegisterWorkOrderRouter.func1(0x1a46200)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/pkg/jwtauth/jwtauth.go:369 +0x25
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.RequestId.func1(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/requestid.go:24 +0x185
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.Options(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/header.go:23 +0x11a
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.NoCache(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/header.go:15 +0x102
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.CustomError(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/customerror.go:48 +0x6b
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    ferry/middleware.LoggerToFile.func1(0xc002a09c00)
    D:/Program Files/mobaxterm/root/slash/opt/ferry/middleware/logger.go:18 +0x71
    github.com/gin-gonic/gin.(*Context).Next(…)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/context.go:165
    github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000604b60, 0xc002a09c00)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/gin.go:489 +0x63e
    github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000604b60, {0x1e23160, 0xc000644700}, 0xc002deb600)
    D:/Program Files/Go/bin/pkg/mod/github.com/gin-gonic/gin@v1.7.0/gin.go:445 +0x1c5
    net/http.serverHandler.ServeHTTP({0xc002decf60}, {0x1e23160, 0xc000644700}, 0xc002deb600)
    D:/Program Files/Go/src/net/http/server.go:2878 +0x43b
    net/http.(*conn).serve(0xc002fbf4a0, {0x1e2dfd8, 0xc0008242d0})
    D:/Program Files/Go/src/net/http/server.go:1929 +0xb08
    created by net/http.(*Server).Serve
    D:/Program Files/Go/src/net/http/server.go:3033 +0x4e8

  • kk
    kk 2021年11月10日 11:52

    麻烦问下,go语言小白,咋部署自己电脑上看看啊

    • 兰玉磊
      兰玉磊 2021年11月11日 01:14

      @kk重新调整了Docker部署方式。可根据使用Docker部署。

  • 忘记时间
    忘记时间 2021年11月12日 00:54

    运行go run main.go server -c=config/settings.dev.yml 命令后报错了”api/server.go:98″,”msg”:”listen: listen tcp 121.37.129.16:8002: bind: cannot assign requested address\n”}
    这个是什么问题?

  • 月夜逛大街
    月夜逛大街 2021年12月21日 20:34

    总算是装好跑起来了,不容易啊,一个个包慢慢装,不过发现一个问题,里面的流程什么图片都不显示,是哪有还有问题吗

    • 兰玉磊
      兰玉磊 2021年12月24日 00:14

      @月夜逛大街可加微信,截图给我看下。

    • 月夜逛大街
      月夜逛大街 2021年12月25日 19:02

      @兰玉磊找到问题原因了,file-loader版本太高了,我用4.2的版本就可以

    • 月夜逛大街
      月夜逛大街 2021年12月25日 19:05

      @兰玉磊找到原因了,是因为file-loader版本过高造成,整理了一下安装过程,发在这了https://blog.csdn.net/lseaside/article/details/122124195

  • 琉璃
    琉璃 2022年4月12日 17:10

    卡在74/81好长时间了

  • css
    css 2022年5月10日 15:45

    将本地项目下static/template目录下的所有文件上传的到,服务器对应的项目目录下static/template

    这个怎么做呢 我感觉 我的报错好像就是因为缺少这一步:
    [root@localhost ferry]# ./ferry init -c=config/settings.yml
    start init
    {“level”:”info”,”ts”:”2022-05-10 15:42:04.937188″,”caller”:”database/mysql.go:37″,”msg”:”mysql connect success!”}
    {“level”:”info”,”ts”:”2022-05-10 15:42:05.248643″,”caller”:”migrate/server.go:41″,”msg”:”数据库结构初始化成功!”}
    — 开始初始化数据
    {“level”:”fatal”,”ts”:”2022-05-10 15:42:05.563970″,”caller”:”migrate/server.go:44″,”msg”:”数据库基础数据初始化失败,Error 1062: “}
    [root@localhost ferry]#

  • 泥人张
    泥人张 2022年5月11日 14:47

    go: inconsistent vendoring in /Users/van/workspace/ferry:
    github.com/RichardKnop/machinery@v1.8.8: is explicitly required in go.mod, but not marked as expl

    github.com/RichardKnop/logging@v0.0.0-20190827224416-1a693bdd4fae: is marked as explicit in vendo

    github.com/RichardKnop/machinery@v1.4.5: is marked as explicit in vendor/modules.txt, but not exp

    github.com/RichardKnop/redsync@v1.2.0: is marked as explicit in vendor/modules.txt, but not expli

    github.com/aws/aws-sdk-go@v1.32.12: is marked as explicit in vendor/modules.txt, but not explicit

    github.com/bradfitz/gomemcache@v0.0.0-20190913173617-a41fca850d0b: is marked as explicit in vendo

    github.com/gomodule/redigo@v1.8.8: is marked as explicit in vendor/modules.txt, but not explicitl

    github.com/kelseyhightower/envconfig@v1.4.0: is marked as explicit in vendor/modules.txt, but not

    github.com/opentracing/opentracing-go@v1.1.0: is marked as explicit in vendor/modules.txt, but no

    github.com/streadway/amqp@v1.0.0: is marked as explicit in vendor/modules.txt, but not explicitly

    golang.org/x/net@v0.0.0-20200625001655-4c5254603344: is marked as explicit in vendor/modules.txt,

    golang.org/x/sys@v0.0.0-20200625212154-ddb9806d33ae: is marked as explicit in vendor/modules.txt,

    golang.org/x/tools@v0.0.0-20200630154851-b2d8b0336632: is marked as explicit in vendor/modules.tx

    gopkg.in/mgo.v2@v2.0.0-20190816093944-a6b53ec6cb22: is marked as explicit in vendor/modules.txt,

    gopkg.in/yaml.v2@v2.3.0: is marked as explicit in vendor/modules.txt, but not explicitly required

    To ignore the vendor directory, use -mod=readonly or -mod=mod.
    To sync the vendor directory, run:
    go mod vendor

  • 紫冰
    紫冰 2022年5月19日 14:25

    为啥我在部署的时候,提示主键重复了,我该怎么办,求指点。
    — 开始初始化数据
    {“level”:”fatal”,”ts”:”2022-05-19 08:55:06.402571″,”caller”:”migrate/server.go:44″,”msg”:”数据库基础数据初始化失败,Error 1062: Duplicate entry ‘1’ for key ‘PRIMARY'”}

  • 冰凉的槟榔
    冰凉的槟榔 2022年6月13日 14:12

    踩了好多坑,提醒后来人。
    win10系统,后端启动:
    第6步.go run main.go init -c=./config/settings.dev.yml
    第7步.go run main.go server -c=./config/settings.dev.yml,
    第8步.air 启动的时候要修改.air.conf
    cmd = “go build -o ./tmp/main.exe .”
    bin = “tmp/main.exe”
    full_bin = “./tmp/main.exe server -c=./config/settings.dev.yml ” #这里yml的屁股后面多加一个空格
    才能正常跑
    前端启动,node 16:
    跑完npm install后还是启不来,提示 Node Sass version 7.0.1 is incompatible with ^4.0.0.
    node-sass版本太高了,卸载掉:npm uninstall node-sass 和npm uninstall sass-loader
    然后各安装6版本npm install node-sass@6和npm install sass-loader@6
    搞定收工,睡午觉笑哭

  • Sakaneko117
    Sakaneko117 2022年6月23日 23:15

    老师您好,我这数据库初始化老是显示
    {“level”:”info”,”ts”:”2022-06-23 23:17:24.115569″,”caller”:”database/mysql.go:37″,”msg”:”mysql connect success!”}
    {“level”:”info”,”ts”:”2022-06-23 23:17:25.929871″,”caller”:”migrate/server.go:41″,”msg”:”数据库结构初始化成功!”}
    — 开始初始化数据
    {“level”:”fatal”,”ts”:”2022-06-23 23:17:35.325841″,”caller”:”migrate/server.go:44″,”msg”:”数据库基础数据初始化失败,Error 1146: Table ‘ferry.sys_settings’ doesn’t exist”}
    请问是否新版本数据库结构有改变?

    • 兰玉磊
      兰玉磊 2022年6月24日 15:47

      @Sakaneko117没有变化呢。

    • Sakaneko117
      Sakaneko117 2022年6月24日 22:51

      @兰玉磊谢谢作者回复,我昨天发现这一条数据没初始化成功好像也没太大影响,也能跑

  • 爱王妃阿尔法二
    爱王妃阿尔法二 2022年7月13日 21:29

    debug模式运行正常,正常模式跑不起来

  • 中沃
    中沃 2022年8月8日 10:54

    这个Ferry工单系统有APP么