BetterJS安装及配置

290阅读 0评论2018-02-08 missing-cn
分类:JavaScript

BetterJS安装及配置

介绍

公司开发同事需要用这个,所以直接安装配置好,顺便学习下:)

BadJS 是 web 前端脚本错误监控及跟踪解决方案。此项目为鹅厂 imweb(qq群:179045421) 团队的开源项目。

安装

宿主机环境

要求

要求的安装

[root@web03 goluk]# cd /cdc
[root@web03 cdc]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@web03 cdc]# yum install nodejs
......
正在解决依赖关系
--> 正在检查事务
---> 软件包 nodejs.x86_64.1.6.12.3-1.el7 将被 安装
--> 正在处理依赖关系 npm = 1:3.10.10-1.6.12.3.1.el7,它被软件包 1:nodejs-6.12.3-1.el7.x86_64 需要
--> 正在处理依赖关系 http-parser >= 2.7.0,它被软件包 1:nodejs-6.12.3-1.el7.x86_64 需要
--> 正在处理依赖关系 libuv >= 1:1.9.1,它被软件包 1:nodejs-6.12.3-1.el7.x86_64 需要
--> 正在处理依赖关系 libhttp_parser.so.2()(64bit),它被软件包 1:nodejs-6.12.3-1.el7.x86_64 需要
--> 正在处理依赖关系 libuv.so.1()(64bit),它被软件包 1:nodejs-6.12.3-1.el7.x86_64 需要
--> 正在检查事务
---> 软件包 http-parser.x86_64.0.2.7.1-5.el7_4 将被 安装
---> 软件包 libuv.x86_64.1.1.10.2-1.el7 将被 安装
---> 软件包 npm.x86_64.1.3.10.10-1.6.12.3.1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package          架构        版本                           源            大小
================================================================================
正在安装:
 nodejs           x86_64      1:6.12.3-1.el7                 epel         4.6 M
为依赖而安装:
 http-parser      x86_64      2.7.1-5.el7_4                  updates       28 k
 libuv            x86_64      1:1.10.2-1.el7                 epel         109 k
 npm              x86_64      1:3.10.10-1.6.12.3.1.el7       epel         2.5 M

事务概要
================================================================================
安装  1 软件包 (+3 依赖软件包)

总下载量:7.3 M
安装大小:26 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): http-parser-2.7.1-5.el7_4.x86_64.rpm                |  28 kB   00:00
(2/4): libuv-1.10.2-1.el7.x86_64.rpm                       | 109 kB   00:00
(3/4): nodejs-6.12.3-1.el7.x86_64.rpm                      | 4.6 MB   00:00
(4/4): npm-3.10.10-1.6.12.3.1.el7.x86_64.rpm               | 2.5 MB   00:01
--------------------------------------------------------------------------------
总计                                               5.3 MB/s | 7.3 MB  00:01
......
已安装:
  nodejs.x86_64 1:6.12.3-1.el7

作为依赖被安装:
  http-parser.x86_64 0:2.7.1-5.el7_4         libuv.x86_64 1:1.10.2-1.el7
  npm.x86_64 1:3.10.10-1.6.12.3.1.el7

完毕!
[root@web03 cdc]#
[root@web03 badjs-installer]# yum install  http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
已加载插件:fastestmirror, langpacks
mysql-community-release-el7-5.noarch.rpm                 | 6.0 kB     00:00
正在检查 /var/tmp/yum-root-XYRtF4/mysql-community-release-el7-5.noarch.rpm: mysql-community-release-el7-5.noarch
/var/tmp/yum-root-XYRtF4/mysql-community-release-el7-5.noarch.rpm 将被安装
正在解决依赖关系
--> 正在检查事务
---> 软件包 mysql-community-release.noarch.0.el7-5 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
 Package               架构   版本  源                                     大小
================================================================================
正在安装:
 mysql-community-release
                       noarch el7-5 /mysql-community-release-el7-5.noarch 4.3 k

事务概要
================================================================================
安装  1 软件包

总计:4.3 k
安装大小:4.3 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mysql-community-release-el7-5.noarch                        1/1
  验证中      : mysql-community-release-el7-5.noarch                        1/1

