Skip to content

Commit e3ee04e

Browse files
authored
Simplify SSHing into client hosts (openmessaging#7)
* add client_ssh_host terraform output * add default ansible configs
1 parent a5de856 commit e3ee04e

File tree

6 files changed

+35
-7
lines changed

6 files changed

+35
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ ok: [localhost] => (item=54.212.205.198) => {
117117
You can SSH into the machine where the benchmark client was installed:
118118

119119
```shell
120-
ssh ec2-user@${CLIENT_IP}
120+
ssh ec2-user@$(terraform output client_ssh_host)
121121
```
122122

123-
Start the load
123+
Start the load:
124124

125125
```shell
126126
cd /opt/benchmark

driver-kafka/deploy/ansible.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[defaults]
2+
host_key_checking=false
3+
private_key_file=~/.ssh/id_rsa
4+
5+
[privilege_escalation]
6+
become=true
7+
become_method='sudo'
8+
become_user='root'

driver-kafka/deploy/provision-kafka-aws.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
variable "public_key_path" {
2+
default = "~/.ssh/id_rsa.pub"
23
description = <<DESCRIPTION
34
Path to the SSH public key to be used for authentication.
45
Ensure this keypair is added to your local SSH agent so provisioners can
56
connect.
67
7-
Example: ~/.ssh/terraform.pub
8+
Example: ~/.ssh/id_rsa.pub
89
DESCRIPTION
910
}
1011

@@ -129,3 +130,7 @@ resource "aws_instance" "client" {
129130
Name = "kafka-client-${count.index}"
130131
}
131132
}
133+
134+
output "client_ssh_host" {
135+
value = "${aws_instance.client.0.public_ip}"
136+
}

driver-pulsar/deploy/ansible.cfg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[defaults]
2+
host_key_checking=false
3+
private_key_file=~/.ssh/id_rsa
4+
5+
[privilege_escalation]
6+
become=true
7+
become_method='sudo'
8+
become_user='root'

driver-pulsar/deploy/deploy.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
become: true
2424
tasks:
2525
- shell: >
26-
sudo tuned-adm profile latency-performance &&
26+
tuned-adm profile latency-performance &&
2727
mkfs.xfs /dev/nvme0n1 &&
2828
mkfs.xfs /dev/nvme1n1 &&
2929
mkdir -p /mnt/journal &&
@@ -50,13 +50,14 @@
5050
zookeeperServers: "{{ groups['zookeeper']|map('extract', hostvars, ['ansible_default_ipv4', 'address'])|map('regex_replace', '(.*)', '\\1:2181') | join(',') }}"
5151
serviceUrl: "pulsar://{{ hostvars[groups['pulsar'][0]].private_ip }}:6650/"
5252
httpUrl: "http://{{ hostvars[groups['pulsar'][0]].private_ip }}:8080/"
53+
pulsarVersion: "1.21.0-incubating"
5354

5455
- name: Download Pulsar
5556
file:
5657
path: "/opt/pulsar"
5758
state: directory
5859
- get_url:
59-
url: https://dist.apache.org/repos/dist/dev/incubator/pulsar/pulsar-1.21.0-incubating-candidate-3/apache-pulsar-1.21.0-incubating-bin.tar.gz
60+
url: https://dist.apache.org/repos/dist/dev/incubator/pulsar/pulsar-{{ pulsarVersion }}-candidate-3/apache-pulsar-{{ pulsarVersion }}-bin.tar.gz
6061
dest: /tmp/pulsar.tgz
6162
- command: tar --strip-components=1 -xvf /tmp/pulsar.tgz
6263
args:
@@ -169,7 +170,7 @@
169170
src: ../../package/target/openmessaging-benchmark-0.0.1-SNAPSHOT-bin.tar.gz
170171
dest: /opt
171172
- shell: >
172-
sudo tuned-adm profile latency-performance &&
173+
tuned-adm profile latency-performance &&
173174
mv /opt/openmessaging-benchmark-0.0.1-SNAPSHOT /opt/benchmark
174175
- name: Configure service URL
175176
lineinfile:
@@ -190,6 +191,7 @@
190191

191192
- name: Hosts addresses
192193
hosts: localhost
194+
become: false
193195
tasks:
194196
- debug:
195197
msg: "Zookeeper servers {{ item }}"

driver-pulsar/deploy/provision-pulsar-aws.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
variable "public_key_path" {
2+
default = "~/.ssh/id_rsa.pub"
23
description = <<DESCRIPTION
34
Path to the SSH public key to be used for authentication.
45
Ensure this keypair is added to your local SSH agent so provisioners can
56
connect.
67
7-
Example: ~/.ssh/terraform.pub
8+
Example: ~/.ssh/id_rsa.pub
89
DESCRIPTION
910
}
1011

@@ -129,3 +130,7 @@ resource "aws_instance" "client" {
129130
Name = "pulsar-client-${count.index}"
130131
}
131132
}
133+
134+
output "client_ssh_host" {
135+
value = "${aws_instance.client.0.public_ip}"
136+
}

0 commit comments

Comments
 (0)