BetterJS安装及配置介绍公司开发同事需要用这个,所以直接安装配置好,顺便学习下:)BadJS 是 web 前端脚本错误监控及跟踪解决方案。此项目为鹅厂 imweb(qq群:179045421) 团队的开源项目。安装宿主机环境Centos 7.4要求nodejs 0.12+mysql 5.0+mongodb 3.0+git 要求的安装nodejs[root@web03 goluk]# cd /cdc[root@web03 cdc]# cat /etc/centos-releaseCentOS 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 MIs this ok [y/d/N]: yDownloading 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]#mysql[root@web03 badjs-installer]# yum install http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm已加载插件:fastestmirror, langpacksmysql-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 kIs this ok [y/d/N]: yDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning 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, langpacksmysql-connectors-community | 2.5 kB 00:00mysql-tools-community | 2.5 kB 00:00mysql56-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:01Loading 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 MIs this ok [y/d/N]: yDownloading 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: NOKEYmysql-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]:yRunning transaction checkRunning transaction testTransaction test succeededRunning 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-installermongoDB参见官网安装文档设置repo文件vi /etc/yum.repos.d/mongodb-org-3.6.repo如下:[mongodb-org-3.6]name=MongoDB Repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/gpgcheck=1enabled=1gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc安装[root@web03 cdc]# vi /etc/yum.repos.d/mongodb-org-3.6.repo[root@web03 cdc]# yum install -y mongodb-org已加载插件:fastestmirror, langpacksmongodb-org-3.6 | 2.4 kB 00:00mongodb-org-3.6/7/primary_db | 18 kB 00:01Loading mirror speeds from cached hostfile正在解决依赖关系--> 正在检查事务---> 软件包 mongodb-org.x86_64.0.3.6.2-1.el7 将被 安装--> 正在处理依赖关系 mongodb-org-tools = 3.6.2,它被软件包 mongodb-org-3.6.2-1.el7.x86_64 需要--> 正在处理依赖关系 mongodb-org-shell = 3.6.2,它被软件包 mongodb-org-3.6.2-1.el7.x86_64 需要--> 正在处理依赖关系 mongodb-org-server = 3.6.2,它被软件包 mongodb-org-3.6.2-1.el7.x86_64 需要--> 正在处理依赖关系 mongodb-org-mongos = 3.6.2,它被软件包 mongodb-org-3.6.2-1.el7.x86_64 需要--> 正在检查事务---> 软件包 mongodb-org-mongos.x86_64.0.3.6.2-1.el7 将被 安装---> 软件包 mongodb-org-server.x86_64.0.3.6.2-1.el7 将被 安装---> 软件包 mongodb-org-shell.x86_64.0.3.6.2-1.el7 将被 安装---> 软件包 mongodb-org-tools.x86_64.0.3.6.2-1.el7 将被 安装--> 解决依赖关系完成依赖关系解决================================================================================ Package 架构 版本 源 大小================================================================================正在安装: mongodb-org x86_64 3.6.2-1.el7 mongodb-org-3.6 5.8 k为依赖而安装: mongodb-org-mongos x86_64 3.6.2-1.el7 mongodb-org-3.6 12 Mmongodb-org-server x86_64 3.6.2-1.el7 mongodb- org-3.6 20 Mmongodb-org-shell x86_64 3.6.2-1.el7 mongodb-org-3.6 12 Mmongodb-org-tools x86_64 3.6.2-1.el7 mongodb-org-3.6 46 M事务概要================================================================================安装 1 软件包 (+4 依赖软件包)总下载量:90 M安装大小:264 MDownloading packages:警告:/var/cache/yum/x86_64/7/mongodb-org-3.6/packages/mongodb-org-3.6.2-1.el7.x86_64.rpm: 头V3 RSA/SHA1 Signature, 密钥 ID 91fa4ad5: NOKEYmongodb-org-3.6.2-1.el7.x86_64.rpm 的公钥尚未安装(1/5): mongodb-org-3.6.2-1.el7.x86_64.rpm | 5.8 kB 00:01(2/5): mongodb-org-server-3.6.2-1.el7.x86_64.rpm | 20 MB 00:03(3/5): mongodb-org-shell-3.6.2-1.el7.x86_64.rpm | 12 MB 00:02(4/5): mongodb-org-mongos-3.6.2-1.el7.x86_64.rpm | 12 MB 00:09(5/5): mongodb-org-tools-3.6.2-1.el7.x86_64.rpm | 46 MB 00:42--------------------------------------------------------------------------------总计 1.8 MB/s | 90 MB 00:49从 https://www.mongodb.org/static/pgp/server-3.6.asc 检索密钥导入 GPG key 0x91FA4AD5:用户ID : "MongoDB 3.6 Release Signing Key "指纹 : 2930 adae 8caf 5059 ee73 bb4b 5871 2a22 91fa 4ad5来自 : https://www.mongodb.org/static/pgp/server-3.6.ascRunning transaction checkRunning transaction testTransaction test succeededRunning transaction正在安装 : mongodb-org-server-3.6.2-1.el7.x86_64......已安装:mongodb-org.x86_64 0:3.6.2-1.el7作为依赖被安装:mongodb-org-mongos.x86_64 0:3.6.2-1.el7mongodb-org-server.x86_64 0:3.6.2-1.el7mongodb-org-shell.x86_64 0:3.6.2-1.el7mongodb-org-tools.x86_64 0:3.6.2-1.el7完毕![root@web03 cdc]#设置selinux允许mongoDB端口semanage port -a -t mongod_port_t -p tcp 27017修改mongoDB存储路径存储模式[root@web03 cdc]# mkdir mongodb[root@web03 cdc]# chown mongod:mongod mongodb/[root@web03 cdc]# vi /etc/mongod.confstorage: #dbPath: /var/lib/mongo dbPath: /cdc/mongodb journal: enabled: true engine: wiredTiger修改mysql存储及权限[root@web03 cdc]# mkdir mysql[root@web03 cdc]# chown mysql:mysql mysql[root@web03 cdc]# vi /etc/my.cnf[mysqld]#datadir=/var/lib/mysqldatadir=/cdc/lib/mysqlsocket=/cdc/mysql#socket=/var/lib/mysql/mysql.sockgit  [root@web03 cdc]# yum install git已加载插件:fastestmirror, langpacksLoading 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 MIs this ok [y/d/N]: yDownloading 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:00Running transaction checkRunning transaction testTransaction test succeededRunning 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 32Unpacking objects: 100% (32/32), done.[root@web03 cdc]# cd badjs-installer/[root@web03 badjs-installer]# npm run clone> [email protected] clone /cdc/badjs-installer> npm run clone-acceptor && npm run clone-mq && npm run clone-storage && npm run clone-web> [email protected] 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.> [email protected] 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 79Unpacking objects: 100% (79/79), [email protected] clone-storage /cdc/badjs-installergit 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), [email protected] 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> [email protected] install /cdc/badjs-installer> npm run install-acceptor && npm run install-mq && npm run install-storage && npm run [email protected] install-acceptor /cdc/badjs-installercd badjs-acceptor && npm install......> [email protected] install-storage /cdc/badjs-installer> cd badjs-storage && npm install......导入数据[root@web03 db]# mysql遇到的错误及解决mysql登录错误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)phantomjs 安装不成功因为被长城阻隔,所以跨越过去就可以解决了libfontconfig.so.1: cannot open shared object file: No such file or directory参见执行下面命令yum install libXext libXrender fontconfig libfontconfig.so.1参考与致谢BetterJS
09-22 13:06