├── .gitignore
├── LICENSE
├── README.md
├── ansible.cfg
├── base-ubuntu-2004
└── files
│ ├── etc
│ ├── apt
│ │ ├── sources.list.mirror-aarch64
│ │ └── sources.list.mirror-x86_64
│ ├── ssh
│ │ └── sshd_config
│ ├── supervisor
│ │ └── conf.d
│ │ │ └── sshd.conf
│ └── supervisord.conf
│ ├── opt
│ └── dev
│ │ └── site-override.xslt
│ ├── root
│ └── .ssh
│ │ ├── authorized_keys
│ │ └── id_rsa_hadoop_testing.pub
│ └── usr
│ ├── local
│ └── bin
│ │ ├── apply-all-site-xml-overrides
│ │ ├── apply-site-xml-override
│ │ ├── create-service-ready-mark
│ │ ├── remove-service-ready-mark
│ │ ├── wait-port-ready
│ │ └── wait-service-ready-mark
│ └── sbin
│ └── install_packages
├── build.yaml
├── dev
└── checkout_pr.sh
├── docs
└── imgs
│ ├── deployment_architecture.excalidraw
│ ├── deployment_architecture.png
│ ├── namenode-ui.png
│ ├── switchy-omega-1.png
│ ├── switchy-omega-2.png
│ └── switchy-omega-3.png
├── download
└── .gitkeep
├── files
├── etc
│ ├── grafana
│ │ └── provisioning
│ │ │ ├── dashboards
│ │ │ └── default.yaml
│ │ │ └── datasources
│ │ │ ├── loki.yaml
│ │ │ └── prometheus.yaml
│ ├── loki
│ │ └── config.yaml
│ └── prometheus
│ │ └── prometheus.yml
└── var
│ └── lib
│ └── grafana
│ └── dashboards
│ ├── kyuubi.json
│ └── zookeeper_10465_rev4.json
├── host_vars
└── local.yaml
├── hosts
├── kdc
├── Dockerfile
├── README.md
└── files
│ ├── etc
│ ├── krb5.conf
│ ├── krb5kdc
│ │ ├── kadm5-other.acl
│ │ ├── kadm5.acl
│ │ └── kdc.conf
│ ├── supervisord.conf
│ └── supervisord.d
│ │ └── kdc.conf
│ ├── opt
│ ├── entrypoint.sh
│ └── service-ready.d
│ │ ├── 001-wait-kdc-ready.sh
│ │ ├── 002-create-service-principals.sh
│ │ └── 003-create-kdc-ready-mark.sh
│ └── usr
│ └── local
│ └── bin
│ └── create_principal
├── mysql
├── Dockerfile
└── files
│ └── docker-entrypoint-initdb.d
│ ├── hive-schema-2.3.0.mysql.sql
│ ├── hive-txn-schema-2.3.0.mysql.sql
│ ├── kyuubi-schema-1.8.0.mysql.sql
│ └── ranger-database-init.mysql.sql
├── node-template.yaml
├── requirements.txt
├── templates
├── .env.j2
├── base-ubuntu-2004
│ └── Dockerfile.j2
├── build-image.sh.j2
├── compose.yaml.j2
├── download.sh.j2
├── hadoop-common
│ └── files
│ │ ├── etc
│ │ ├── hadoop
│ │ │ └── conf
│ │ │ │ ├── capacity-scheduler.xml
│ │ │ │ ├── container-executor.cfg
│ │ │ │ ├── core-site.xml.j2
│ │ │ │ ├── hadoop-env.sh.j2
│ │ │ │ ├── hdfs-site.xml.j2
│ │ │ │ ├── log4j.properties
│ │ │ │ ├── mapred-site.xml.j2
│ │ │ │ └── yarn-site.xml.j2
│ │ ├── krb5.conf
│ │ ├── supervisor
│ │ │ └── conf.d
│ │ │ │ └── trino-server.conf
│ │ └── trino
│ │ │ └── conf
│ │ │ ├── config.properties
│ │ │ ├── jvm.config
│ │ │ ├── log.properties
│ │ │ └── node.properties
│ │ └── opt
│ │ ├── hadoop-init.d
│ │ └── init-hdfs.sh
│ │ └── trino-init.d
│ │ └── init-workdir.sh
├── hadoop-master
│ ├── Dockerfile.j2
│ └── files
│ │ ├── etc
│ │ ├── flink
│ │ │ ├── conf
│ │ │ │ ├── flink-conf.yaml
│ │ │ │ ├── log4j-cli.properties
│ │ │ │ ├── log4j-console.properties
│ │ │ │ ├── log4j-session.properties
│ │ │ │ └── log4j.properties
│ │ │ └── conf_history_server
│ │ │ │ ├── flink-conf.yaml
│ │ │ │ └── log4j-console.properties
│ │ ├── hive
│ │ │ └── conf
│ │ │ │ ├── beeline-site.xml.j2
│ │ │ │ ├── hive-env.sh
│ │ │ │ ├── hive-log4j2.properties
│ │ │ │ └── hive-site.xml.j2
│ │ ├── kyuubi
│ │ │ └── conf
│ │ │ │ ├── kyuubi-defaults.conf.j2
│ │ │ │ ├── kyuubi-env.sh
│ │ │ │ └── log4j2.xml.j2
│ │ ├── ranger
│ │ │ ├── conf
│ │ │ │ └── install.properties
│ │ │ └── startup.sh
│ │ ├── spark
│ │ │ └── conf
│ │ │ │ ├── log4j2.xml.j2
│ │ │ │ ├── spark-defaults.conf.j2
│ │ │ │ └── spark-env.sh
│ │ ├── supervisor
│ │ │ └── conf.d
│ │ │ │ ├── flink-history-server.conf
│ │ │ │ ├── hdfs-namenode.conf
│ │ │ │ ├── hive-metastore.conf
│ │ │ │ ├── hive-server2.conf
│ │ │ │ ├── kyuubi-server.conf
│ │ │ │ ├── mapred-history-server.conf
│ │ │ │ ├── ranger-admin.conf
│ │ │ │ ├── spark-history-server.conf
│ │ │ │ ├── yarn-resourcemanager.conf
│ │ │ │ ├── zeppelin-server.conf
│ │ │ │ └── zookeeper.conf
│ │ ├── zeppelin
│ │ │ └── conf
│ │ │ │ ├── configuration.xsl
│ │ │ │ ├── interpreter-list.j2
│ │ │ │ ├── interpreter.json.j2
│ │ │ │ ├── log4j.properties
│ │ │ │ ├── log4j2.properties
│ │ │ │ ├── log4j_yarn_cluster.properties
│ │ │ │ ├── shiro.ini.template
│ │ │ │ ├── zeppelin-env.sh
│ │ │ │ └── zeppelin-site.xml
│ │ └── zookeeper
│ │ │ └── conf
│ │ │ ├── zoo.cfg
│ │ │ └── zookeeper-env.sh
│ │ ├── opt
│ │ ├── entrypoint.sh
│ │ ├── hadoop-init.d
│ │ │ └── init-hdfs.sh
│ │ ├── parquet
│ │ │ └── bin
│ │ │ │ └── parquet
│ │ ├── service-ready.d
│ │ │ ├── 001-wait-hdfs-ready.sh
│ │ │ ├── 002-create-hdfs-dirs.sh.j2
│ │ │ ├── 003-create-hdfs-ready-mark.sh
│ │ │ └── 004-kinit-spark.sh
│ │ ├── start-hive-server2.sh
│ │ ├── start-namenode.sh.j2
│ │ ├── start-resourcemanager.sh
│ │ └── start-spark-history-server.sh
│ │ └── root
│ │ ├── .ssh
│ │ ├── config
│ │ └── id_rsa_hadoop_testing
│ │ ├── HELP.j2
│ │ └── kyuubi-batch-spark-pi.yaml
└── hadoop-worker
│ ├── Dockerfile.j2
│ └── files
│ └── etc
│ └── supervisor
│ └── conf.d
│ ├── hdfs-datanode.conf.j2
│ └── yarn-nodemanager.conf
└── test-ssh.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.ipr
3 | *.iws
4 | *.log
5 | .DS_Store
6 | .idea
7 | .python-version
8 | base-ubuntu-2004/Dockerfile
9 | depends
10 | download/
11 | flags
12 | graphviz
13 | dependency_graph.svg
14 | *.swp
15 | build/tmp
16 | .env
17 | build-image.sh
18 | download.sh
19 | compose.yaml
20 | hadoop-master1/
21 | hadoop-worker1/
22 | hadoop-worker2/
23 | hadoop-worker3/
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/ansible.cfg:
--------------------------------------------------------------------------------
1 | [defaults]
2 | inventory=hosts
3 | module_name=shell
4 | gathering=explicit
5 | host_key_checking=False
6 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/etc/apt/sources.list.mirror-aarch64:
--------------------------------------------------------------------------------
1 | deb http://mirrors.cloud.tencent.com/ubuntu-ports/ focal main restricted universe multiverse
2 | # deb-src http://mirrors.cloud.tencent.com/ubuntu-ports/ focal main restricted universe multiverse
3 |
4 | deb http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-security main restricted universe multiverse
5 | # deb-src http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-security main restricted universe multiverse
6 |
7 | deb http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-updates main restricted universe multiverse
8 | # deb-src http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-updates main restricted universe multiverse
9 |
10 | # deb http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-proposed main restricted universe multiverse
11 | # deb-src http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-proposed main restricted universe multiverse
12 |
13 | deb http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-backports main restricted universe multiverse
14 | # deb-src http://mirrors.cloud.tencent.com/ubuntu-ports/ focal-backports main restricted universe multiverse
15 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/etc/apt/sources.list.mirror-x86_64:
--------------------------------------------------------------------------------
1 | deb http://mirrors.cloud.tencent.com/ubuntu/ focal main restricted universe multiverse
2 | # deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal main restricted universe multiverse
3 |
4 | deb http://mirrors.cloud.tencent.com/ubuntu/ focal-security main restricted universe multiverse
5 | # deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-security main restricted universe multiverse
6 |
7 | deb http://mirrors.cloud.tencent.com/ubuntu/ focal-updates main restricted universe multiverse
8 | # deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-updates main restricted universe multiverse
9 |
10 | # deb http://mirrors.cloud.tencent.com/ubuntu/ focal-proposed main restricted universe multiverse
11 | # deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-proposed main restricted universe multiverse
12 |
13 | deb http://mirrors.cloud.tencent.com/ubuntu/ focal-backports main restricted universe multiverse
14 | # deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-backports main restricted universe multiverse
15 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/etc/ssh/sshd_config:
--------------------------------------------------------------------------------
1 | Include /etc/ssh/sshd_config.d/*.conf
2 |
3 | # Change to yes to enable challenge-response passwords (beware issues with
4 | # some PAM modules and threads)
5 | KbdInteractiveAuthentication no
6 |
7 | # Set this to 'yes' to enable PAM authentication, account processing,
8 | # and session processing. If this is enabled, PAM authentication will
9 | # be allowed through the KbdInteractiveAuthentication and
10 | # PasswordAuthentication. Depending on your PAM configuration,
11 | # PAM authentication via KbdInteractiveAuthentication may bypass
12 | # the setting of "PermitRootLogin without-password".
13 | # If you just want the PAM account and session checks to run without
14 | # PAM authentication, then enable this but set PasswordAuthentication
15 | # and KbdInteractiveAuthentication to 'no'.
16 | UsePAM yes
17 |
18 | X11Forwarding yes
19 | PrintMotd no
20 |
21 | # Allow client to pass locale environment variables
22 | AcceptEnv LANG LC_*
23 |
24 | # override default of no subsystems
25 | Subsystem sftp /usr/lib/openssh/sftp-server
26 |
27 | RSAAuthentication yes
28 | PubkeyAuthentication yes
29 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/etc/supervisor/conf.d/sshd.conf:
--------------------------------------------------------------------------------
1 | [program:sshd]
2 | directory=/usr/sbin
3 | command=/usr/sbin/sshd -D
4 | startsecs=30
5 | stopwaitsecs=10
6 | redirect_stderr=true
7 | stdout_logfile=/var/log/sshd.log
8 | autostart=true
9 | autorestart=true
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/etc/supervisord.conf:
--------------------------------------------------------------------------------
1 | [supervisord]
2 | logfile=/var/log/supervisord.log
3 | logfile_maxbytes = 50MB
4 | logfile_backups=10
5 | loglevel=info
6 | pidfile=/var/run/supervisord.pid
7 | nodaemon=true
8 | directory=/tmp
9 | strip_ansi=false
10 |
11 | [unix_http_server]
12 | file=/var/run/supervisor.sock
13 | chmod=0777
14 |
15 | [rpcinterface:supervisor]
16 | supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
17 |
18 | [supervisorctl]
19 | serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
20 |
21 | ; The [include] section can just contain the "files" setting. This
22 | ; setting can list multiple files (separated by whitespace or
23 | ; newlines). It can also contain wildcards. The filenames are
24 | ; interpreted as relative to this file. Included files *cannot*
25 | ; include files themselves.
26 |
27 | [include]
28 | files=/etc/supervisor/conf.d/*.conf
29 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/opt/dev/site-override.xslt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/root/.ssh/authorized_keys:
--------------------------------------------------------------------------------
1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAv6UOSS3R77Rq7VLO2U3s2YS1j5jDjTGNIwLqvsV0gJRA72JQjGdGilWyRZXi9oaFMmIpjUS2VdNCMveQ9pVaySIFnfbBNINpDqTDgKpqQadLijmQwSn6Rc8U2+Wetca26hufuH0qSMY61EkK0zqy1xzzWbyCOaOR1WioSvNDlJrv867661ZvctNVL4gG7JChktmCktb3lA3F1APgRsm+zhJSJeaV0WUnWMIS5eHTye0IRAeZUGrnNsF5gb5XLATTD8bVZY5B8Tn4LQHgkXah+sJZnGcrxuvmJSfQbHNmxCzXpRhXWwUkd2eIzszo2Lqi+AeM2BkVyfR+Ygm7bQXq8Q+dqioYM4Z6tY6cgyhDkq1eiWWSAGxF+UTIIUN0o8Wkm/mNzML3BhfBhyMmRcAX3zZyAkFUuijQ/BJRJ7Wl+D50y3O0Hnrq9qwghWTD3m8evRgH8+L9EFndIH1RnYoRyLA57LwoXKpzKV+1J6stQJXwQOaWp8kgplMz8mGsflk= root@hadoop-testing
2 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/root/.ssh/id_rsa_hadoop_testing.pub:
--------------------------------------------------------------------------------
1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDAv6UOSS3R77Rq7VLO2U3s2YS1j5jDjTGNIwLqvsV0gJRA72JQjGdGilWyRZXi9oaFMmIpjUS2VdNCMveQ9pVaySIFnfbBNINpDqTDgKpqQadLijmQwSn6Rc8U2+Wetca26hufuH0qSMY61EkK0zqy1xzzWbyCOaOR1WioSvNDlJrv867661ZvctNVL4gG7JChktmCktb3lA3F1APgRsm+zhJSJeaV0WUnWMIS5eHTye0IRAeZUGrnNsF5gb5XLATTD8bVZY5B8Tn4LQHgkXah+sJZnGcrxuvmJSfQbHNmxCzXpRhXWwUkd2eIzszo2Lqi+AeM2BkVyfR+Ygm7bQXq8Q+dqioYM4Z6tY6cgyhDkq1eiWWSAGxF+UTIIUN0o8Wkm/mNzML3BhfBhyMmRcAX3zZyAkFUuijQ/BJRJ7Wl+D50y3O0Hnrq9qwghWTD3m8evRgH8+L9EFndIH1RnYoRyLA57LwoXKpzKV+1J6stQJXwQOaWp8kgplMz8mGsflk= root@hadoop-testing
2 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/apply-all-site-xml-overrides:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | fail() {
6 | echo "$(basename "$0"): $*" >&2
7 | exit 1
8 | }
9 |
10 | if [ $# -ne 1 ]; then
11 | fail "Usage: $0 " >&2
12 | fi
13 |
14 | overrides_dir="$1"
15 |
16 | for file in $(find $overrides_dir -name '*.xml'); do
17 | target_filename="${file#"$overrides_dir"}"
18 | echo "Applying configuration override from $file to $target_filename"
19 | apply-site-xml-override "$target_filename" "$file"
20 | done
21 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/apply-site-xml-override:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | fail() {
6 | echo "$(basename "$0"): $*" >&2
7 | exit 1
8 | }
9 |
10 | if [ $# -ne 2 ]; then
11 | fail "Usage: $0 " >&2
12 | fi
13 |
14 | site_xml="$1"
15 | overrides="$2"
16 | site_xml_new="$1.new"
17 |
18 | test -f "${site_xml}" || fail "${site_xml} does not exist or is not a file"
19 | test -f "${overrides}" || fail "${overrides} does not exist or is not a file"
20 | test ! -e "${site_xml_new}" || fail "${site_xml_new} already exists"
21 |
22 | xsltproc --param override-path "'${overrides}'" "/opt/dev/site-override.xslt" "${site_xml}" > "${site_xml_new}"
23 | cat "${site_xml_new}" > "${site_xml}" # Preserve file owner & permissions
24 | rm "${site_xml_new}"
25 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/create-service-ready-mark:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | dir=/share/marks/ready.d/
4 |
5 | set -euo pipefail
6 |
7 | function usage() {
8 | echo "Usage: $0 [-d ] -s " >&2
9 | exit 1
10 | }
11 |
12 | while getopts "d:s:" o; do
13 | case "${o}" in
14 | d)
15 | dir="$OPTARG"
16 | ;;
17 | s)
18 | service="$OPTARG"
19 | ;;
20 | *)
21 | esac
22 | done
23 |
24 | if [[ ! -v service ]]; then
25 | usage
26 | fi
27 |
28 | mkdir -p $dir
29 | touch $dir/$service
30 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/remove-service-ready-mark:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | dir=/share/marks/ready.d/
4 |
5 | set -euo pipefail
6 |
7 | function usage() {
8 | echo "Usage: $0 [-d ] -s " >&2
9 | exit 1
10 | }
11 |
12 | while getopts "d:s:" o; do
13 | case "${o}" in
14 | d)
15 | dir="$OPTARG"
16 | ;;
17 | s)
18 | service="$OPTARG"
19 | ;;
20 | *)
21 | esac
22 | done
23 |
24 | if [[ ! -v service ]]; then
25 | usage
26 | fi
27 |
28 | rm -f $dir/$service
29 |
30 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/wait-port-ready:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | timeout=60
4 | interval=1
5 |
6 | set -euo pipefail
7 |
8 | function usage() {
9 | echo "Usage: $0 [-t ] [-i ] -p " >&2
10 | exit 1
11 | }
12 |
13 | while getopts "t:i:p:" o; do
14 | case "${o}" in
15 | t)
16 | timeout="$OPTARG"
17 | ;;
18 | i)
19 | interval="$OPTARG"
20 | ;;
21 | p)
22 | port="$OPTARG"
23 | ;;
24 | *)
25 | esac
26 | done
27 |
28 | if [[ ! -v port ]]; then
29 | usage
30 | fi
31 |
32 | end_time=$((SECONDS + timeout))
33 |
34 | while [ $SECONDS -lt $end_time ]; do
35 | if /opt/busybox/nc $(hostname) $port -e true; then
36 | echo "Port $port is now available"
37 | break
38 | else
39 | echo "Port $port is not available, retrying in $interval seconds..."
40 | sleep $interval
41 | fi
42 | done
43 |
44 | if [ $SECONDS -ge $end_time ]; then
45 | echo "Timeout reached. Port $port is still not available."
46 | exit 1
47 | fi
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/local/bin/wait-service-ready-mark:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | timeout=60
4 | interval=1
5 | dir=/share/marks/ready.d/
6 |
7 | set -euo pipefail
8 |
9 | function usage() {
10 | echo "Usage: $0 [-t ] [-i ] [-d ] -s " >&2
11 | exit 1
12 | }
13 |
14 | while getopts "t:i:d:s:" o; do
15 | case "${o}" in
16 | t)
17 | timeout="$OPTARG"
18 | ;;
19 | i)
20 | interval="$OPTARG"
21 | ;;
22 | d)
23 | dir="$OPTARG"
24 | ;;
25 | s)
26 | service="$OPTARG"
27 | ;;
28 | *)
29 | esac
30 | done
31 |
32 | if [[ ! -v service ]]; then
33 | usage
34 | fi
35 |
36 | end_time=$((SECONDS + timeout))
37 |
38 | while [ $SECONDS -lt $end_time ]; do
39 | if [[ -f $dir/$service ]]; then
40 | echo "Service $service is now ready"
41 | break
42 | else
43 | echo "Service $service is not ready, retrying in $interval seconds..."
44 | sleep $interval
45 | fi
46 | done
47 |
48 | if [ $SECONDS -ge $end_time ]; then
49 | echo "Timeout reached. Service $service is still not ready."
50 | exit 1
51 | fi
52 |
--------------------------------------------------------------------------------
/base-ubuntu-2004/files/usr/sbin/install_packages:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | export DEBIAN_FRONTEND=noninteractive
5 | n=0
6 | max=2
7 | until [ $n -gt $max ]; do
8 | set +e
9 | (
10 | apt-get update -qq &&
11 | apt-get install -y --no-install-recommends "$@"
12 | )
13 | CODE=$?
14 | set -e
15 | if [ $CODE -eq 0 ]; then
16 | break
17 | fi
18 | if [ $n -eq $max ]; then
19 | exit $CODE
20 | fi
21 | echo "apt failed, retrying"
22 | n=$(($n + 1))
23 | done
24 | rm -r /var/lib/apt/lists /var/cache/apt/archives
25 |
--------------------------------------------------------------------------------
/build.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: compile template files
3 |
4 | hosts: local
5 |
6 | tasks:
7 | - name: orchestrate basic files
8 | ansible.builtin.template:
9 | src: templates/{{ item.file }}.j2
10 | dest: "{{ playbook_dir }}/{{ item.file }}"
11 | mode: "{{ item.mode }}"
12 | with_items:
13 | - { file: ".env", mode: "a+x" }
14 | - { file: "build-image.sh", mode: "a+x" }
15 | - { file: "download.sh", mode: "a+x" }
16 | - { file: "base-ubuntu-2004/Dockerfile", mode: ~ }
17 |
18 | - include_tasks: node-template.yaml
19 | loop:
20 | - name: "hadoop-master1"
21 | group: "hadoop-master"
22 | - name: "hadoop-worker1"
23 | group: "hadoop-worker"
24 | - name: "hadoop-worker2"
25 | group: "hadoop-worker"
26 | - name: "hadoop-worker3"
27 | group: "hadoop-worker"
28 | loop_control:
29 | loop_var: node
30 |
31 | - name: orchestrate compose file
32 | ansible.builtin.template:
33 | src: templates/compose.yaml.j2
34 | dest: "{{ playbook_dir }}/compose.yaml"
35 |
--------------------------------------------------------------------------------
/dev/checkout_pr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Licensed to the Apache Software Foundation (ASF) under one or more
4 | # contributor license agreements. See the NOTICE file distributed with
5 | # this work for additional information regarding copyright ownership.
6 | # The ASF licenses this file to You under the Apache License, Version 2.0
7 | # (the "License"); you may not use this file except in compliance with
8 | # the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | set -o pipefail
20 | set -e
21 | set -x
22 |
23 | function usage {
24 | echo "Usage: $(basename "${0}") [-f] " 2>&1
25 | echo ' -f force overwrite of local branch (default: fail if exists)'
26 | exit 1
27 | }
28 |
29 | if [[ ${#} -eq 0 ]]; then
30 | usage
31 | fi
32 |
33 | FORCE=""
34 | while getopts ":f" arg; do
35 | case "${arg}" in
36 | f)
37 | FORCE="--force"
38 | ;;
39 | ?)
40 | usage
41 | ;;
42 | esac
43 | done
44 | shift "$(($OPTIND -1))"
45 |
46 | PR_NUM=$1
47 |
48 | git fetch upstream pull/${PR_NUM}/head:PR_${PR_NUM} ${FORCE}
49 | git checkout PR_${PR_NUM}
50 |
--------------------------------------------------------------------------------
/docs/imgs/deployment_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/docs/imgs/deployment_architecture.png
--------------------------------------------------------------------------------
/docs/imgs/namenode-ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/docs/imgs/namenode-ui.png
--------------------------------------------------------------------------------
/docs/imgs/switchy-omega-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/docs/imgs/switchy-omega-1.png
--------------------------------------------------------------------------------
/docs/imgs/switchy-omega-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/docs/imgs/switchy-omega-2.png
--------------------------------------------------------------------------------
/docs/imgs/switchy-omega-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/docs/imgs/switchy-omega-3.png
--------------------------------------------------------------------------------
/download/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesome-kyuubi/hadoop-testing/e35aa5c439064898fd4fcba3abeccdb2f623b97e/download/.gitkeep
--------------------------------------------------------------------------------
/files/etc/grafana/provisioning/dashboards/default.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: 1
2 |
3 | providers:
4 | - name: Default # A uniquely identifiable name for the provider
5 | folder: ~ # The folder where to place the dashboards
6 | type: file
7 | options:
8 | path: /var/lib/grafana/dashboards
9 |
--------------------------------------------------------------------------------
/files/etc/grafana/provisioning/datasources/loki.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: 1
2 |
3 | datasources:
4 | - name: Loki
5 | type: loki
6 | access: proxy
7 | orgId: 1
8 | url: http://loki:3100
9 | basicAuth: false
10 | isDefault: false
11 | version: 1
12 | editable: false
13 | jsonData:
14 | maxLines: 100000
15 |
--------------------------------------------------------------------------------
/files/etc/grafana/provisioning/datasources/prometheus.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: 1
2 |
3 | datasources:
4 | - name: Prometheus
5 | type: prometheus
6 | access: proxy
7 | orgId: 1
8 | url: http://prometheus:9090
9 | isDefault: true
10 | version: 1
11 | editable: false
12 |
--------------------------------------------------------------------------------
/files/etc/loki/config.yaml:
--------------------------------------------------------------------------------
1 | auth_enabled: false
2 |
3 | server:
4 | http_listen_port: 3100
5 | grpc_listen_port: 9096
6 | grpc_server_max_recv_msg_size: 67108864
7 | grpc_server_max_send_msg_size: 67108864
8 |
9 | common:
10 | instance_addr: 0.0.0.0
11 | path_prefix: /loki
12 | storage:
13 | filesystem:
14 | chunks_directory: /loki/chunks
15 | rules_directory: /loki/rules
16 | replication_factor: 1
17 | ring:
18 | kvstore:
19 | store: inmemory
20 |
21 | query_range:
22 | results_cache:
23 | cache:
24 | embedded_cache:
25 | enabled: true
26 | max_size_mb: 100
27 |
28 | limits_config:
29 | retention_period: 7d
30 | max_entries_limit_per_query: 100000
31 |
32 | compactor:
33 | working_directory: /loki/compactor
34 | delete_request_store: filesystem
35 | # shared_store: filesystem
36 | # deletion_mode: filter-and-delete
37 | compaction_interval: 10m
38 | retention_enabled: true
39 | retention_delete_delay: 1h
40 | retention_delete_worker_count: 150
41 |
42 | schema_config:
43 | configs:
44 | - from: 2024-01-01
45 | store: tsdb
46 | object_store: filesystem
47 | schema: v13
48 | index:
49 | prefix: index_
50 | period: 24h
51 |
--------------------------------------------------------------------------------
/files/etc/prometheus/prometheus.yml:
--------------------------------------------------------------------------------
1 | global:
2 | scrape_interval: 3s
3 | scrape_timeout: 3s
4 | evaluation_interval: 5s
5 |
6 | scrape_configs:
7 | - job_name: "prometheus"
8 | scheme: "http"
9 | metrics_path: "/metrics"
10 | static_configs:
11 | - targets:
12 | - "prometheus:9090"
13 |
14 | - job_name: "kyuubi"
15 | scheme: "http"
16 | metrics_path: "/metrics"
17 | static_configs:
18 | - targets:
19 | - "hadoop-master1.orb.local:10019"
20 |
21 | - job_name: "zookeeper"
22 | scheme: "http"
23 | metrics_path: "/metrics"
24 | static_configs:
25 | - targets:
26 | - "hadoop-master1.orb.local:7000"
27 |
--------------------------------------------------------------------------------
/host_vars/local.yaml:
--------------------------------------------------------------------------------
1 | project_version: 1-SNAPSHOT
2 |
3 | # base
4 | zulu8_version: 8.82.0.21
5 | jdk8_version: 8.0.432
6 |
7 | zulu11_version: 11.76.21
8 | jdk11_version: 11.0.25
9 |
10 | zulu17_version: 17.54.21
11 | jdk17_version: 17.0.13
12 |
13 | jdk21_enabled: false
14 | zulu21_version: 21.38.21
15 | jdk21_version: 21.0.5
16 |
17 | s3_enabled: false
18 | aws_java_sdk_version: 1.12.620
19 |
20 | # components
21 | kerberos_enabled: false
22 |
23 | hadoop_version: 3.3.6
24 |
25 | hive_version: 2.3.9
26 |
27 | zeppelin_enabled: true
28 | zeppelin_version: 0.12.0
29 | zeppelin_custom_name: all
30 |
31 | zookeeper_version: 3.8.4
32 |
33 | spark_enabled: true
34 | spark_version: 3.5.5
35 | spark_binary_version: 3.5
36 | spark_scala_binary_version: 2.12
37 | spark_hadoop_version: 3.3.4
38 | spark_custom_name: hadoop3
39 |
40 | flink_enabled: false
41 | flink_binary_version: '1.20'
42 | flink_version: 1.20.1
43 | flink_hive_version: 2.3.10
44 |
45 | kyuubi_enabled: true
46 | kyuubi_version: 1.10.1
47 | kyuubi_hadoop_version: 3.3.6
48 |
49 | ranger_enabled: false
50 | ranger_version: 2.4.0
51 |
52 | trino_enabled: false
53 | trino_version: 436
54 |
55 | parquet_enabled: true
56 | parquet_version: 1.15.0
57 |
58 | iceberg_enabled: true
59 | iceberg_version: 1.8.1
60 |
61 | hudi_enabled: false
62 | hudi_version: 0.14.1
63 |
64 | kafka_enabled: false
65 | kafka_version: 3.6.2
66 | kafka_ui_enabled: false
67 | kafka_ui_version: 1.1.0
68 |
69 | grafana_enabled: false
70 | grafana_version: 11.5.2
71 |
72 | prometheus_enabled: false
73 | prometheus_version: 2.53.3
74 |
75 | loki_enabled: false
76 | loki_version: 3.4.2
77 | loki_log4j2_appender_version: 0.9.32
78 |
79 | # repository
80 | repository_apache: https://mirrors.cloud.tencent.com/apache
81 | repository_maven: https://mirrors.cloud.tencent.com/maven
82 |
83 | apt_mirror_enabled: true
84 |
--------------------------------------------------------------------------------
/hosts:
--------------------------------------------------------------------------------
1 | local ansible_connection=local
2 |
3 | [hadoop-master]
4 | hadoop-master1
5 |
6 | [hadoop-worker]
7 | hadoop-worker1
8 | hadoop-worker2
9 | hadoop-worker3
10 |
--------------------------------------------------------------------------------
/kdc/Dockerfile:
--------------------------------------------------------------------------------
1 | # Licensed under the Apache License, Version 2.0 (the "License");
2 | # you may not use this file except in compliance with the License.
3 | # You may obtain a copy of the License at
4 | #
5 | # http://www.apache.org/licenses/LICENSE-2.0
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS,
9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 | # See the License for the specific language governing permissions and
11 | # limitations under the License.
12 |
13 | ARG PROJECT_VERSION
14 | FROM hadoop-testing/base-ubuntu-2004:$PROJECT_VERSION
15 |
16 | # COPY CONFIGURATION
17 | COPY ./files /
18 |
19 | # INSTALL KERBEROS
20 | RUN install_packages krb5-kdc krb5-admin-server krb5-user
21 |
22 | # CREATE KERBEROS DATABASE
23 | RUN /usr/sbin/kdb5_util create -s -P password
24 |
25 | # CREATE ANOTHER KERBEROS DATABASE
26 | RUN mkdir -p /var/lib/krb5kdc && \
27 | /usr/sbin/kdb5_util create -s -P password -r OTHER.ORG -d /var/lib/krb5kdc/principal-other
28 |
29 | # MAKE '.TEST.ORG' TRUST 'OTHER.ORG'
30 | RUN /usr/sbin/kadmin.local -q "addprinc -pw 123456 krbtgt/.TEST.ORG@OTHER.ORG"
31 | RUN /usr/sbin/kadmin.local -q "addprinc -pw 123456 krbtgt/TEST.ORG" -r OTHER.ORG -d /var/lib/krb5kdc/principal-other
32 |
33 | # EXPOSE KERBEROS PORTS
34 | EXPOSE 88
35 | EXPOSE 89
36 | EXPOSE 749
37 |
38 | CMD ["supervisord", "-c", "/etc/supervisord.conf"]
39 | ENTRYPOINT ["/opt/entrypoint.sh"]
40 |
--------------------------------------------------------------------------------
/kdc/README.md:
--------------------------------------------------------------------------------
1 | KDC
2 | ===
3 |
4 | ## Commands
5 |
6 | Launch container
7 | ```shell
8 | docker run --rm -it -h kdc --name kdc hadoop-testing/kdc:${PROJECT_VERSION}
9 | ```
10 |
11 | Login shell
12 | ```shell
13 | docker exec -it kdc bash
14 | ```
--------------------------------------------------------------------------------
/kdc/files/etc/krb5.conf:
--------------------------------------------------------------------------------
1 | [logging]
2 | default = FILE:/var/log/krb5libs.log
3 | kdc = FILE:/var/log/krb5kdc.log
4 | admin_server = FILE:/var/log/kadmind.log
5 |
6 | [libdefaults]
7 | default_realm = TEST.ORG
8 | dns_lookup_realm = false
9 | dns_lookup_kdc = false
10 | forwardable = true
11 | allow_weak_crypto = true
12 |
13 | [realms]
14 | TEST.ORG = {
15 | kdc = kdc.orb.local:88
16 | admin_server = kdc.orb.local
17 | }
18 | OTHER.ORG = {
19 | kdc = kdc.orb.local:89
20 | admin_server = kdc.orb.local
21 | }
22 |
--------------------------------------------------------------------------------
/kdc/files/etc/krb5kdc/kadm5-other.acl:
--------------------------------------------------------------------------------
1 | */admin@OTHER.ORG *
2 |
--------------------------------------------------------------------------------
/kdc/files/etc/krb5kdc/kadm5.acl:
--------------------------------------------------------------------------------
1 | */admin@TEST.ORG *
2 |
--------------------------------------------------------------------------------
/kdc/files/etc/krb5kdc/kdc.conf:
--------------------------------------------------------------------------------
1 | [kdcdefaults]
2 | kdc_ports = 88
3 | kdc_tcp_ports = 88
4 |
5 | [realms]
6 | TEST.ORG = {
7 | acl_file = /etc/krb5kdc/kadm5.acl
8 | dict_file = /usr/share/dict/words
9 | admin_keytab = /etc/krb5kdc/kadm5.keytab
10 | }
11 |
12 | OTHER.ORG = {
13 | acl_file = /etc/krb5kdc/kadm5-other.acl
14 | dict_file = /usr/share/dict/words
15 | admin_keytab = /etc/krb5kdc/kadm5-other.keytab
16 | kdc_listen = 89
17 | kdc_tcp_listen = 89
18 | kdc_ports = 89
19 | kdc_tcp_ports = 89
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/kdc/files/etc/supervisord.conf:
--------------------------------------------------------------------------------
1 | [supervisord]
2 | logfile = /var/log/supervisord.log
3 | logfile_maxbytes = 50MB
4 | logfile_backups=10
5 | loglevel = info
6 | pidfile = /var/run/supervisord.pid
7 | nodaemon = true
8 | directory = /tmp
9 | strip_ansi = false
10 |
11 | [unix_http_server]
12 | file = /tmp/supervisor.sock
13 |
14 | [rpcinterface:supervisor]
15 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
16 |
17 | [supervisorctl]
18 | serverurl = unix:///tmp/supervisor.sock
19 |
20 | [include]
21 | files = /etc/supervisord.d/*.conf
22 |
--------------------------------------------------------------------------------
/kdc/files/etc/supervisord.d/kdc.conf:
--------------------------------------------------------------------------------
1 | [program:krb5kdc]
2 | command=/bin/bash -c "exec /usr/sbin/krb5kdc -P /var/run/krb5kdc.pid -n -r TEST.ORG -n -d /var/lib/krb5kdc/principal-other -r OTHER.ORG"
3 | autostart=true
4 | autorestart=true
5 | redirect_stderr=true
6 | stdout_logfile=/dev/stdout
7 | stdout_logfile_maxbytes=0
8 |
9 | [program:kadmind]
10 | command=/bin/bash -c "exec /usr/sbin/kadmind -P /var/run/kadmind.pid -nofork -r TEST.ORG"
11 | autostart=true
12 | autorestart=true
13 | redirect_stderr=true
14 | stdout_logfile=/dev/stdout
15 | stdout_logfile_maxbytes=0
16 |
--------------------------------------------------------------------------------
/kdc/files/opt/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -exuo pipefail
4 |
5 | "$@" &
6 |
7 | if [[ -v POST_BOOTSTRAP_COMMAND ]]; then
8 | $POST_BOOTSTRAP_COMMAND
9 | fi
10 |
11 | if [[ -d /opt/service-ready.d ]]; then
12 | for init_script in /opt/service-ready.d/*; do
13 | bash "${init_script}"
14 | done
15 | fi
16 |
17 | wait
18 |
--------------------------------------------------------------------------------
/kdc/files/opt/service-ready.d/001-wait-kdc-ready.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -exuo pipefail
4 |
5 | wait-port-ready -p 88
6 | wait-port-ready -p 89
7 | wait-port-ready -p 749
--------------------------------------------------------------------------------
/kdc/files/opt/service-ready.d/002-create-service-principals.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -exuo pipefail
4 |
5 | rm -rf /share/keytabs/*
6 |
7 | mkdir -p /share/keytabs/hadoop-master1
8 | # HDFS NameNode
9 | create_principal -p nn/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/nn.service.keytab
10 | create_principal -p host/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/nn.service.keytab
11 | create_principal -p HTTP/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/nn.service.keytab
12 |
13 | # YARN ResourceManager
14 | create_principal -p rm/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/rm.service.keytab
15 | create_principal -p host/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/rm.service.keytab
16 |
17 | # MapReduce JobHistory Server
18 | create_principal -p jhs/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/jhs.service.keytab
19 |
20 | # Hive MetaStore & Hive Server2
21 | create_principal -p hive/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/hive.service.keytab
22 |
23 | # Spark History Server
24 | create_principal -p spark/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/spark.service.keytab
25 |
26 | # Flink History Server
27 | create_principal -p flink/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/flink.service.keytab
28 |
29 | # Kyuubi Server
30 | create_principal -p kyuubi/hadoop-master1.orb.local -k /share/keytabs/hadoop-master1/kyuubi.service.keytab
31 |
32 | for i in {1..3}; do
33 | mkdir -p /share/keytabs/hadoop-worker$i
34 | # HDFS DataNode
35 | create_principal -p dn/hadoop-worker$i.orb.local -k /share/keytabs/hadoop-worker$i/dn.service.keytab
36 | create_principal -p host/hadoop-worker$i.orb.local -k /share/keytabs/hadoop-worker$i/dn.service.keytab
37 | # YARN NodeManger
38 | create_principal -p nm/hadoop-worker$i.orb.local -k /share/keytabs/hadoop-worker$i/nm.service.keytab
39 | create_principal -p host/hadoop-worker$i.orb.local -k /share/keytabs/hadoop-worker$i/nm.service.keytab
40 | done
41 |
42 | chmod -R a+r /share/keytabs
--------------------------------------------------------------------------------
/kdc/files/opt/service-ready.d/003-create-kdc-ready-mark.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | create-service-ready-mark -s kdc
4 |
--------------------------------------------------------------------------------
/kdc/files/usr/local/bin/create_principal:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | function usage() {
6 | if [ $# -ne 2 ]; then
7 | echo "Usage: $0 [-o] -p -k