mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
title, description, category, tags, resources
| title | description | category | tags | resources | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Creating an Environment | End-to-end guide: user accounts, SSH keys, VPCs, AMIs, and launching instances. | Environments |
|
|
Creating an Environment
End-to-end guide: user accounts, SSH keys, VPCs, AMIs, and launching instances.
Table of Contents
Overview
This guide walks through the complete workflow for creating a production-ready Hive environment.
Steps:
- Create a user account
- Import or create SSH keys
- Create a VPC and subnet
- Select and import an AMI
- Launch EC2 instances
- Connect via SSH
- Monitor instance health
Instructions
1. Import SSH Key
aws ec2 import-key-pair --key-name "hive-key" --public-key-material fileb://~/.ssh/id_rsa.pub
2. Create VPC
aws ec2 create-vpc --cidr-block 10.200.0.0/16
export HIVE_VPC="vpc-XXX"
aws ec2 create-subnet --vpc-id $HIVE_VPC --cidr-block 10.200.1.0/24
export HIVE_SUBNET="subnet-XXX"
3. Import AMI
./bin/hive admin images list
./bin/hive admin images import --name debian-12-x86_64
export HIVE_AMI="ami-XXX"
4. Launch Instance
aws ec2 run-instances \
--image-id $HIVE_AMI \
--instance-type t3.small \
--key-name hive-key \
--subnet-id $HIVE_SUBNET \
--count 1
5. Connect via SSH
ps auxw | grep $INSTANCE_ID
# Look for: hostfwd=tcp:127.0.0.1:<port>-:22
ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p <port>
Troubleshooting
Instance stuck in pending
Check the Hive daemon and QEMU logs for boot errors:
ls ~/hive/logs/
cat ~/hive/logs/daemon.log
Verify the AMI exists and architecture matches your host:
aws ec2 describe-images --image-ids $HIVE_AMI
SSH connection refused
cloud-init takes 30-60 seconds to configure networking and SSH after boot. Wait and retry.
Verify the SSH port forwarding is active:
ps auxw | grep hostfwd
Ensure you're using the correct key and port:
ssh -i ~/.ssh/hive-key ec2-user@127.0.0.1 -p <port>