Jmeter:“An error occurred: Can‘t connect to X11 window server using ‘lacalhost:12.0‘ as the value of

做各种不同项目的性能测试,都需要在项目本地压测服务器配置jmeter,需要时还要调出jmeter图形化界面来调试jmeter脚本。

标题中的问题遇过多次,这次做个记录。


1. 启动jmeter报错

  在配置好jmeter环境变量的linux系统执行jmeter命令,报错如下:

[root@localhost ~]# jmeter
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  = =
Don't use GUI mode for load testing !, only for Test creation and Test debugging. 
For load testing, use CLI Mode (was NON GUI):
    jmeter -n -t [jmx file] -l [results file] -e -a [Path to web report falder]
& increase Java Heap to meet your test requirements:
    Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file 
Check:https://jmeter.apache.org/usermanual/best-practices.html
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
An error occurred: Can't connect to X11 window server using 'lacalhost:12.0' as the value of the display variable.

2. 解决问题

2.1 设置DISPLAY变量

[root@localhost ~]# export DISPLAY=:0.0

2.2 安装xhost 

[root@localhost ~]# yum -y install xhost 

  执行xhost+

[root@localhost ~]# xhost +

3. 启动jmeter

  至此,问题解决。执行jmeter命令启动图形化界面。

[root@localhost ~]# jmeter
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Don't use GUI mode for load testing !, only for Test creation and Test debugging. 
For load testing, use CLI Mode (was NON GUI):
    jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]
& increase Java Heap to meet your test requirements:
    Modify current env variable HEAP="-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m" in the jmeter batch file 
Check :https://jmeter.apache.org/usermanual/best-practices.html
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Jun 12, 2023 10:59:54 AM com.kitfox.svg.Text buildText
WARNING: Could not create font Arial
Jun 12, 2023 10:59:54 AM com.kitfox.svg.Text buildText
WARNING: Could not create font Arial
Jun 12, 2023 10:59:54 AM com.kitfox.svg.Text buildText
WARNING: Could not create font Arial
Jun 12, 2023 10:59:54 AM com.kitfox.svg.Text buildText
WARNING: Could not create font Arial
Jun 12, 2023 10:59:54 AM com.kitfox.svg.Text buildText
WARNING: Could not create font Arial

类似问题。可参考: https://www.cnblogs.com/silgen/p/16668902.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值