Skip to content

Commit c6e46dc

Browse files
Haaroleangitbook-bot
authored andcommitted
GITBOOK-22: Update prerequisites
1 parent 5891e01 commit c6e46dc

File tree

1 file changed

+117
-14
lines changed

1 file changed

+117
-14
lines changed

development/building/prerequisites.md

Lines changed: 117 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,146 @@
11
# Prerequisites
22

3-
This page explains how to get the software you need to use a Linux or macOS machine for local development.
3+
### Prerequisites
44

5-
Before you begin contributing you must have:
5+
This page explains how to get the software you need to use on Linux or macOS for local development.
66

7-
* A GitHub account
8-
* `Java` 17 or newer
9-
* `Git`
10-
* `Docker`
7+
* `java 17` package or newer
8+
* `git` installed
9+
* `docker` installed
1110

12-
#### Installing prerequisites on macOS
11+
> Note: For contribution, you must have a `github` account.
12+
13+
#### For Linux
14+
15+
1. Install `OpenJDK 17` package or newer:
16+
17+
```
18+
sudo apt update
19+
sudo apt install openjdk-17-jdk
20+
```
21+
22+
* Check java version using the command `java -version`.
23+
24+
```
25+
openjdk version "17.0.5" 2022-10-18
26+
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu120.04)
27+
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu120.04, mixed mode, sharing)
28+
```
29+
30+
Note: In case OpenJDK 17 is not set as your default Java, run `sudo update-alternatives --config java` command to list all installed Java versions.
31+
32+
```
33+
Selection Path Priority Status
34+
------------------------------------------------------------
35+
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
36+
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
37+
2 /usr/lib/jvm/java-16-openjdk-amd64/bin/java 1051 manual mode
38+
3 /usr/lib/jvm/java-17-openjdk-amd64/bin/java 1001 manual mode
39+
40+
Press <enter> to keep the current choice[*], or type selection number:
41+
```
42+
43+
you can set it as the default by entering the selection number for it in the list and pressing Enter. For example, to set Java 17 as the default, you would enter "3" and press **Enter**.
44+
45+
2. Install `git`:
46+
47+
```
48+
sudo apt install git
49+
```
50+
51+
3. Install `docker`:
52+
53+
```
54+
sudo apt update
55+
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
56+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
57+
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
58+
apt-cache policy docker-ce
59+
sudo apt -y install docker-ce
60+
```
61+
62+
To execute the `docker` Command without `sudo`:
63+
64+
```
65+
sudo usermod -aG docker ${USER}
66+
su - ${USER}
67+
sudo chmod 666 /var/run/docker.sock
68+
```
69+
70+
#### For macOS
1371

1472
1. Install [brew](https://brew.sh/).
1573
2. Install brew cask:
1674

17-
```
75+
```sh
1876
brew cask
1977
```
2078

21-
1. Install Eclipse Temurin 17 via Homebrew cask:
79+
3. Install Eclipse Temurin 17 via Homebrew cask:
2280

23-
```
81+
```sh
2482
brew tap homebrew/cask-versions
2583
brew install temurin17
2684
```
2785

28-
1. Verify Installation
86+
4. Verify Installation
2987

30-
```
88+
```sh
3189
java -version
3290
```
3391

34-
Note : In case OpenJDK 17 is not set as your default Java, you can consider to include it in your `$PATH` after installation
92+
Note: In case OpenJDK 17 is not set as your default Java, you can consider including it in your `$PATH` after installation
3593

36-
```
94+
```sh
3795
export PATH="$(/usr/libexec/java_home -v 17)/bin:$PATH"
3896
export JAVA_HOME="$(/usr/libexec/java_home -v 17)"
3997
```
4098

4199
### Tips
42100

43101
Consider allocating not less than 4GB of memory for your docker. Otherwise, some apps within a stack (e.g. `kafka-ui.yaml`) might crash.
102+
103+
To check how much memory is allocated to docker, use `docker info`.
104+
105+
You will find the total memory and used memory in the output. if you won't find used memory that means memory limits are not set for containers.
106+
107+
**To allocate 4GB of memory for Docker:**
108+
109+
**MacOS**
110+
111+
Edit docker daemon settings within docker dashboard
112+
113+
**For Ubuntu**
114+
115+
1. Open the Docker configuration file in a text editor using the following command:
116+
117+
```
118+
sudo nano /etc/default/docker
119+
```
120+
121+
2. Add the following line to the file to allocate 4GB of memory to Docker:
122+
123+
```
124+
DOCKER_OPTS="--default-ulimit memlock=-1:-1 --memory=4g --memory-swap=-1"
125+
```
126+
127+
3. Save the file and exit the text editor.
128+
4. Restart the Docker service using the following command:
129+
130+
```
131+
sudo service docker restart
132+
```
133+
134+
5. Verify that the memory limit has been set correctly by running the following command:
135+
136+
```
137+
docker info | grep -i memory
138+
```
139+
140+
Note that the warning messages are expected as they relate to the kernel not supporting cgroup memory limits.
141+
142+
Now any containers you run in docker will be limited to this amount of memory. You can also increase the memory limit as per your preference.
143+
144+
### Where to go next
145+
146+
In the next section, you'll learn how to Build and Run kafka-ui.

0 commit comments

Comments
 (0)