已安装:
  mysql-community-release.noarch 0:el7-5

完毕!
[root@web03 badjs-installer]# yum install mysql mysql-server
已加载插件:fastestmirror, langpacks
mysql-connectors-community                               | 2.5 kB     00:00
mysql-tools-community                                    | 2.5 kB     00:00
mysql56-community                                        | 2.5 kB     00:00
(1/3): mysql-connectors-community/x86_64/primary_db        |  18 kB   00:00
(2/3): mysql-tools-community/x86_64/primary_db             |  38 kB   00:00
(3/3): mysql56-community/x86_64/primary_db                 | 184 kB   00:01
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
......
正在安装:
 mysql-community-client   x86_64   5.6.39-2.el7       mysql56-community    19 M
 mysql-community-libs     x86_64   5.6.39-2.el7       mysql56-community   2.0 M
      替换  mariadb-libs.x86_64 1:5.5.56-2.el7
 mysql-community-server   x86_64   5.6.39-2.el7       mysql56-community    59 M
为依赖而安装:
 mysql-community-common   x86_64   5.6.39-2.el7       mysql56-community   257 k
 numactl-libs             x86_64   2.0.9-6.el7_2      os                   29 k

事务概要
================================================================================
安装  3 软件包 (+2 依赖软件包)

总下载量:81 M
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.39-2.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
mysql-community-common-5.6.39-2.el7.x86_64.rpm 的公钥尚未安装
(1/5): mysql-community-common-5.6.39-2.el7.x86_64.rpm      | 257 kB   00:00
(2/5): mysql-community-libs-5.6.39-2.el7.x86_64.rpm        | 2.0 MB   00:00
(3/5): numactl-libs-2.0.9-6.el7_2.x86_64.rpm               |  29 kB   00:00
(4/5): mysql-community-client-5.6.39-2.el7.x86_64.rpm      |  19 MB   00:07
(5/5): mysql-community-server-5.6.39-2.el7.x86_64.rpm      |  59 MB   00:51
--------------------------------------------------------------------------------
总计                                               1.5 MB/s |  81 MB  00:53
从 file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 检索密钥
导入 GPG key 0x5072E1F5:
 用户ID     : "MySQL Release Engineering "
 指纹       : a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 软件包     : mysql-community-release-el7-5.noarch (installed)
 来自       : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : mysql-community-common-5.6.39-2.el7.x86_64                  
  ......
  
已安装:
  mysql-community-client.x86_64 0:5.6.39-2.el7
  mysql-community-libs.x86_64 0:5.6.39-2.el7
  mysql-community-server.x86_64 0:5.6.39-2.el7

作为依赖被安装:
  mysql-community-common.x86_64 0:5.6.39-2.el7
  numactl-libs.x86_64 0:2.0.9-6.el7_2

替代:
  mariadb-libs.x86_64 1:5.5.56-2.el7

