- Prepare cloud environment
- 1. [Optional] Create a new security group
- 2. [Optional] Create a new IAM role
- 3. Provision instance for YugaWare
- 1. [Optional] Create a new project
- 2. Set up a new service account
- 3. Give permissions to the service account
- 4. Creating a firewall rule
- 5. Provision instance for YugaWare
- 6. Connect to the YugaWare machine
Prepare cloud environment
A dedicated host or virtual machine (VM) is needed to run YugaWare. For more details, see this faq. This page highlights the basic setup needed in order to install YugaWare.
1. [Optional] Create a new security group
In order to access YugaWare from outside the AWS environment, you would need to enable access by assigning an appropriate security group to the YugaWare machine. You will at minimum need to:
- Access the YugaWare instance over ssh (port tcp:22)
- Check, manage and upgrade YugaWare (port tcp:8800)
- View the YugaWare console ui (port tcp:80)
Let us create a security group enabling all of that!
Go to EC2
-> Security Groups
, click on Create Security Group
and add the following values:
- Enter
yugaware-sg
as the name (you can change the name if you want). - Add a description (eg:
Security group for YugaWare access
). - Add the appropriate ip addresses to the
Source IP ranges
field. To allow access from any machine, add0.0.0.0/0
but note that this is not very secure. - Add the ports
22
,8800
,80
to thePort Range
field. TheProtocol
must beTCP
.
You should see something like the screenshot below, click Create
next.
2. [Optional] Create a new IAM role
In order for YugaWare to manage YugabyteDB nodes, it will require some limited access to your AWS infrastructure. This can be accomplished through directly providing a set of credentials, when configuring the AWS provider, which you can read more later on here. Alternatively, the EC2 instance where YugaWare will be running can be brought up with an IAM role with enough permissions to take all the actions required by YugaWare. Below we provide a sample of such a role:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:AttachVolume",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:ImportVolume",
"ec2:ModifyVolumeAttribute",
"ec2:DescribeInstances",
"ec2:DescribeInstanceAttribute",
"ec2:CreateKeyPair",
"ec2:DescribeVolumesModifications",
"ec2:DeleteVolume",
"ec2:DescribeVolumeStatus",
"ec2:StartInstances",
"ec2:DescribeAvailabilityZones",
"ec2:CreateSecurityGroup",
"ec2:DescribeVolumes",
"ec2:ModifyInstanceAttribute",
"ec2:DescribeKeyPairs",
"ec2:DescribeInstanceStatus",
"ec2:DetachVolume",
"ec2:ModifyVolume",
"ec2:TerminateInstances",
"ec2:AssignIpv6Addresses",
"ec2:ImportKeyPair",
"ec2:DescribeTags",
"ec2:CreateTags",
"ec2:RunInstances",
"ec2:AssignPrivateIpAddresses",
"ec2:StopInstances",
"ec2:AllocateAddress",
"ec2:DescribeVolumeAttribute",
"ec2:DescribeSecurityGroups",
"ec2:CreateVolume",
"ec2:EnableVolumeIO",
"ec2:DescribeImages",
"ec2:DescribeVpcs",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSubnets",
"ec2:DeleteKeyPair"
],
"Resource": "*"
}
]
}
3. Provision instance for YugaWare
Create an instance to run YugaWare. In order to do so, go to EC2
-> Instances
and click on Launch Instance
. Fill in the following values.
Change the boot disk image to
Ubuntu 16.04
and continue to the next step.Choose
c5.xlarge
(4 vCPUs are recommended for production) as the machine type. Continue to the next step.Choose the VPC, subnet and other settings as appropriate. Make sure to enable the
Auto-assign Public IP
setting, otherwise this machine would not be accessible from outside AWS. If you created an IAM role above, or already had one that you would like to use, provide that underIAM role
. Continue to the next step.Increase the root storage volume size to at least
100GiB
. Continue to the next step.Add a tag to name the machine. You can set key to
Name
and value toyugaware-1
. Continue to the next step.Select the
yugaware-sg
security group we created in the previous step (or the custom name you chose when setting up the security groups). Launch the instance.Pick an existing key pair (or create a new one) in order to access the machine. Make sure you have the ssh access key. This is important to enable
ssh
access to this machine. In this example, we will assume the key pair is~/.ssh/yugaware.pem
.
Finally, click Launch
to launch the YugaWare server. You should see a machine being created as shown in the image below.
1. [Optional] Create a new project
A project forms the basis for creating, enabling and using all GCP services, managing APIs, enabling billing, adding and removing collaborators, and managing permissions. You would need browse to the GCP cloud resource manager and click on create project to get started. You can follow these instructions to create a new GCP project.
Give the project a suitable name (eg: yugabyte-gcp
) and note the project ID (eg: yugabyte-gcp
). You should see a dialog that looks like the screenshot below.
2. Set up a new service account
YugaWare admin console requires a service account with the appropriate permissions to provision and manage compute instances. Go to the IAM & admin
-> Service accounts
and click on Create Service Account
. You can follow these instructions to create a service account.
Fill the form with the following values:
- Service account name is
yugaware
(you can customize the name if needed). - Set role to
Project
->Owner
. - Check the box for
Furnish a new private key
, chooseJSON
option.
Here is a screenshot with the above values in the form, click create once the values are filled in.
NOTE: Your browser would have downloaded the respective JSON format key. It is important to store it safely. This JSON key is needed to configure the YugaWare Admin Console.
3. Give permissions to the service account
- Find the email address associated with the service account by going to
IAM & admin
->Service accounts
. Copy this value. The screen should look as shown below.
- Next, browse to
IAM & admin
->IAM
and click onADD
. Add the compute admin role for this service account. A screenshot is shown below.
4. Creating a firewall rule
In order to access YugaWare from outside the GCP environment, you would need to enable firewall rules. You will at minimum need to:
- Access the YugaWare instance over ssh (port tcp:22)
- Check, manage and upgrade YugaWare (port tcp:8800)
- View the YugaWare console ui (port tcp:80)
Let us create a firewall entry enabling all of that!
Go to VPC network
-> Firewall rules
tab:
NOTE: If this is a new project, you might see a message saying Compute Engine is getting ready
. If so, you would need to wait for a while. Once complete, you should see the default set of firewall rules for your default network, as shown below.
Click on the CREATE FIREWALL RULE
button and fill in the following.
- Enter
yugaware-firewall-rule
as the name (you can change the name if you want). - Add a description (eg:
Firewall setup for YugaWare Admin Console
). - Add a tag
yugaware-server
to theTarget tags
field. This will be used later when creating instances. - Add the appropriate ip addresses to the
Source IP ranges
field. To allow access from any machine, add0.0.0.0/0
but note that this is not very secure. - Add the ports
tcp:22,8800,80
to theProtocol and ports
field.
You should see something like the screenshot below, click Create
next.
5. Provision instance for YugaWare
Create an instance to run YugaWare. In order to do so, go to Compute Engine
-> VM instances
and click on Create
. Fill in the following values.
- Enter
yugaware-1
as the name. - Pick a region/zone (eg:
us-west1-b
). - Choose
4 vCPUs
(n1-standard-4
) as the machine type. - Change the boot disk image to
Ubuntu 16.04
and increase the boot disk size to100GB
. - Open the
Management, disks, networking, SSH keys
->Networking
tab. Addyugaware-server
as the network tag (or the custom name you chose when setting up the firewall rules). - Switch to the
SSH Keys
tab and add a custom public key and login user to this instance. First create a key-pair.
You can do this as shown below.
$ ssh-keygen -t rsa -f ~/.ssh/yugaware-1-gcp -C centos
Set the appropriate credentials for the ssh key.
$ chmod 400 ~/.ssh/yugaware-1-gcp
Now enter the contents of yugaware-1-gcp.pub
as the value for this field.
Here are the detailed instructions to create a new SSH key pair, as well as the expected format for this field (eg: ssh-rsa [KEY_VALUE] [USERNAME]
). This is important to enable ssh
access to this machine.
Note on boot disk customization:
Note on networking customization:
Finally, click Create
to launch the YugaWare server.
6. Connect to the YugaWare machine
From the GCP web management console, find the public ip address of the instance we just launched.
You can connect to this machine by running the following command (remember to replace XX.XX.XX.XX
below with the ip address, and also to enter the appropriate ssh key instead of yugaware-1-gcp
).
$ ssh -i ~/.ssh/yugaware-1-gcp [email protected]