Firecracker MicroVMs
Firecracker refers to an open-source virtualization technology designed for creating and managing lightweight, secure, and fast micro virtual machines (microVMs). These microVMs are designed to be used in serverless computing platforms, container environments, and other scenarios where fast startup and low overhead are crucial.
A Firecracker image refers to an operating system image or a software package that is specifically designed to run within a Firecracker microVM. These images are optimized for quick launch and efficient resource usage.
Creating a Firecracker image follows the same process as creating a VM. To create a Firecracker image, see the Create a VM how-to guide.
To access your Firecracker image using Remote Desktop Protocol (RDP), see the Access Your VM’s GUI using Windows Remote Desktop how-to guide.
0.0.1 Redis
Remote Dictionary Server (Redis) is an open-source, high-performance, in-memory data structure store. It is often referred to as a “data structure server” because it allows you to store and manipulate various types of data structures, such as strings, hashes, lists, sets, sorted sets, and more. Redis is designed for speed, efficiency, and versatility, making it a powerful tool for a wide range of applications.
After creating and starting a Redis MicroVM, the base Redis server starts running immediately. To test if your Redis server is running and responsive, use the Redis command-line client: redis-cli
. This opens the Redis CLI. By default, redis-cli
attempts to connect to a Redis server running on your local machine (127.0.0.1) at the default port (6379).You can run various Redis commands to interact with the server.
For example: SET mykey "Hello, Redis!"
and GET mykey
user@Redis-Server-1015:~$ redis-cli
127.0.0.1:6379> SET mykey "Hello, Redis!"
OK
127.0.0.1:6379> GET mykey
"Hello, Redis!"
127.0.0.1:6379>
Redis server comes with a default configuration that should work for many cases. However, you can customize the configuration by editing the redis.conf file at /etc/redis/redis.conf
.
Please refer to the Redis official documentation for further details.
0.0.2 MySQL
MySQL offers a robust and scalable platform for managing structured data. It supports various storage engines, data types, and features that cater to different use cases. MySQL is known for its speed, reliability, and ease of use.
After creating and starting a MySQL MicroVM, open up a terminal inside the MicroVM and type sudo mysql
to start MySQL server. You can type SHOW DATABASES;
to show a list of default MySQL databases. To create a new MySQL database, type CREATE DATABASE mydatabase;
Here, mydatabase
is the name you choose for your database. And then type SHOW DATABASES;
to show a list of updated databases.
user@MySQL-Server-1020:~$ sudo mysql
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> CREATE DATABASE mydatabase;
Query OK, 1 row affected (0.01 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydatabase |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql>
Please refer to the MySQL official documentation for further details.
0.0.3 NGINX
NGINX is a multifunction tool that can be used as a load balancer, web server, content cache, and more.
To make changes to the NGINX configuration, edit the file /etc/nginx/nginx.conf
. To reload the modified configuration file into the NGINX service run sudo service nginx restart
. Users have limited sudo
access to start, stop, restart, and check the status of NGINX.
0.0.3.1 Quick start
To do a short test, put the following into /etc/nginx/nginx.conf
(back up the default file if desired):
events {
}
http {
server {
listen 80;
root /scratchlocal/test;
}
}
Then save the following file to /sratchlocal/test/index.html
:
<h1 id="test-successful">Test Successful!</h1>
<p>All is well</p>
Restart NGINX with sudo service nginx restart
. If you then enter the IP address into a web browser, you should see something similar to:
Test Successful!
All is well
If you are able to complete all of these steps, you should be able to make your own custom NGINX service.
0.0.4 MongoDB
MongoDB is a rich document-oriented NoSQL database. After creating and starting a MongoDB VM, check its IP address and use ssh
command to log in. All the MongoDB commands are available immediately upon login and the base server starts running immediately.
If you are a complete beginner to MongoDB, take a look at the tutorial provided by W3Schools.