Caliper压力测试(具体步骤+示例)
一、Caliper压力测试指南
1. 环境要求
(1)配置基本环境
-
部署Caliper的计算机需要有外网权限;
解决方法:
#通常情况下,DNS 服务器由你的网络配置提供。你可以查看当前的 DNS 设置: cat /etc/resolv.conf oot@thy-virtual-machine:/home/thy/fisco# cat /etc/resolv.conf # This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8). # Do not edit. # # This file might be symlinked as /etc/resolv.conf. If you're looking at # /etc/resolv.conf and seeing this text, you have followed the symlink. # # This is a dynamic resolv.conf file for connecting local clients to the # internal DNS stub resolver of systemd-resolved. This file lists all # configured search domains. # # Run "resolvectl status" to see details about the uplink DNS servers # currently in use. # # Third party programs should typically not access this file directly, but only # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a # different way, replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. nameserver 127.0.0.53 options edns0 trust-ad search .
#确保 nameserver 条目指向正确的 DNS 服务器。如果看起来不正确或有问题,可以尝试手动修改为已知可靠的 DNS 服务器,如 Google 的公共 DNS: echo "nameserver 8.8.8.8" > /etc/resolv.conf 或者 vim /etc/resolv.conf # This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8). # Do not edit. # # This file might be symlinked as /etc/resolv.conf. If you're looking at # /etc/resolv.conf and seeing this text, you have followed the symlink. # # This is a dynamic resolv.conf file for connecting local clients to the # internal DNS stub resolver of systemd-resolved. This file lists all # configured search domains. # # Run "resolvectl status" to see details about the uplink DNS servers # currently in use. # # Third party programs should typically not access this file directly, but only # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a # different way, replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. nameserver 8.8.8.8 ####修改为8.8.8.8 options edns0 trust-ad search localdomain ~ ~ ~
#如果你对配置进行了更改,可能需要重新启动 systemd-resolved 服务使其加载新的配置: sudo systemctl restart systemd-resolved
-
操作系统版本需要满足以下要求:Ubuntu >= 16.04、CentOS >= 7或MacOS >= 10.14;
-
部署Caliper的计算机需要安装有以下软件:python 2.7、make、g++、gcc及git。
2. NodeJS
-
版本要求:
NodeJS 8 (LTS), 9, 或 10 (LTS),Caliper尚未在更高的NodeJS版本中进行过验证。
-
安装指南:
建议使用nvm(Node Version Manager)安装,nvm的安装方式如下:
# 安装nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
# 若出现因网络问题导致长时间下载失败,可尝试以下命令
curl -o- https://gitee.com/mirrors/nvm/raw/v0.33.2/install.sh | bash
# 加载nvm配置
source ~/.$(basename $SHELL)rc
# 安装Node.js 8
nvm install 8
# 使用Node.js 8
nvm use 8
查看可用版本:
nvm ls-remote
安装具体版本
nvm install 8.17.0
验证安装:
3.部署Docker
# 更新包索引
sudo apt-get update
# 安装基础依赖库
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# 添