~bigdata-dev/charms/trusty/hdp-accumulo/trunk

« back to all changes in this revision

Viewing changes to hooks/tabletserver-relation-changed

  • Committer: amir sanjar
  • Date: 2014-10-15 01:25:43 UTC
  • Revision ID: amir.sanjar@canonical.com-20141015012543-144w4yem4f8zisz0
adding tracer support

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
from bdutils import fileAddLine, fileRemoveKey, fconfigured
7
7
from charmhelpers.core.hookenv import relation_get
8
 
from common import accumulo_masters_file
 
8
from common import accumulo_masters_file, accumulo_slaves_file, accumulo_gc_file, accumulo_monitor_file, accumulo_tracers_file
9
9
 
10
10
sys.path.insert(0, os.path.join(os.environ['CHARM_DIR'], 'lib'))
11
11
 
29
29
    if fconfigured("tserver_init"):
30
30
        return
31
31
    log("accumulo ==> tabletserver IP={}".format(accumulo_master_IP),"INFO")
32
 
    fileRemoveKey(accumulo_masters_file, "localhost")
33
32
    fileAddLine(accumulo_masters_file, accumulo_master_IP)
 
33
    ip = hookenv.unit_private_ip()
 
34
    fileAddLine(accumulo_slaves_file, ip) 
 
35
    fileAddLine(accumulo_gc_file, accumulo_master_IP) 
 
36
    fileAddLine(accumulo_monitor_file, accumulo_master_IP) 
 
37
    fileAddLine(accumulo_tracers_file, accumulo_master_IP) 
34
38
    ssh_pub_key = str(relation_get('sshpubkey'))
35
39
    ssh_auth_path = os.path.join(os.path.sep, 'home', 'ubuntu','.ssh', 'authorized_keys')
36
40
    with open(ssh_auth_path, 'a') as fssh: