Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

[TRAFODION-1839] Trafodion Installer Evolution #807

Merged
merged 4 commits into from
Nov 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,8 @@ VariableLengthPKTest.java
# asciidoc extention file -- MIT license
google-analytics-postprocessor.rb


# installer JSON config files
mod_cfgs.json
prompt.json
script.json
version.json
21 changes: 21 additions & 0 deletions install/python-installer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Apache Trafodion Python Installer

## Prerequisite:

- CDH/HDP is installed on Trafodion nodes with web UI enabled, or Apache Hadoop, HBase is installed on the same directory on all nodes
- /etc/hosts contains hostname info for all Trafodion nodes on **installer node**
- python version 2.6/2.7, and python library `httplib2`, `prettytable`
- Trafodion server package file is stored on **installer node**
- Passwordless SSH login, one of these two options is needed:
- Set SSH key pairs against **installer node** and Trafodion nodes
- Install `sshpass` tool on **installer node**, then input the SSH password during installation using `--enable-pwd` option

> **installer node** can be any nodes as long as it can ssh to Trafodion nodes, it also can be one of the Trafodion nodes

## How to use:
- Two ways:
- Simply invoke `./db_install.py` to start the installation in guided mode
- Copy the `db_config_default` file to `your_db_config` and modify it, then invoke `./db_config.py --config-file your_db_config` to start installation in config mode
- For a quick install with default settings, you only need to put Trafodion package file in installer's directory, provide CDH/HDP web URL in `your_db_config` file and then it's ready to go!
- Use `./db_install.py --help` for more options
- Invoke `./discovery.py` to get the system basic info on all nodes
72 changes: 72 additions & 0 deletions install/python-installer/apache_mods.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env python

# @@@ START COPYRIGHT @@@
#
# 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.
#
# @@@ END COPYRIGHT @@@

### this script should be run on all nodes with sudo user ###

import sys
import json
import socket
from common import MODCFG_FILE, ParseJson, ParseXML, err, run_cmd

def run():
dbcfgs = json.loads(dbcfgs_json)
if 'APACHE' in dbcfgs['distro']:
modcfgs = ParseJson(MODCFG_FILE).load()
MOD_CFGS = modcfgs['MOD_CFGS']

hdfs_xml_file = dbcfgs['hdfs_xml_file']
hbase_xml_file = dbcfgs['hbase_xml_file']

hbasexml = ParseXML(hbase_xml_file)
for key, value in MOD_CFGS['hbase-site'].items():
hbasexml.add_property(key, value)
hbasexml.write_xml()

hdfsxml = ParseXML(hdfs_xml_file)
for key, value in MOD_CFGS['hdfs-site'].items():
hdfsxml.add_property(key, value)
hdfsxml.write_xml()

print 'Apache Hadoop modification completed'
first_node = dbcfgs['first_rsnode']
local_host = socket.gethostname()
if first_node in local_host:
hadoop_home = dbcfgs['hadoop_home']
hbase_home = dbcfgs['hbase_home']
# stop
run_cmd(hbase_home + '/bin/stop-hbase.sh')
run_cmd(hadoop_home + '/sbin/stop-dfs.sh')
# start
run_cmd(hadoop_home + '/sbin/start-dfs.sh')
run_cmd(hbase_home + '/bin/start-hbase.sh')

print 'Apache Hadoop restart completed'
else:
print 'no apache distribution found, skipping'

# main
try:
dbcfgs_json = sys.argv[1]
except IndexError:
err('No db config found')
run()
79 changes: 79 additions & 0 deletions install/python-installer/bashrc.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/sh

# @@@ START COPYRIGHT @@@
#
# 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.
#
# @@@ END COPYRIGHT @@@


# This is the .bashrc for the Trafodion environment
#
#-------------------------------------------
# Execute the system's default .bashrc first
#-------------------------------------------
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

cd $HOME

#-------------------------------------------
# full path of your Trafodion installation
#-------------------------------------------
export JAVA_HOME="{{ java_home }}"
export SQ_HOME="{{ sq_home }}"
export MY_SQROOT=$SQ_HOME

#-------------------------------------------
# other env vars needed by Trafodion
#-------------------------------------------

# These env vars define all nodes in the cluster
export NODE_LIST="{{ node_list }}"
export MY_NODES="{{ my_nodes }}"
export node_count="{{ node_count }}"
export HADOOP_TYPE="{{ hadoop_type }}"
export ENABLE_HA="{{ enable_ha }}"

#-------------------------------------------
# Execute the sqenv.sh script if it exists.
#-------------------------------------------
PATH=".:$PATH"
if [ -f $MY_SQROOT/sqenv.sh ]; then
pushd . >/dev/null
cd $MY_SQROOT
source ./sqenv.sh
popd >/dev/null
export MANPATH=$MANPATH:$MPI_ROOT/share/man
fi

#-------------------------------------------
# additional settings for Trafodion environment
#-------------------------------------------
ETC_SECURITY_MSG="***ERROR: To fix this please configure /etc/security/limits.conf properly on $HOSTNAME."

# set core file size
ulimit -c unlimited

# set max open files
ulimit -n 32768
if [ $? -ne 0 ]; then
echo "***ERROR: Unable to set max open files. Current value $(ulimit -n)"
echo $ETC_SECURITY_MSG
fi
Loading