• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

static ip

AWS CLI Lightsail

May 19, 2019

Get instance details

aws lightsail get-instance --instance-name your-server

aws lightsail get-instance --instance-name your-server

Get instance state

aws lightsail get-instance-state --instance-name your-server

aws lightsail get-instance-state --instance-name your-server

Create a snapshot

aws lightsail create-instance-snapshot \
--instance-snapshot-name your-server-new-snapshot-201905192200 \
--instance-name your-server

aws lightsail create-instance-snapshot \ --instance-snapshot-name your-server-new-snapshot-201905192200 \ --instance-name your-server

Create disk from snapshot

aws lightsail create-disk-from-snapshot \
--disk-name your-server-new-boot-disk \
--disk-name your-server-new-snapshot-201905192200 \
--availability-zone us-east-1a
--size-in-gb 50

aws lightsail create-disk-from-snapshot \ --disk-name your-server-new-boot-disk \ --disk-name your-server-new-snapshot-201905192200 \ --availability-zone us-east-1a --size-in-gb 50

Attach Disk

aws lightsail attach-disk \
--disk-name your-server-new-boot-disk \
--instance-name your-server \
--disk-path /dev/sda1

aws lightsail attach-disk \ --disk-name your-server-new-boot-disk \ --instance-name your-server \ --disk-path /dev/sda1

Create instance from snapshot

aws lightsail create-instance-snapshot \
--instance-snaphot-name your-server-new-snapshot-201905192200
--instance-name your-server

aws lightsail create-instance-snapshot \ --instance-snaphot-name your-server-new-snapshot-201905192200 --instance-name your-server

Attach Static IP Address

aws lightsail attach-static-ip \
--static-ip-name your-ip-name \
--instance-name your-server

aws lightsail attach-static-ip \ --static-ip-name your-ip-name \ --instance-name your-server

Filed Under: Cloud, Linux Tagged With: attach, aws, cli, instance, lightsail, snapshot, static ip

Can’t Connect To MySQL Server

June 28, 2013

I recently had a problem with an Ubuntu server that was running MySQL. None of my applications were connecting to the database. After poking around in the server, I realized the database doesn’t seem to be running at all. I tried restarting it from the Terminal, but I ran into this error message.

ERROR 2003 (HY000): Can't connect to MySQL server on '10.10.10.110' (111)

ERROR 2003 (HY000): Can't connect to MySQL server on '10.10.10.110' (111)

As it turns out, the Ubuntu server picked up a new IP address of 10.10.10.113 from the last reboot. I went ahead and assigned a static IP address to the server of 10.10.10.200. I should have done it initially when I setup the server. If you need help setting up a static IP address on the Ubuntu server, here are the instructions on how to set Ubuntu server to static IP address.

I looked at the MySQL configuration file called /etc/mysql/my.cnf, the bind-address was manually set to the old IP address of 10.10.10.110. So, edited the file and entered the new IP address of 10.10.10.200.

bind-address = 10.10.10.200

bind-address = 10.10.10.200

Finally, I restarted the network as well as started the MySQL server.

sudo /etc/init.d/networking restart
sudo /etc/init.d/mysql start

sudo /etc/init.d/networking restart sudo /etc/init.d/mysql start

Everything is hunky dory again.

Filed Under: Linux Tagged With: bind-address, mysql, static ip, ubuntu

  • Home
  • About
  • Archives

Copyright © 2023