-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Opt](external-docker) Modify kerberos network mode to host (#47043)
### What problem does this PR solve? In order to be able to perform kerberos testing on a multi-node doris cluster.
- Loading branch information
Showing
22 changed files
with
501 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docker/thirdparties/docker-compose/common/hive-configure.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# Referenced from [docker-hive](https://github.com/big-data-europe/docker-hive) | ||
|
||
# Set some sensible defaults | ||
export CORE_CONF_fs_defaultFS=${CORE_CONF_fs_defaultFS:-hdfs://`hostname -f`:8020} | ||
|
||
function addProperty() { | ||
local path=$1 | ||
local name=$2 | ||
local value=$3 | ||
|
||
local entry="<property><name>$name</name><value>${value}</value></property>" | ||
local escapedEntry=$(echo $entry | sed 's/\//\\\//g') | ||
sed -i "/<\/configuration>/ s/.*/${escapedEntry}\n&/" $path | ||
} | ||
|
||
function configure() { | ||
local path=$1 | ||
local module=$2 | ||
local envPrefix=$3 | ||
|
||
local var | ||
local value | ||
|
||
echo "Configuring $module" | ||
for c in `printenv | perl -sne 'print "$1 " if m/^${envPrefix}_(.+?)=.*/' -- -envPrefix=$envPrefix`; do | ||
name=`echo ${c} | perl -pe 's/___/-/g; s/__/_/g; s/_/./g'` | ||
var="${envPrefix}_${c}" | ||
value=${!var} | ||
echo " - Setting $name=$ " | ||
addProperty $path $name "$value" | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docker/thirdparties/docker-compose/kerberos/conf/kerberos1/kdc.conf.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[kdcdefaults] | ||
kdc_ports = ${KDC_PORT1} | ||
kdc_tcp_ports = ${KDC_PORT1} | ||
kadmind_port = ${KADMIND_PORT1} | ||
kpasswd_port = ${KPASSWD_PORT1} | ||
|
||
[realms] | ||
LABS.TERADATA.COM = { | ||
acl_file = /var/kerberos/krb5kdc/kadm5.acl | ||
dict_file = /usr/share/dict/words | ||
admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab | ||
supported_enctypes = aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal | ||
kdc_listen = ${KDC_PORT1} | ||
kdc_tcp_listen = ${KDC_PORT1} | ||
kdc_ports = ${KDC_PORT1} | ||
kdc_tcp_ports = ${KDC_PORT1} | ||
kadmind_port = ${KADMIND_PORT1} | ||
kpasswd_port = ${KPASSWD_PORT1} | ||
} | ||
|
||
OTHERLABS.TERADATA.COM = { | ||
acl_file = /var/kerberos/krb5kdc/kadm5-other.acl | ||
dict_file = /usr/share/dict/words | ||
admin_keytab = /var/kerberos/krb5kdc/kadm5-other.keytab | ||
supported_enctypes = aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal | ||
kdc_listen = ${KDC_PORT2} | ||
kdc_tcp_listen = ${KDC_PORT2} | ||
kdc_ports = ${KDC_PORT2} | ||
kdc_tcp_ports = ${KDC_PORT2} | ||
kadmind_port = ${KADMIND_PORT2} | ||
kpasswd_port = ${KPASSWD_PORT2} | ||
} |
39 changes: 39 additions & 0 deletions
39
docker/thirdparties/docker-compose/kerberos/conf/kerberos1/krb5.conf.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[logging] | ||
default = FILE:/var/log/krb5libs.log | ||
kdc = FILE:/var/log/krb5kdc.log | ||
admin_server = FILE:/var/log/kadmind.log | ||
|
||
[libdefaults] | ||
default_realm = LABS.TERADATA.COM | ||
dns_lookup_realm = false | ||
dns_lookup_kdc = false | ||
forwardable = true | ||
allow_weak_crypto = true | ||
|
||
[realms] | ||
LABS.TERADATA.COM = { | ||
kdc = ${HOST}:${KDC_PORT1} | ||
admin_server = ${HOST}:${KADMIND_PORT1} | ||
} | ||
OTHERLABS.TERADATA.COM = { | ||
kdc = ${HOST}:${KDC_PORT2} | ||
admin_server = ${HOST}:${KADMIND_PORT2} | ||
} |
38 changes: 38 additions & 0 deletions
38
docker/thirdparties/docker-compose/kerberos/conf/kerberos2/kdc.conf.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[kdcdefaults] | ||
kdc_ports = ${KDC_PORT1} | ||
kdc_tcp_ports = ${KDC_PORT1} | ||
kadmind_port = ${KADMIND_PORT1} | ||
kpasswd_port = ${KPASSWD_PORT1} | ||
|
||
|
||
[realms] | ||
OTHERREALM.COM = { | ||
acl_file = /var/kerberos/krb5kdc/kadm5.acl | ||
dict_file = /usr/share/dict/words | ||
admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab | ||
supported_enctypes = aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal | ||
kdc_listen = ${KDC_PORT1} | ||
kdc_tcp_listen = ${KDC_PORT1} | ||
kdc_ports = ${KDC_PORT1} | ||
kdc_tcp_ports = ${KDC_PORT1} | ||
kadmind_port = ${KADMIND_PORT1} | ||
kpasswd_port = ${KPASSWD_PORT1} | ||
} |
35 changes: 35 additions & 0 deletions
35
docker/thirdparties/docker-compose/kerberos/conf/kerberos2/krb5.conf.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
[logging] | ||
default = FILE:/var/log/krb5libs.log | ||
kdc = FILE:/var/log/krb5kdc.log | ||
admin_server = FILE:/var/log/kadmind.log | ||
|
||
[libdefaults] | ||
default_realm = OTHERREALM.COM | ||
dns_lookup_realm = false | ||
dns_lookup_kdc = false | ||
forwardable = true | ||
allow_weak_crypto = true | ||
|
||
[realms] | ||
OTHERREALM.COM = { | ||
kdc = ${HOST}:${KDC_PORT1} | ||
admin_server = ${HOST}:${KADMIND_PORT1} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,18 +16,23 @@ | |
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -exuo pipefail | ||
[mysqld] | ||
port=${MYSQL_PORT} | ||
datadir=/var/lib/mysql | ||
socket=/var/lib/mysql/mysql.sock | ||
# Disabling symbolic-links is recommended to prevent assorted security risks | ||
symbolic-links=0 | ||
# Settings user and group are ignored when systemd is used. | ||
# If you need to run mysqld under a different user or group, | ||
# customize your systemd unit file for mariadb according to the | ||
# instructions in http://fedoraproject.org/wiki/Systemd | ||
|
||
TICKET_LIFETIME='30m' | ||
[mysqld_safe] | ||
log-error=/var/log/mariadb/mariadb.log | ||
pid-file=/var/run/mariadb/mariadb.pid | ||
|
||
kinit -l "$TICKET_LIFETIME" -f -c /etc/trino/conf/presto-server-krbcc \ | ||
-kt /etc/trino/conf/presto-server.keytab presto-server/$(hostname -f)@LABS.TERADATA.COM | ||
|
||
kinit -l "$TICKET_LIFETIME" -f -c /etc/trino/conf/hive-presto-master-krbcc \ | ||
-kt /etc/trino/conf/hive-presto-master.keytab hive/$(hostname -f)@LABS.TERADATA.COM | ||
|
||
kinit -l "$TICKET_LIFETIME" -f -c /etc/trino/conf/hdfs-krbcc \ | ||
-kt /etc/hadoop/conf/hdfs.keytab hdfs/[email protected] | ||
# | ||
# include all files from the config directory | ||
# | ||
!includedir /etc/my.cnf.d | ||
|
||
kinit -l "$TICKET_LIFETIME" -f -c /etc/trino/conf/hive-krbcc \ | ||
-kt /etc/hive/conf/hive.keytab hive/[email protected] |
50 changes: 0 additions & 50 deletions
50
docker/thirdparties/docker-compose/kerberos/entrypoint-hive-master-2.sh
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.