Closed kkkotaro closed 7 years ago
よろしくお願いします
以下ドキュメントを参照し、ダウンロード、インストールする https://jenkins.io/doc/
http://jenkins.io/doc/ から jenkins.war をダウンロード
http://qiita.com/ymaru/items/87fbc4e68f5995d3964c でtar xz形式の解凍方法を参照
Documentationのリンクから jenkins.war をダウンロード
"Open up a terminal in the download directory and run java -jar jenkins.war" に従い、以下コマンド実行 $ java -jar jenkins.war
lubuntu@lubuntu-VirtualBox:~/ダウンロード$ java -jar jenkins.war
Running from: /home/lubuntu/ダウンロード/jenkins.war
webroot: $user.home/.jenkins
8 12, 2017 2:40:15 午後 Main deleteWinstoneTempContents
警告: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
8 12, 2017 2:40:15 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: Logging initialized @3332ms
8 12, 2017 2:40:16 午後 winstone.Logger logInternal
情報: Beginning extraction from war file
8 12, 2017 2:40:30 午後 org.eclipse.jetty.util.log.JavaUtilLog warn
警告: Empty contextPath
8 12, 2017 2:40:30 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: jetty-9.2.z-SNAPSHOT
8 12, 2017 2:40:36 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Jenkins home directory: /home/lubuntu/.jenkins found at: $user.home/.jenkins
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: Started w.@7e38a7fe{/,file:/home/lubuntu/.jenkins/war/,AVAILABLE}{/home/lubuntu/.jenkins/war}
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog warn
警告: FAILED ServerConnector@5778826f{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException: アドレスは既に使用中です
java.net.BindException: アドレスは既に使用中です
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at winstone.Launcher.
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog warn
警告: FAILED org.eclipse.jetty.server.Server@4763c727: java.net.BindException: アドレスは既に使用中です
java.net.BindException: アドレスは既に使用中です
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:321)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:366)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at winstone.Launcher.
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: Stopped ServerConnector@5778826f{HTTP/1.1}{0.0.0.0:8080}
8 12, 2017 2:40:42 午後 hudson.WebAppMain contextDestroyed
情報: Shutting down a Jenkins instance that was still starting up
java.lang.Throwable: reason
at hudson.WebAppMain.contextDestroyed(WebAppMain.java:390)
at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:808)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:457)
at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:842)
at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:215)
at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:529)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:143)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:162)
at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:73)
at org.eclipse.jetty.server.Server.doStop(Server.java:456)
at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
at winstone.Launcher.shutdown(Launcher.java:305)
at winstone.Launcher.
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog info
情報: Stopped w.@7e38a7fe{/,file:/home/lubuntu/.jenkins/war/,UNAVAILABLE}{/home/lubuntu/.jenkins/war}
8 12, 2017 2:40:42 午後 winstone.Logger logInternal
情報: Winstone shutdown successfully
8 12, 2017 2:40:42 午後 winstone.Logger logInternal
重大: Container startup failed
java.io.IOException: Failed to start Jetty
at winstone.Launcher.
8 12, 2017 2:40:43 午後 hudson.util.BootFailure publish
重大: Failed to initialize Jenkins
hudson.util.HudsonFailedToLoad: java.nio.channels.ClosedByInterruptException
at hudson.WebAppMain$3.run(WebAppMain.java:252)
Caused by: java.nio.channels.ClosedByInterruptException
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:216)
at java.nio.channels.Channels.writeFullyImpl(Channels.java:78)
at java.nio.channels.Channels.writeFully(Channels.java:101)
at java.nio.channels.Channels.access$000(Channels.java:61)
at java.nio.channels.Channels$1.write(Channels.java:174)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:316)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233)
at java.io.BufferedWriter.close(BufferedWriter.java:266)
at hudson.util.AtomicFileWriter.close(AtomicFileWriter.java:101)
at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:116)
at hudson.util.TextFile.write(TextFile.java:122)
at jenkins.model.Jenkins.
8 12, 2017 2:40:46 午後 jenkins.model.Jenkins cleanUp 情報: Stopping Jenkins 8 12, 2017 2:40:46 午後 jenkins.model.Jenkins$21 onAttained 情報: Started termination 8 12, 2017 2:40:46 午後 jenkins.model.Jenkins$21 onTaskFailed 重大: Failed IOHubProvider.cleanUp java.lang.IllegalArgumentException: Unable to inject class jenkins.slaves.IOHubProvider at hudson.init.TaskMethodFinder.lookUp(TaskMethodFinder.java:125) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at jenkins.model.Jenkins$20.execute(Jenkins.java:3306) at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:128) at jenkins.model.Jenkins$20.execute(Jenkins.java:3306) at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139) at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:263) at jenkins.model.Jenkins._cleanUpRunTerminators(Jenkins.java:3303) at jenkins.model.Jenkins.cleanUp(Jenkins.java:3225) at hudson.WebAppMain$3.run(WebAppMain.java:256)
8 12, 2017 2:40:46 午後 jenkins.model.Jenkins$21 onTaskFailed 重大: Failed NioChannelSelector.cleanUp java.lang.IllegalArgumentException: Unable to inject class jenkins.slaves.NioChannelSelector at hudson.init.TaskMethodFinder.lookUp(TaskMethodFinder.java:125) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at jenkins.model.Jenkins$20.execute(Jenkins.java:3306) at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:128) at jenkins.model.Jenkins$20.execute(Jenkins.java:3306) at org.jvnet.hudson.reactor.Reactor$Node.runIfPossible(Reactor.java:139) at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:263) at jenkins.model.Jenkins._cleanUpRunTerminators(Jenkins.java:3303) at jenkins.model.Jenkins.cleanUp(Jenkins.java:3225) at hudson.WebAppMain$3.run(WebAppMain.java:256)
8 12, 2017 2:40:46 午後 jenkins.model.Jenkins$21 onAttained 情報: Completed termination 8 12, 2017 2:40:46 午後 jenkins.model.Jenkins _cleanUpDisconnectComputers 情報: Starting node disconnection 8 12, 2017 2:40:46 午後 jenkins.model.Jenkins _cleanUpShutdownTriggers 重大: Failed to shut down triggers java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277) at jenkins.model.Jenkins._cleanUpShutdownTriggers(Jenkins.java:3449) at jenkins.model.Jenkins.cleanUp(Jenkins.java:3237) at hudson.WebAppMain$3.run(WebAppMain.java:256)
8 12, 2017 2:40:46 午後 jenkins.model.Jenkins _cleanUpPersistQueue 情報: Persisting build queue 8 12, 2017 2:40:49 午後 jenkins.model.Jenkins cleanUp 情報: Jenkins stopped Exception in thread "Jenkins initialization thread" java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:3266) at hudson.WebAppMain$3.run(WebAppMain.java:256) Caused by: java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1326) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:277) at jenkins.model.Jenkins._cleanUpShutdownTriggers(Jenkins.java:3449) at jenkins.model.Jenkins.cleanUp(Jenkins.java:3237) ... 1 more
ポートがすでに使われているため、起動できなかった模様 sudo /etc/init.d/tomcat8 stop でtomcatを停止
再度実行 $ java -jar jenkins.war
ブラウザでアクセス Browse to http://localhost:8080 and follow the instructions to complete the installation.
http://localhost:8080 にアクセスし、パスワードを入力
pluginは、"standard"を選択
git関連のpluginのinstallに失敗
エラーはでたが、今回はそのままにする。 "continue"を選択
ユーザアカウントを作成
shellをたたくような簡単なjobを作りたかったが、DocumentationにはいきなりPipelineの説明がかかれており、つまった。
清水です。振り返りですね。
・よい流れですね。特に問題はないと思います。 ・詰まったところはみんなが詰まるところ=貢献できるところになると思いますんで、引き続きその観点で勧めてもらえればと思います。
ドキュメントというのは、開発者の方からするとわかってることではあるんですが、なかなか手がまわらないところだと思うので、貢献度高いと思います。
おっと、間違ってcloseしちゃったのでre-openします。
tomcat で動かす方法のドキュメント https://wiki.jenkins.io/display/JENKINS/Tomcat
lubuntu@lubuntu-VirtualBox:~/ダウンロード$ java -jar jenkins.war --h Running from: /home/lubuntu/ダウンロード/jenkins.war webroot: $user.home/.jenkins 8 12, 2017 4:12:54 午後 Main deleteWinstoneTempContents 警告: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at Main._main(Main.java:293) at Main.main(Main.java:132) Caused by: java.lang.IllegalArgumentException: Unrecognized option: --h at winstone.cmdline.CmdLineParser.parse(CmdLineParser.java:53) at winstone.Launcher.getArgsFromCommandLine(Launcher.java:359) at winstone.Launcher.main(Launcher.java:332) ... 6 more lubuntu@lubuntu-VirtualBox:~/ダウンロード$ java -jar jenkins.war --help Running from: /home/lubuntu/ダウンロード/jenkins.war webroot: $user.home/.jenkins 8 12, 2017 4:13:02 午後 Main deleteWinstoneTempContents 警告: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war Jenkins Continuous Integration Engine 2.60.2 Usage: java -jar jenkins.war [--option=value] [--option=value]
Options: --webroot = folder where the WAR file is expanded into. Default is ${JENKINS_HOME}/war --pluginroot = folder where the plugin archives are expanded into. Default is ${JENKINS_HOME}/plugins (NOTE: this option does not change the directory where the plugin archives are stored) --extractedFilesFolder = folder where extracted files are to be located. Default is the temp folder --daemon = fork into background and run as daemon (Unix only) --logfile = redirect log messages to this file --javaHome = Override the JAVA_HOME variable --toolsJar = The location of tools.jar. Default is JAVA_HOME/lib/tools.jar --config = load configuration properties from here. Default is ./winstone.properties --prefix = add this prefix to all URLs (eg http://localhost:8080/prefix/resource). Default is none --commonLibFolder = folder for additional jar files. Default is ./lib
--logThrowingLineNo = show the line no that logged the message (slow). Default is false --logThrowingThread = show the thread that logged the message. Default is false --debug = set the level of debug msgs (1-9). Default is 5 (INFO level)
--httpPort = set the http listening port. -1 to disable, Default is 8080 --httpListenAddress = set the http listening address. Default is all interfaces --httpKeepAliveTimeout = how long idle HTTP keep-alive connections are kept around (in ms; default 5000)? --httpsPort = set the https listening port. -1 to disable, Default is disabled --httpsListenAddress = set the https listening address. Default is all interfaces --httpsKeepAliveTimeout = how long idle HTTPS keep-alive connections are kept around (in ms; default 5000)? --httpsKeyStore = the location of the SSL KeyStore file. Default is ./winstone.ks --httpsKeyStorePassword = the password for the SSL KeyStore file. Default is null --httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509 --httpsPrivateKey = this switch with --httpsCertificate can be used to run HTTPS with OpenSSL secret key / --httpsCertificate file and the corresponding certificate file --spdy = Enable SPDY. See http://wiki.eclipse.org/Jetty/Feature/NPN --controlPort = set the shutdown/control port. -1 to disable, Default disabled
--handlerCountMax = set the max no of worker threads to allow. Default is 40 --handlerCountMaxIdle = set the max no of idle worker threads to allow. Default is 5
--useJasper = enable jasper JSP handling (true/false). Default is false --sessionTimeout = set the http session timeout value in minutes. Default to what webapp specifies, and then to 60 minutes --mimeTypes=ARG = define additional MIME type mappings. ARG would be EXT=MIMETYPE:EXT=MIMETYPE:... (e.g., xls=application/vnd.ms-excel:wmf=application/x-msmetafile) --maxParamCount=N = set the max number of parameters allowed in a form submission to protect against hash DoS attack (oCERT #2011-003). Default is 10000. --usage / --help = show this message
Security options: --realmClassName = Set the realm class to use for user authentication. Defaults to ArgumentsRealm class
--argumentsRealm.passwd.
--fileRealm.configFile = File containing users/passwds/roles. Only valid for the FileRealm realm class
Access logging: --accessLoggerClassName = Set the access logger class to use for user authentication. Defaults to disabled --simpleAccessLogger.format = The log format to use. Supports combined/common/resin/custom (SimpleAccessLogger only) --simpleAccessLogger.file = The location pattern for the log file(SimpleAccessLogger only)
lubuntu@lubuntu-VirtualBox:~/ダウンロード$
起動時にポートの指定が可能
Guided Tourの手順で、port番号の指定を明示したらどうか?
どうすれば起動できるようになるかを書きたい
https://jenkins.io/doc/ の一番下から、ドキュメントのソースページへジャンプ https://github.com/jenkins-infra/jenkins.io/edit/master/content//doc/index.adoc
変更内容
. Open up a terminal in the download directory and run java -jar jenkins.war
-> java -jar jenkins.war --httpPort=8080
Guided Tourを読んで、
java -jar jenkins.war
で起動したが、ポート番号が既に使用中のエラーが出た8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog warn 警告: FAILED ServerConnector@5778826f{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException: アドレスは既に使用中です java.net.BindException: アドレスは既に使用中です
他のアプリが8080番ポートをbindしていると、jenkinsの起動に失敗する。
Guided Tourの説明でjava -jar jenkins.war --httpPort=8080
のように明示しておくことで、初めて使う人は8080番ポートを事前に解放する必要があると気づくことができると思う。
Guided Tourを読んで、
java -jar jenkins.war
で起動したが、他のアプリが8080番ポートをbindしていたため、jenkinsの起動に失敗した。
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog warn
警告: FAILED ServerConnector@5778826f{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException: アドレスは既に使用中です
java.net.BindException: アドレスは既に使用中です
Guided Tourの説明でjava -jar jenkins.war --httpPort=8080
のように明示しておくことで、ユーザは他の空きポートを使ってjenkinsを起動できるとすぐにわかる。
I follow the instruction in "Guided Tour",
However, java -jar jenkins.war
cause following error, because another application was binding 8080 port.
8 12, 2017 2:40:42 午後 org.eclipse.jetty.util.log.JavaUtilLog warn
警告: FAILED ServerConnector@5778826f{HTTP/1.1}{0.0.0.0:8080}: java.net.BindException: アドレスは既に使用中です
java.net.BindException: アドレスは既に使用中です
If we have --httpPort=8080
explicitly in the instruction, user can quickly reach the solution of using another port.
ラスト振り返りをさせていただいた西谷です. If we have --httpPort=8080 explicitly in the instruction, user can quickly reach the solution of using another port. なんかの解決策まで提案できるのは素晴らしいです.
👍
早速マージされましたね。すごい 😃
ありがとうございます、とても嬉しいです!
お疲れ様でした! closeしますが、引き続きここを使っても大丈夫です! チャットのURLは https://gitter.im/oss-gate/devel です!
This is a work log of a "OSS Gate workshop". "OSS Gate workshop" is an activity to increase OSS developers. Here's been discussed in Japanese. Thanks.
作業ログ作成時の説明
以下のテンプレートを埋めてタイトルに設定します。埋め方例はスクロールすると見えてきます。
タイトル例↓:
OSS Gateワークショップ関連情報