MeterSphere 是一站式开源持续测试平台,涵盖测试跟踪、接口测试、性能测试、团队协作等功能,兼容 JMeter 等开源标准,有效助力开发和测试团队充分利用云弹性进行高度可扩展的自动化测试,加速高质量软件的交付。
各个组件间的关系可参考下图
MeterSphere 提供了多租户、多角色的管理模型, 用户可根据所在团队的实际情况进行灵活的租户体系映射
以 root 用户 ssh 登录目标服务器, 执行如下命令
curl -sSL https://github.com/metersphere/metersphere/releases/latest/download/quick_start.sh | sh
安装脚本默认使用 /opt/metersphere 目录作为安装目录,MeterSphere 的配置文件、数据及日志等均存放在该安装目录
如果您的服务器可以访问互联网, 可以通过以下命令直接升级 metersphere 至最新版本
# 升级至最新版本
msctl upgrade
[MeterSphere Log]: ======================= 开始安装 =======================
[MeterSphere Log]: 检测到 Docker 已安装,跳过安装步骤
[MeterSphere Log]: 启动 Docker
Redirecting to /bin/systemctl start docker.service
[MeterSphere Log]: 检测到 Docker Compose 已安装,跳过安装步骤
[MeterSphere Log]: 拉取镜
Pulling zookeeper ... done
Pulling kafka ... done
Pulling prometheus ... done
Pulling ms-data-streaming ... done
Pulling ms-node-controller ... done
Pulling mysql ... done
Pulling ms-server ... done
Pulling nodeexporter ... done
5.4.1-ms3-jdk8: Pulling from metersphere/jmeter-master
Digest: sha256:91b5d53211211feb851e6836803e7159f70dbdeaede54adfe8b41487d72d9d30
Status: Image is up to date for registry.cn-qingdao.aliyuncs.com/metersphere/jmeter-master:5.4.1-ms3-jdk8
/tmp/metersphere-release-v1.10.0
[MeterSphere Log]: 启动服务
Stopping ms-server ... done
Stopping ms-data-streaming ... done
Stopping kafka ... done
Stopping nodeexporter ... done
Stopping ms-prometheus ... done
Stopping ms-node-controller ... done
Stopping mysql ... done
Stopping zookeeper ... done
Removing ms-server ... done
Removing ms-data-streaming ... done
Removing kafka ... done
Removing nodeexporter ... done
Removing ms-prometheus ... done
Removing ms-node-controller ... done
Removing mysql ... done
Removing zookeeper ... done
Removing network metersphere_ms-network
Removing volume metersphere_ms-mysql-data
Removing volume metersphere_ms-logs
Removing volume metersphere_ms-prometheus-conf
Removing volume metersphere_ms-data
Removing volume metersphere_ms-prometheus-data
Removing volume metersphere_ms-zookeeper-data
Removing volume metersphere_ms-conf
Removing volume metersphere_ms-kafka-data
Creating mysql ... done
Creating ms-node-controller ... done
Creating zookeeper ... done
Creating ms-prometheus ... done
Creating kafka ... done
Creating nodeexporter ... done
Creating ms-server ... done
Creating ms-data-streaming ... done
======================= 安装完成 =======================
请通过以下方式访问:
URL: http://$LOCAL_IP:8081
用户名: admin
初始密码: metersphere
您可以使用命令 'msctl status' 检查服务运行情况.
mysql is up-to-date
ms-prometheus is up-to-date
ms-node-controller is up-to-date
zookeeper is up-to-date
ms-server is up-to-date
nodeexporter is up-to-date
kafka is up-to-date
ms-data-streaming is up-to-date
检测当前版本为v1.10.0
最新版本与当前版本一致,退出升级过
自 MeterSphere v1.3.0 起之后的版本才提供 upgrade 命令
https://metersphere.io/docs/about/changelog/
msctl status
Name Command State Ports
--------------------------------------------------------------------------------------------------------
kafka /opt/bitnami/scripts/kafka ... Up (healthy) 0.0.0.0:19092->19092/tcp, 9092/tcp
ms-data-streaming /deployments/run-java.sh Up (healthy) 0.0.0.0:8084->8084/tcp, 0.0.0.0:8085->8085/tcp
ms-node-controller/deployments/run-java.sh Up (healthy) 0.0.0.0:8082->8082/tcp, 0.0.0.0:9100->9100/tcp
ms-prometheus /bin/prometheus --config.f ...Up (healthy) 0.0.0.0:9090->9090/tcp
ms-server /deployments/run-java.sh Up (healthy) 0.0.0.0:8081->8081/tcp
mysql docker-entrypoint.sh mysqld Up (healthy) 0.0.0.0:3307->3306/tcp, 33060/tcp
nodeexporter /bin/node_exporter --path. ...Up (healthy)
zookeeper /opt/bitnami/scripts/zooke ... Up (healthy) 2181/tcp, 2888/tcp, 3888/tcp, 8080/tcp
安装成功后,通过浏览器访问如下页面登录 MeterSphere
地址: http://目标服务器IP地址:8081
用户名: admin
密码: metersphere
vim /opt/metersphere/conf/metersphere.properties
添加以下配置,单位秒
session.timeout=86400
重启ms-data-streaming服务
docker restart CONTAINER ID
msctl reload
docker logs ms-server
docker logs ms-data-streaming
docker logs ms-node-controller
docker logs mysql
docker logs kafka
备注:jmeter 中脚本编写不太规范的话,导入可能会提示找不到引用的 jar 包方法
import com.xdja.wch.DFSBase;DFSBase dfsBase = new DFSBase();//获取fastdfs服务器系统时间log.info("-----timestamp------:"+"${timestamp}");Long timestamp1 = Long.parseLong("${timestamp}");//log.info("-----timestamp1------:"+ timestamp1);Long time = timestamp1 + 8460000;String ts = String.valueOf(time);vars.put("ts",ts);String data = "${name}" + ts + "${appId}";String sign = dfsBase.hamcsha1(data, "123456");//log.info("-----sign------:"+sign);vars.put("sign",sign);
https://github.com/metersphere/jenkins-plugin
[root@xdja metersphere]# cd /opt/metersphere/logs/metersphere[root@xdja metersphere]# tail -2000f error.log# 发现如下报错信息2021-04-15 10:55:01,122 [Async-Executor4] ERROR i.m.n.sender.impl.MailNoticeSender ? - Method[send][org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS. Failed messages: javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS; message exceptions (1) are:Failed message 1: javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS]
Check node-controller /etc/hosts, 127.0.0.1 ${hostname} must be contained. Please delete the report and rerun.
[root@xdja ~]# hostnamexdja[root@xdja ~]# vim /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4127.0.0.1 xdja::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
浏览器录制插件
Jenkins 插件
消息服务
企业版及专业服务
X-Pack 增强包