完毕!
[root@web03 badjs-installer 
 [root@web03 cdc]# yum install git
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 git.x86_64.0.1.8.3.1-12.el7_4 将被 安装
--> 正在处理依赖关系 perl-Git = 1.8.3.1-12.el7_4,它被软件包 
......
依赖关系解决

================================================================================
 Package                架构         版本                   源             大小
================================================================================
正在安装:
 git                    x86_64       1.8.3.1-12.el7_4       updates       4.4 M
为依赖而安装:
 libgnome-keyring       x86_64       3.12.0-1.el7           os            109 k
 perl-Error             noarch       1:0.17020-2.el7        os             32 k
 perl-Git               noarch       1.8.3.1-12.el7_4       updates        53 k
 perl-TermReadKey       x86_64       2.30-20.el7            os             31 k

事务概要
================================================================================
安装  1 软件包 (+4 依赖软件包)

总下载量:4.6 M
安装大小:23 M
Is this ok [y/d/N]: y
Downloading packages:
(1/5): perl-Error-0.17020-2.el7.noarch.rpm                 |  32 kB   00:00
(2/5): perl-Git-1.8.3.1-12.el7_4.noarch.rpm                |  53 kB   00:00
(3/5): perl-TermReadKey-2.30-20.el7.x86_64.rpm             |  31 kB   00:00
(4/5): libgnome-keyring-3.12.0-1.el7.x86_64.rpm            | 109 kB   00:00
(5/5): git-1.8.3.1-12.el7_4.x86_64.rpm                     | 4.4 MB   00:00
--------------------------------------------------------------------------------
总计                                               4.6 MB/s | 4.6 MB  00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 1:perl-Error-0.17020-2.el7.noarch                           
  ......
已安装:
  git.x86_64 0:1.8.3.1-12.el7_4

作为依赖被安装:
  libgnome-keyring.x86_64 0:3.12.0-1.el7  perl-Error.noarch 1:0.17020-2.el7
  perl-Git.noarch 0:1.8.3.1-12.el7_4      perl-TermReadKey.x86_64 0:2.30-20.el7

完毕! 

部署

[root@web03 cdc]# git clone https://github.com/BetterJS/badjs-installer.git
正克隆到 'badjs-installer'...
remote: Counting objects: 32, done.
remote: Total 32 (delta 0), reused 0 (delta 0), pack-reused 32
Unpacking objects: 100% (32/32), done.
[root@web03 cdc]# cd badjs-installer/
[root@web03 badjs-installer]# npm run clone

> badjs-installer@0.1.0 clone /cdc/badjs-installer
> npm run clone-acceptor && npm run clone-mq && npm run clone-storage && npm run clone-web


> badjs-installer@0.1.0 clone-acceptor /cdc/badjs-installer
> git clone https://github.com/BetterJS/badjs-acceptor.git

正克隆到 'badjs-acceptor'...
remote: Counting objects: 498, done.
remote: Total 498 (delta 0), reused 0 (delta 0), pack-reused 498
接收对象中: 100% (498/498), 109.82 KiB | 138.00 KiB/s, done.
处理 delta 中: 100% (283/283), done.

> badjs-installer@0.1.0 clone-mq /cdc/badjs-installer
> git clone https://github.com/BetterJS/badjs-mq.git

正克隆到 'badjs-mq'...
remote: Counting objects: 79, done.
remote: Total 79 (delta 0), reused 0 (delta 0), pack-reused 79
Unpacking objects: 100% (79/79), done.

badjs-installer@0.1.0 clone-storage /cdc/badjs-installer
git clone https://github.com/BetterJS/badjs-storage.git

正克隆到 'badjs-storage'...
remote: Counting objects: 595, done.
remote: Total 595 (delta 0), reused 0 (delta 0), pack-reused 595
接收对象中: 100% (595/595), 91.72 KiB | 0 bytes/s, done.
处理 delta 中: 100% (324/324), done.

badjs-installer@0.1.0 clone-web /cdc/badjs-installer
> git clone https://github.com/BetterJS/badjs-web.git

正克隆到 'badjs-web'...
remote: Counting objects: 4016, done.
remote: Total 4016 (delta 0), reused 0 (delta 0), pack-reused 4016
接收对象中: 100% (4016/4016), 3.70 MiB | 84.00 KiB/s, done.
处理 delta 中: 100% (2794/2794), done.
[root@web03 badjs-installer]# npm run install

> badjs-installer@0.1.0 install /cdc/badjs-installer
> npm run install-acceptor && npm run install-mq && npm run install-storage && npm run install-web


badjs-installer@0.1.0 install-acceptor /cdc/badjs-installer
cd badjs-acceptor && npm install

......
> badjs-installer@0.1.0 install-storage /cdc/badjs-installer
> cd badjs-storage && npm install
...... 
[root@web03 db]# mysql < create.sql

遇到的错误及解决

banjs默认是root/root ,mysql默认是root用户的密码是空,所以进入mysql执行下列语句修改为root即可

mysql> grant all on badjs.* to 'root'@'localhost' identified by 'root';
Query OK, 0 rows affected (0.00 sec)

因为被长城阻隔,所以跨越过去就可以解决了

参见执行下面命令

yum install libXext libXrender fontconfig libfontconfig.so.1

参考与致谢

BetterJS

上一篇:最近研究学习falcon的过程及经验分享合集
下一篇:通过sock5代理转http/https代理加速命令行访问站点速度的方法