-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap-zookeeper.tf
44 lines (40 loc) · 1.6 KB
/
bootstrap-zookeeper.tf
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
42
43
44
locals {
zookeeper_setup = "/scripts/zookeeper/1-zookeeper-setup.sh"
zookeeper_journal_setup = "/scripts/zookeeper/2-zookeeper-journal-setup.sh"
zookeeper_ips = join(",", tencentcloud_instance.zookeeper_node[*].private_ip)
}
resource "tencentcloud_tat_command" "zookeeper-setup" {
command_name = "1-zookeeper-setup"
content = file(join("", [path.module, local.zookeeper_setup]))
description = "Install and configure the Zookeeper nodes"
command_type = "SHELL"
timeout = 1200
username = "root"
working_directory = "/root"
enable_parameter = true
default_parameters = jsonencode({
"zookeeper_version" : var.zookeeper_version,
"zookeeper_home" : var.zookeeper_home,
"zookeeper_data_dir" : var.zookeeper_data_dir,
"zookeeper_ips" : local.zookeeper_ips,
"java_home" : var.zookeeper_java_home,
})
depends_on = [tencentcloud_instance.zookeeper_node]
}
resource "tencentcloud_tat_command" "qjournal-setup" {
command_name = "2-zookeeper-journal-setup"
content = file(join("", [path.module, local.zookeeper_journal_setup]))
description = "Install and configure Journal on the Zookeeper nodes"
command_type = "SHELL"
timeout = 1200
username = "root"
working_directory = "/root"
enable_parameter = true
default_parameters = jsonencode({
"hadoop_version" : var.hadoop_version,
"hadoop_home" : var.hadoop_home,
"java_home" : var.zookeeper_java_home,
"hadoop_data_dir" : var.hadoop_data_dir,
})
depends_on = [tencentcloud_instance.zookeeper_node]
}