Project

General

Profile

Step 2 - Install and run in 5 minutes » History » Version 40

Henning Blohm, 10.09.2015 15:29

1 22 Henning Blohm
h1. Install and run Z2 in 5 minutes
2 1 Udo Offermann
3 18 Udo Offermann
[[Step_1_-_What_is_z2|« Step 1 - What is z2]]
4 1 Udo Offermann
5
h2. Prerequisites
6
7 40 Henning Blohm
You need a JDK 6 or 7 on Linux, Mac OS X or Windows - that's all. 
8
9
*NOTE:* All versions less than 3 will not run with Java 8. You need to use Java 7 instead!
10 1 Udo Offermann
11 26 Udo Offermann
This how-to uses the "Git":http://git-scm.com/ VCS, which has to be installed on your system (we're using Git version 1.7). You can also run Z2 with SVN as described on [[Step 4 - First steps with Z2 on SVN]].
12 23 Udo Offermann
13 30 Henning Blohm
It is beneficial to use the Eclipse IDE (Ganymed, Helios, Indigo, Kepler work all fine). There's a small Eclipse plug-in called "Eclipsoid" which makes it easier to develop z2 applications within Eclipse (see [[Step 3 - First steps with Z2 on Git]] for more details). However you can use any IDE (including vi and notepad) together with z2.
14 1 Udo Offermann
15 28 Udo Offermann
h2. Creating a _home_ for Z2
16 1 Udo Offermann
17 28 Udo Offermann
This is a best practice approach (and other approaches are possible). We recommend to keep the repositories and the IDE workspace close together. This way we don't need to adjust the path settings in the Z2 configuration files and they can remain relative paths.
18 1 Udo Offermann
19
Create a folder called z2-base inside your favorite/home/development/what-ever directory and enter it:
20
21
<pre>
22 36 Henning Blohm
> mkdir z2-base
23
> cd z2-base
24 1 Udo Offermann
</pre>
25
26 20 Henning Blohm
h2. Cloning the Z2 core
27 1 Udo Offermann
28 19 Udo Offermann
As described in [[Step_1_-_What_is_z2|Step 1 - What is z2]] the z2-base project contains several repositories. 
29 36 Henning Blohm
You always start with the _core_ repository. Create a clone from git.z2-environment.net which will checkout the "master" branch automatically (output and numbers vary of course):
30 1 Udo Offermann
31
<pre>
32 34 Henning Blohm
> git clone http://git.z2-environment.net/z2-base.core
33
Cloning into 'z2-base.core'...
34
remote: Counting objects: 11032, done.
35
remote: Compressing objects: 100% (2402/2402), done.
36
remote: Total 11032 (delta 7705), reused 10733 (delta 7602)
37
Receiving objects: 100% (11032/11032), 18.04 MiB | 222.00 KiB/s, done.
38
Resolving deltas: 100% (7705/7705), done.
39
Checking connectivity... done
40 29 Udo Offermann
41 34 Henning Blohm
> cd z2-base.core
42
> git branch
43 1 Udo Offermann
* master
44
</pre>
45 30 Henning Blohm
46
That's all you need to do in order to install the z2-Environment and you can start the server right away. Before starting, make sure that you have a working Java installation. To test, type
47
48
<pre>
49
java -version
50
</pre>
51
52 1 Udo Offermann
on a command line. This should output some information on your Java Development Kit of version 1.6 or higher. 
53 21 Henning Blohm
54 1 Udo Offermann
h2. Starting the z2-Environment
55 10 Udo Offermann
56 1 Udo Offermann
The start scripts are located inside @run/bin@ and are called _go.sh_ on Unix based systems like Linux and Mac OS and _go.bat_ on Windows. There's also a gui-based version that we will discover later. 
57
58
<pre>
59 36 Henning Blohm
> cd run/bin
60
> ./go.sh
61
62 38 Henning Blohm
03/08 20:30:29 [1]...hers.HomeLauncher [800]: Z2 Home Launcher, (c) 2010-2013 ZFabrik Software KG
63
03/08 20:30:30 [1]...ProcessRunnerImpl [800]: Running core build 201310071127 as hb in z2 home /home/hb/copy/install/z2-base.core, timezone Europe/Berlin, language en, region null
64
03/08 20:30:30 [1]...ProcessRunnerImpl [800]: Using VM v1.7.0_09 by Oracle Corporation at /usr/lib/jvm/jdk1.7.0_09/jre on Linux (arch: 3.11.0-17-generic)
65
03/08 20:30:30 [1]...ProcessRunnerImpl [800]: ************************************
66
03/08 20:30:30 [1]...ProcessRunnerImpl [800]: *** Running in DEVELOPMENT mode! ***
67
03/08 20:30:30 [1]...ProcessRunnerImpl [800]: ************************************
68
03/08 20:30:30 [1]...entRepositoryImpl [800]: Using GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true
69
03/08 20:30:30 [1]...entRepositoryImpl [800]: Cloning GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true. This will take some seconds...
70
03/08 20:31:58 [1]...entRepositoryImpl [800]: Created working-clone within 88266 msec for GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true
71
03/08 20:31:58 [1]...devcr.DevRepoImpl [800]: Dev Repository: Registered component:com.zfabrik.dev.repo/devRepo,repo:7ea65360,prio:750, workspaces (1): [/home/hb/copy/install]
72
03/08 20:31:58 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/bootrepo_up
73
03/08 20:31:58 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/sysrepo_up
74
03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/process_up
75
03/08 20:32:01 [18]...ent/webWorker@0.1 [800]: Listening for transport dt_socket at address: 5100
76
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...ProcessRunnerImpl [800]: Running core build 201310071127 as hb in z2 home /home/hb/copy/install/z2-base.core, timezone , language en, region null
77
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...ProcessRunnerImpl [800]: Using VM v1.7.0_09 by Oracle Corporation at /usr/lib/jvm/jdk1.7.0_09/jre on Linux (arch: 3.11.0-17-generic)
78
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...devcr.DevRepoImpl [800]: Dev Repository: Registered component:com.zfabrik.dev.repo/devRepo,repo:7ea65360,prio:750, workspaces (1): [/home/hb/copy/install]
79
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/bootrepo_up
80
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/sysrepo_up
81
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/process_up
82
03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/worker_up
83
03/08 20:32:02 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:02 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.z2unit/web
84
03/08 20:32:02 [18]...ent/webWorker@0.1 [800]: INFO  org.eclipse.jetty.server.Server  - jetty-8.1.11.v20130520
85
03/08 20:32:02 [18]...ent/webWorker@0.1 [800]: INFO  org.eclipse.jetty.server.AbstractConnector  - Started SelectChannelConnector@0.0.0.0:8080
86
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/z2unit): com.zfabrik.dev.z2unit/web
87
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.eclipsoid.srv/web
88
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/eclipsoid): com.zfabrik.dev.eclipsoid.srv/web
89
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.samples.calculator/web
90
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/calc): com.zfabrik.samples.calculator/web
91
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.javadoc/web
92
03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/javadoc): com.zfabrik.dev.javadoc/web
93
03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.admin/web
94
03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...pp.WebAppResource [800]: Done starting Web App (/adm): com.zfabrik.admin/web
95
03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...stemStateResource [800]: Attained system state: environment/webWorkerUp
96
03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...worker.WorkerSoul [800]: Completed worker process initialization
97
03/08 20:32:04 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/home_up
98
03/08 20:32:04 [1]...hers.HomeLauncher [800]: Completed home process initialization
99 13 Udo Offermann
100 1 Udo Offermann
press (q)uit, (c)omponents, (f)oundation props, (s)ystem props, s(y)nc repo, (v)erify, (g)c:>
101 10 Udo Offermann
102 3 Udo Offermann
</pre>
103 31 Henning Blohm
104 35 Henning Blohm
*Note:* On first startup the runtime needs to clone (and so download) its base repository ("z2-base.base":https://redmine.z2-environment.net/projects/z2-base/repository/base). Dependending on your network bandwidth this may require anything between a few seconds to some minutes. Subsequent startups will not require this step again. 
105 33 Henning Blohm
106 1 Udo Offermann
When you see the prompt above, the z2-Environment is up and running and excepting requests on localhost port 8080. To verify, open the administration page at http://localhost:8080/adm. Use username *z** ("z" followed by an asterisk) and password *z*.
107 33 Henning Blohm
108 20 Henning Blohm
Essentially the same procedure is used to install the z2-Environment in production. From a system installation point of view, checking out a core distribution as we just did is all that needs to be done.
109 33 Henning Blohm
110
On the next page we will do some first development step with z2 in combination with the Eclipse IDE. 
111
112 1 Udo Offermann
As it is handy to run the z2 server from inside Eclipse, so you should stop the running server now by pressing 'q'.
113 27 Udo Offermann
114 39 Henning Blohm
* [[Step 3 - First steps with Z2 on Git|&raquo; Step 3 - First steps with Z2 on Git]]
115
* [[Step 3 - First steps with Z2 on SVN|&raquo; Step 3 - First steps with Z2 on SVN]]