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

脚本部署

以下软件是需要自己部署安装的。根据不同的系统,百度一下方法即可,网上很多方法。

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

MySQL > 5.7

Go >= 1.14

Redis 新版即可

node >= v12 (稳定版本)

npm >= v6.14.8

拉取代码

git clone https://github.com/lanyulei/ferry.git
或者
git clone https://gitee.com/yllan/ferry.git

进入项目目录

cd ferry

执行部署脚本

./build.sh install

按照脚本提示的要求,进行输入。

需要注意的一点是,MySQL和Redis配置信息修改的时候,不要关闭 ./build.sh 的脚本程序,直接去修改脚本提供的配置文件路径即可。

修改完后,进入下一步即可。

启动服务

cd build
./ferry server -c=config/settings.yml

访问脚本最开始让你输入的地址,测试一下能否访问到。

这篇文章对您有用吗? 9

我们要如何帮助您?

发表回复

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

评论列表(60条)

  • zyl
    zyl 2021年8月10日 18:33

    {“level”:”fatal”,”ts”:”2021-08-10 18:28:29.385683″,”caller”:”database/mysql.go:35″,”msg”:”mysql connect error dial tcp: lookup ferry_mysql on 100.100.2.138:53: no such host”}
    有上面的异常提示,请教一下,如何解决

    • 兰玉磊
      兰玉磊 2021年8月11日 09:45

      @zyl数据库连接有问题吧。确认数据库地址是否正确。

    • 一二三四五
      一二三四五 2021年8月29日 16:15

      @兰玉磊同样的问题

  • zzz
    zzz 2021年8月11日 11:12

    部署完成后,验证码刷不出来,日志报404

    • fands
      fands 2021年9月26日 18:17

      @zzz请问大佬这个问题您解决了吗?

  • zzz
    zzz 2021年8月11日 11:13

    部署完成后,验证码刷不出来,日志报404
    {“level”:”info”,”ts”:”2021-08-11 11:10:07.456888″,”caller”:”middleware/logger.go:39″,”msg”:” 2021-08-11 11:10:07.4568 404 10.881µs 10.102.10.21 GET /172.16.15.90/api/v1/settings?classify=1″}
    {“level”:”info”,”ts”:”2021-08-11 11:10:07.481427″,”caller”:”middleware/logger.go:39″,”msg”:” 2021-08-11 11:10:07.4398 200 41.539078ms 10.102.10.21 GET /static/web/js/chunk-16212a04.8b3ebcf8.js”}
    {“level”:”info”,”ts”:”2021-08-11 11:10:07.512741″,”caller”:”middleware/logger.go:39″,”msg”:” 2021-08-11 11:10:07.5126 200 96.25µs 10.102.10.21 GET /static/web/fonts/element-icons.535877f5.woff”}
    {“level”:”info”,”ts”:”2021-08-11 11:10:07.628001″,”caller”:”middleware/logger.go:39″,”msg”:” 2021-08-11 11:10:07.6278 200 152.436µs 10.102.10.21 GET /static/web/img/login.ede1cdb8.png”}
    {“level”:”info”,”ts”:”2021-08-11 11:10:07.655141″,”caller”:”middleware/logger.go:39″,”msg”:” 2021-08-11 11:10:07.6551 404 14.678µs 10.102.10.21 GET /172.16.15.90/api/v1/getCaptcha”}

    • 兰玉磊
      兰玉磊 2021年8月12日 09:40

      @zzzF12看下访问的地址,是否正确。

    • leon
      leon 2021年8月28日 22:08

      @zzz/localhost/api/v1/settings?classify=1 ,问下:为何多出localhost的目录

    • fands
      fands 2021年9月26日 18:13

      @leon请问大佬您这个问题解决了吗?

    • lele
      lele 2021年9月28日 12:27

      @fandsFailed to load resource: the server responded with a status of 404 (Not Found)
      chunk-libs.bb4e6098.js:64 Uncaught (in promise) Error: Request failed with status code 404
      at t.exports (chunk-libs.bb4e6098.js:64)
      at t.exports (chunk-libs.bb4e6098.js:64)
      at XMLHttpRequest.g (chunk-libs.bb4e6098.js:64)
      :8002/192.168.10.220/api/v1/getCaptcha:1 Failed to load resource: the server responded with a status of 404 (Not Found)
      chunk-libs.bb4e6098.js:64 Uncaught (in promise) Error: Request failed with status code 404
      at t.exports (chunk-libs.bb4e6098.js:64)
      at t.exports (chunk-libs.bb4e6098.js:64)
      at XMLHttpRequest.g (chunk-libs.bb4e6098.js:64)
      :8002/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
      :8002/192.168.10.220/api/v1/getCaptcha:1 Failed to load resource: the server responded with a status of 404 (Not Found)
      chunk-libs.bb4e6098.js:64 Uncaught (in promise) Error: Request failed with status code 404
      at t.exports (chunk-libs.bb4e6098.js:64)
      at t.exports (chunk-libs.bb4e6098.js:64)
      at XMLHttpRequest.g (chunk-libs.bb4e6098.js:64)

    • sss
      sss 2021年11月11日 11:37

      @lele同问

    • 50232759
      50232759 2021年11月18日 15:32

      @zzz有解决办法么,遇到同样的问题.

    • 大聪明
      大聪明 2022年4月23日 14:10

      @zzz我也有类似的问题

  • xpy
    xpy 2021年8月11日 16:22

    go: github.com/RichardKnop/machinery@v1.8.8: Get “https://proxy.golang.org/github.com/%21richard%21knop/machinery/@v/v1.8.8.mod”: dial tcp 172.217.24.17:443: i/o timeout
    这个可以更改链接么!?

    • 兰玉磊
      兰玉磊 2021年8月12日 09:41

      @xpy按照这个方法,配置一下试试。https://www.fdevops.com/2020/03/22/fix-go-get

    • shall li
      shall li 2021年9月3日 12:29

      @xpy请问你这个问题解决了吗?

  • ww
    ww 2021年8月19日 11:47

    部署完成后,可以登录,但是在系统管理中,可以添加用户或者岗位,但是不能删除,提示是服务器连接异常,但是看服务器是没有报错信息的,请问怎么解决啊

    • 兰玉磊
      兰玉磊 2021年8月20日 10:03

      @ww确认下,请求的地址,是你自己部署的地址吗?

    • ww
      ww 2021年8月20日 17:57

      @兰玉磊是的,在.env.production中可以看到我添加的地址

    • 兰玉磊
      兰玉磊 2021年8月22日 19:59

      @ww可加群,详细聊聊。

  • evolos
    evolos 2021年8月19日 17:05

    >>> 开始编译后端程序…
    go: github.com/RichardKnop/machinery@v1.8.8: Get https://proxy.golang.org/github.com/%21richard%21knop/machinery/@v/v1.8.8.mod: dial tcp 172.217.27.145:443: i/o timeout
    编译后端代码失败,退出安装

    • 兰玉磊
      兰玉磊 2021年8月20日 10:03

      @evolos希望它可以帮到你。https://www.fdevops.com/2020/03/22/fix-go-get

    • evolos
      evolos 2021年9月1日 15:17

      @兰玉磊安装完了,登录网页一直显示‘’‘正在加载系统资源,请耐心等待’‘。进不去了。。。。求助。。。。

    • 兰玉磊
      兰玉磊 2021年9月2日 15:37

      @evolosF12 看下报错,或者加群详聊。

  • 111
    111 2021年9月2日 13:05

    >>> 开始编译后端程序…

    go: golang.org/x/crypto@v0.0.0-20200622213623-75b288015ac9: unrecognized import path “golang.org/x/crypto”: https fetch: Get “https://golang.org/x/crypto?go-get=1”: dial tcp 216.58.200.49:443: i/o timeout
    编译后端代码失败,退出安装

  • jiakunbao
    jiakunbao 2021年9月16日 19:16

    楼主,qq群是多少呀

  • fands
    fands 2021年9月26日 18:08

    您这个问题解决了吗?

  • zzz
    zzz 2021年10月20日 17:40

    ERROR Build failed with errors.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! vue-element-admin@4.2.1 build:prod: `vue-cli-service build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the vue-element-admin@4.2.1 build:prod script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /root/.npm/_logs/2021-10-20T09_37_20_646Z-debug.log

    这个ERR如何解决

  • zzn
    zzn 2021年10月27日 17:10

    {“level”:”fatal”,”ts”:”2021-10-27 17:10:07.427611″,”caller”:”database/mysql.go:35″,”msg”:”mysql connect error dial tcp: lookup ferry_mysql on 127.0.0.53:53: server misbehaving”}
    请教一下,这个问题如何解决

  • !
    ! 2021年10月28日 17:58

    您好,按照您这边的方式部署好了,最后一步 ./ferry server -c=config/settings.yml

  • !
    ! 2021年10月28日 18:02

    您好,这边按照您的文档部署好了,然后./ferry server -c=config/settings.yml启动服务之后,输出:
    2021/10/28 17:49:01 Server Run http://0.0.0.0:8002/
    2021/10/28 17:49:01 Swagger URL http://0.0.0.0:8002/swagger/index.html
    2021/10/28 17:49:01 Enter Control + C Shutdown Server
    但是去访问页面的时候 无法访问该页面
    也没有日志可以看,请教一下,这是哪个地方搞错了导致的么,感谢!

  • superabbite
    superabbite 2021年11月12日 09:43

    作者大大,我按照脚本部署的方式按照以后,运行./ferry server -c=config/settings.yml 启动服务后 没有提示错误,我输入外网ip:8002,可以打开网站,但是验证码不显示,提示Request failed with status code 404。这是什么问题?

  • 琉璃
    琉璃 2022年4月2日 16:11

    安装报错了:
    Install fail! Error: [tui-editor@1.3.3 ? tui-chart@3.11.3 ? raphael@git+https://github.com/nhn/raphael.git#2.2.0-c] git dep preparation failed
    Error: [tui-editor@1.3.3 ? tui-chart@3.11.3 ? raphael@git+https://github.com/nhn/raphael.git#2.2.0-c] git dep preparation failed
    at module.exports (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/download/git.js:36:11)
    at async module.exports (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/download/index.js:17:12)
    at async _install (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install.js:125:16)
    at async install (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install.js:26:12)
    at async mapper (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install.js:266:9)

  • 琉璃
    琉璃 2022年4月11日 17:56

    离谱,卡在[75/81] Installing zrender@4.3.2 一个多小时了

    • 兰玉磊
      兰玉磊 2022年4月13日 13:44

      @琉璃终止,然后多试几次,前端依赖下载确实会有这种问题。

  • 大聪明
    大聪明 2022年4月23日 14:11

    部署完成后,启动服务时有以下报错,是哪里的问题。有朋友有类似的情况吗?
    {“level”:”error”,”ts”:”2022-04-23 14:08:16.067449″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    WARNING: 2022/04/23 14:08:16 retry.go:20 Retrying in 1 seconds
    {“level”:”error”,”ts”:”2022-04-23 14:08:17.068194″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    WARNING: 2022/04/23 14:08:17 retry.go:20 Retrying in 2 seconds
    {“level”:”error”,”ts”:”2022-04-23 14:08:19.069012″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    WARNING: 2022/04/23 14:08:19 retry.go:20 Retrying in 3 seconds
    {“level”:”error”,”ts”:”2022-04-23 14:08:22.069827″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    WARNING: 2022/04/23 14:08:22 retry.go:20 Retrying in 5 seconds
    {“level”:”error”,”ts”:”2022-04-23 14:08:27.071925″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}
    WARNING: 2022/04/23 14:08:27 retry.go:20 Retrying in 8 seconds
    {“level”:”error”,”ts”:”2022-04-23 14:08:35.072829″,”caller”:”worker/worker.go:41″,”msg”:”执行失败: NOAUTH Authentication required.”}

    • 兰玉磊
      兰玉磊 2022年4月24日 13:47

      @大聪明redis 密码的问题。配置文件中,配置一下 redis 的密码。

  • 逍遥书生
    逍遥书生 2022年6月17日 08:43

    您好,执行脚本./ferry server -c=config/settings.yml 后,能正常链接数据库,但访问不了,日志如下:
    2022/06/17 08:35:35 starting api server
    {“level”:”info”,”ts”:”2022-06-17 08:35:35.750274″,”caller”:”database/mysql.go:37″,”msg”:”mysql connect success!”}
    INFO: 2022/06/17 08:35:35 worker.go:57 Launching a worker with the following settings:
    INFO: 2022/06/17 08:35:35 worker.go:58 – Broker: redis://127.0.0.1:6379
    INFO: 2022/06/17 08:35:35 worker.go:60 – DefaultQueue: ServerTasksQueue
    INFO: 2022/06/17 08:35:35 worker.go:64 – ResultBackend: ://
    INFO: 2022/06/17 08:35:35 redis.go:96 [*] Waiting for messages. To exit press CTRL+C
    [GIN-debug] [WARNING] Running in “debug” mode. Switch to “release” mode in production.
    – using env: export GIN_MODE=release
    – using code: gin.SetMode(gin.ReleaseMode)

    [GIN-debug] GET /info –> ferry/handler.Ping (7 handlers)
    [GIN-debug] GET /static/*filepath –> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
    [GIN-debug] HEAD /static/*filepath –> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (7 handlers)
    panic: html/template: pattern matches no files: `template/web/index.html`

    goroutine 1 [running]:
    html/template.Must(…)
    /usr/lib/golang/src/html/template/template.go:374
    github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0xc00061e340, 0x1581b12, 0x17)
    /root/go/pkg/mod/github.com/gin-gonic/gin@v1.7.0/gin.go:209 +0x385
    ferry/router.sysStaticFileRouter(0xc0004b2f00, 0xc00061e340)
    /opt/ferry/router/router.go:39 +0x78
    ferry/router.InitSysRouter(0xc00061e340, 0xc0006c2d80, 0x1573d18)
    /opt/ferry/router/router.go:23 +0xdd
    ferry/router.InitRouter(0xc0001905a0)
    /opt/ferry/router/init_router.go:25 +0xd0
    ferry/cmd/api.run(0x0, 0x0)
    /opt/ferry/cmd/api/server.go:72 +0xd1
    ferry/cmd/api.glob..func2(0x343d480, 0xc000dd00b0, 0x0, 0x1, 0x0, 0x0)
    /opt/ferry/cmd/api/server.go:37 +0x25
    github.com/spf13/cobra.(*Command).execute(0x343d480, 0xc000dd00a0, 0x1, 0x1, 0x343d480, 0xc000dd00a0)
    /root/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x472
    github.com/spf13/cobra.(*Command).ExecuteC(0x343d1e0, 0x41ad01, 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()
    /opt/ferry/cmd/cobra.go:39 +0x2d
    main.main()
    /opt/ferry/main.go:8 +0x25

  • 1910
    1910 2022年10月17日 20:37

    pkg/task/worker/worker.go:49:9: worker.SetPostTaskHandler undefined (type *machinery.Worker has no field or method SetPostTaskHandler)
    pkg/task/worker/worker.go:51:9: worker.SetPreTaskHandler undefined (type *machinery.Worker has no field or method SetPreTaskHandler)

  • ywxkf21
    ywxkf21 2022年11月19日 06:12

    对小白完全看不懂,全部配置完没报错但是打不开

  • 卡酷
    卡酷 2023年2月17日 14:34

    {“level”:”fatal”,”ts”:”2023-02-17 14:05:47.850058″,”caller”:”database/mysql.go:35″,”msg”:”mysql connect error dial tcp: lookup ferry_mysql on 183.60.83.19:53: no such host”}
    free版本对于配置文件的说明可否详细点?

  • 派大星
    派大星 2023年8月2日 11:28

    # github.com/golang-jwt/jwt
    /home/hyh/gopath/pkg/mod/github.com/golang-jwt/jwt@v3.2.2+incompatible/ecdsa.go:135:4: r.FillBytes undefined (type *big.Int has no field or method FillBytes)
    /home/hyh/gopath/pkg/mod/github.com/golang-jwt/jwt@v3.2.2+incompatible/ecdsa.go:136:4: s.FillBytes undefined (type *big.Int has no field or method FillBytes)

  • yikebantang
    yikebantang 2024年2月27日 15:29

    >>> 开始安装前端依赖…
    npm ERR! code CERT_HAS_EXPIRED
    npm ERR! errno CERT_HAS_EXPIRED
    npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: certificate has expired

    npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-02-27T06_37_48_623Z-debug-0.log
    ./build.sh: line 210: cnpm: command not found