简体   繁体   English

Jenkins Linux从属区域设置

[英]Jenkins Linux Slave Locale

I have Jenkins setup as master on a Windows machine. 我在Windows机器上将Jenkins设置为主服务器。 I am trying to connect a Linux machine as a slave with JNLP using the following command: 我正在尝试使用以下命令将Linux计算机作为从站与JNLP连接:

/usr/java/latest/bin/java -jar /home/devjenkins/slave/slave.jar -jnlpUrl "$JNLP_URL"

where JNLP_URL is the url to connect with the master Jenkins. 其中JNLP_URL是与主Jenkins连接的URL。 The connection connects successfully and I am able to run jobs on the slave machine. 连接成功连接,我可以在从属计算机上运行作业。

The problem that I have not managed to solve is setting the Locale on the slave machine which for some reason seems to be defaulting to en_US.utf8 instead of en_GB.utf8 . 我尚未解决的问题是在从属计算机上设置语言环境,出于某种原因,该语言环境似乎默认为en_US.utf8而不是en_GB.utf8 When connecting through SSH to this linux machine with the same user as the jenkins slave, the locale is resolving correctly to en_GB.utf8 . 通过SSH以与jenkins从属相同的用户身份连接到此linux计算机时,语言环境正确解析为en_GB.utf8

I tried setting an environment variable to the node configuration in Jenkins master LANG=en_GB.utf8 but when viewing the system information from nodes > slavemachine > system information, the Environment Variables refer to the property LANG en_US.UTF-8 . 我尝试在Jenkins主服务器LANG=en_GB.utf8为节点配置设置环境变量,但是当从节点>从机>系统信息查看系统信息时,环境变量引用属性LANG en_US.UTF-8

Any ideas where this property is being set and how can I override this value? 有什么想法可以设置此属性,以及如何覆盖此值?

I managed to solve this issue by using the option to use SSH to connect to the jenkins slave. 我设法通过使用选项来使用SSH连接到jenkins从属服务器来解决了这个问题。 Through this option, jenkins creates the setup on the slave machine via SSH and starts the slave.jar process. 通过此选项,jenkins通过SSH在从属计算机上创建设置,并启动slave.jar进程。 Most probably, it was a bug in Jenkins that does not update/override the language when using Java Web start. 这很可能是Jenkins中的一个错误,该错误在使用Java Web start时不会更新/覆盖该语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM