1、安装Jenkins时,java -jar jenkins.war --httpPort=8888,出现Jenkins is fully up and running时,说明Jenkins已经安装成功,但有时候我们却访问不了,是因为没有打开防火墙,
打开防火墙,使外部能访问
# /sbin/iptables -I INPUT -p tcp --dport 8888 -j ACCEPT
# service iptables save
# service iptables restart
2、Jenkins 更新插件出现 java.net.UnknownHostException: updates.jenkins-ci.org 解决方法:
修改dns
在终端输入:vim /etc/resolv.conf,打开后添加以下内容:
search updates.jenkins-ci.org
nameserver 192.168.1.228
nameserver 114.114.114.114
3、Jenkins 更新GitHub plugin,但Jenkins中git无法使用,首先检查你的服务器是否安装git,打开终端输入 git --version,如果有版本信息说明已经安装有。但我们在添加项目git地址时出现下面错误:
Failed to connect to repository : Command "/usr/bin/git config --local credential.helper store --file=/tmp/git6945256026248158269.credentials" returned status code 129:
stdout:
stderr: error: unknown option `local'
usage: git config [options]
Config file location
--global use global config file
--system use system config file
-f, --file <FILE> use given config file
Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--replace-all replace all matching variables: name value [value_regex]
--add adds a new variable: name value
--unset removes a variable: name [value-regex]
--unset-all removes all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit opens an editor
--get-color <slot> find the color configured: [default]
--get-colorbool <slot>
find the color setting: [stdout-is-tty]
Type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--path value is a path (file or directory name)
Other
-z, --null terminate values with NUL byte
这个问题说明你服务器上安装git的版本太低,需要重新安装新git版本。
安装需求:
># yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc># yum install gcc perl-ExtUtils-MakeMaker
error: ```/utf8.c:463: undefined reference to `libiconv'```
># wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
># tar zxvf libiconv-1.14.tar.gz
># cd libiconv-1.14
># ./configure --prefix=/usr/local/libiconv
># make && make install
卸载Centos自带的git1.7.1:
通过git –version查看系统带的版本,Cento6.5应该自带的是git版本是1.7.1
># yum remove git
下载git2.2.1并将git添加到环境变量中
># wget https://github.com/git/git/archive/v2.2.1.tar.gz># tar zxvf v2.2.1.tar.gz># cd git-2.2.1># make configure># ./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv># make all doc># make install install-doc install-html># echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc># source /etc/bashrc
查看版本号
># git --version>git version 2.2.1
安装成功后,你需要重新启动Jenkins,来配置更新Jenkins的PATH路径。Jenkins中的git才可以正常使用。
来源:oschina
链接:https://my.oschina.net/u/2473136/blog/545974