Note
|
Do not try to follow this if you’re running the stack locally :) |
-
An SSH client.
-
On the Mac and Linux you have one already (
Terminal
). -
You can also use
Secure Shell App
plugin for the Chrome web browser if you want.
-
-
The IP address of the machine that’s been provisioned for you - speak to the instructor if you do not have this.
-
The SSH private key for connecting to the server. Your instructor will provide this. Copy it to a path on your machine, such as the Downloads folder.
How you do this depends on the SSH client you’re using.
Make sure you have the private key. Set the permissions on it so that only your user can read it (otherwise the ssh connection will fail). Use the appropriate path for where you have saved the key.
chmod 400 ~/Downloads/qcon-ldn-workshop.rsa
Use ssh
from the Terminal to connect to the server, using the -i
option to tell it to use the SSH key
ssh -i ~/Downloads/qcon-ldn-workshop.rsa [email protected]
Replace 1.2.3.4
with the IP address of the server that you’ve been given.
You’ll get a warning:
The authenticity of host '1.2.3.4 (1.2.3.4)' can't be established.
ECDSA key fingerprint is SHA256:JAoWP5aRvtYu1M4UgPwSewy0/+9lBNdWo2+RahoYxNs.
Are you sure you want to continue connecting (yes/no)? yes
Enter yes
and you should get the shell prompt for your remote server:
Warning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.
__| __| __|
_| ( \__ \ Amazon Linux 2 (ECS Optimized)
____|\___|____/
For documentation, visit http://aws.amazon.com/documentation/ecs
4 package(s) needed for security, out of 20 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-0-0-53 ~]$
Now follow the instructions below ksqlDB prompt, and then open a second terminal window, repeat the above process to login to the remote server, and then start a MySQL prompt following the separate instructions below.
Connect using the IP address given, username ec2-user
. Provide the SSH key to your SSH client (see appendices below for specific instructions).
Now follow the instructions below ksqlDB prompt, and then open a second terminal window, repeat the above process to login to the remote server, and then start a MySQL prompt following the separate instructions below.
-
Click
Import
and upload the private key -
From the dropdown menu select the private key that you uploaded
-
Set
username
toec2-user
-
Set
hostname
to the IP address of your server -
Click Connect
You’ll get a warning:
The authenticity of host '1.2.3.4 (1.2.3.4)' can't be established.
ECDSA key fingerprint is SHA256:JAoWP5aRvtYu1M4UgPwSewy0/+9lBNdWo2+RahoYxNs.
Are you sure you want to continue connecting (yes/no)? yes
Enter yes
and you should get the shell prompt for your remote server:
Warning: Permanently added '1.2.3.4' (ECDSA) to the list of known hosts.
__| __| __|
_| ( \__ \ Amazon Linux 2 (ECS Optimized)
____|\___|____/
For documentation, visit http://aws.amazon.com/documentation/ecs
4 package(s) needed for security, out of 20 available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-10-0-0-53 ~]$
Now follow the instructions below ksqlDB prompt, and then open a second terminal window, repeat the above process to login to the remote server, and then start a MySQL prompt following the separate instructions below.
On the remote server you’ve just connected to, run the following:
docker exec -it $(docker ps|grep ksqldb|awk '{print $11}') ksql http://localhost:8088
This will take you to the ksqlDB prompt:
===========================================
= _ _ ____ ____ =
= | | _____ __ _| | _ \| __ ) =
= | |/ / __|/ _` | | | | | _ \ =
= | <\__ \ (_| | | |_| | |_) | =
= |_|\_\___/\__, |_|____/|____/ =
= |_| =
= Event Streaming Database purpose-built =
= for stream processing apps =
===========================================
Copyright 2017-2019 Confluent Inc.
CLI v6.0.0-SNAPSHOT, Server v6.0.0-SNAPSHOT located at http://localhost:8088
Having trouble? Type 'help' (case-insensitive) for a rundown of how things work!
ksql>
On the remote server you’ve just connected to, run the following:
docker exec -it $(docker ps|grep mysql|awk '{print $12}') bash -c 'mysql -u $MYSQL_USER -p$MYSQL_PASSWORD demo'
This will take you to the MySQL prompt:
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.19 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
-
Launch PuTTY
-
In the Session pane enter the IP of your server under Host Name
-
In the Connection → Data pane enter
ec2-user
under Auto-login username -
In the Connection → SSH → Auth pane click Browse to select the SSH private key that you’ve been provided. Make sure you use the
ppk
format one and notrsa
. -
Click Open. You will get a
PuTTY Security Alert
- click Yes