一、安裝Jenkins時,java -jar jenkins.war --httpPort=8888,出現Jenkins is fully up and running時,說明Jenkins已經安裝成功,但有時候咱們卻訪問不了,是由於沒有打開防火牆,html
打開防火牆,使外部能訪問java
# /sbin/iptables -I INPUT -p tcp --dport 8888 -j ACCEPTgit
# service iptables savegithub
# service iptables restartvim
二、Jenkins 更新插件出現 java.net.UnknownHostException: updates.jenkins-ci.org 解決方法:bash
修改dns服務器
在終端輸入:vim /etc/resolv.conf,打開後添加如下內容:curl
search updates.jenkins-ci.orgtcp
nameserver 192.168.1.228url
nameserver 114.114.114.114
三、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
經過git –version查看系統帶的版本,Cento6.5應該自帶的是git版本是1.7.1
># yum remove 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才能夠正常使用。