-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathconfigure-system.sh.tpl
41 lines (33 loc) · 1.89 KB
/
configure-system.sh.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# http://tldp.org/LDP/abs/html/options.html
set -o errexit
set -o nounset
#### LOGROTATE ####
aws s3 cp s3://${bootstrap_bucket}/logrotate /tmp/
sudo -u root cp /tmp/logrotate /etc/logrotate.d/emr
sudo -u root chmod 0644 /etc/logrotate.d/emr
aws s3 cp s3://${bootstrap_bucket}/logrotate.sh /tmp/
sudo -u root cp /tmp/logrotate.sh /etc/cron.hourly/logrotate-emr
sudo -u root chmod 0755 /etc/cron.hourly/logrotate-emr
#### SYSLOG ####
aws s3 cp s3://${bootstrap_bucket}/syslog.conf /tmp/
sudo -u root cp /tmp/syslog.conf /etc/rsyslog.d/25-emr.conf
sudo -u root chmod 0644 /etc/rsyslog.d/25-emr.conf
sudo -u root service rsyslog restart
### ZEPPELIN ###
sudo -u root mkdir -p /etc/zeppelin/conf/
aws s3 cp s3://${bootstrap_bucket}/shiro.ini /tmp/
sudo -u root cp /tmp/shiro.ini /etc/zeppelin/conf/shiro.ini
sudo -u root mkdir -p /etc/spark/conf/
aws s3 cp s3://${bootstrap_bucket}/log4j_spark.properties /tmp/
sudo -u root cp /tmp/log4j_spark.properties /etc/spark/conf/log4j.properties
aws s3 cp s3://${bootstrap_bucket}/log4j_zeppelin.properties /tmp/
sudo -u root cp /tmp/log4j_zeppelin.properties /etc/zeppelin/conf/log4j.properties
# Create a Self-Signed Cert for the Zeppelin UI
# Ideally you'd want to replace this with a PKI, but this will do for now
openssl genrsa -out zeppelin.key
openssl req -new -x509 -key zeppelin.key -out zeppelin.crt -subj "/C=US/ST=State/O=Company/CN=localhost"
keytool -keystore /tmp/keystore -import -alias zeppelin -file zeppelin.crt -trustcacerts -storepass ${zeppelin_keystore_password} -noprompt
openssl pkcs12 -inkey zeppelin.key -in zeppelin.crt -export -out zeppelin.pkcs12 -passout pass:${zeppelin_keystore_password}
keytool -importkeystore -srckeystore zeppelin.pkcs12 -srcstoretype PKCS12 -destkeystore /tmp/keystore -storepass ${zeppelin_keystore_password} -noprompt -srcstorepass ${zeppelin_keystore_password}
sudo -u root mv /tmp/keystore /etc/zeppelin/conf/keystore