How to install and configure AppScale on Ubuntu 12.04

Introduction

AppScale is an open source computing platform designed to deploy Google App Engine applications on public clouds, private clouds and on-premises clusters. AppScale is fully compatible with Google App Engine API and supports Python, Go, PHP and Java. With AppScale, you can migrate existing applications to any cloud computing platform. Below you will find a list of open source components used to provide services for a given API.

Course Preparation

In this tutorial, you will need:

In addition to the 2 GB RAM that AppScale uses when it is idle, AppScale requires at least 2 GB of RAM to compile the required components. For standard application deployment, it is strongly recommended to use at least 4 GB of RAM. You can use 2 GB Tencent CVM with swap file. However, this is beyond the scope of this tutorial.

At the time of writing, AppScale only provides official support for Ubuntu 12.04. If you modify the build script, you can install it on Ubuntu 14.04. However, this is beyond the scope of this tutorial and may not be supported by the community.

The first two steps of installing AppScale and AppScale Tools must be run as a root user. The remaining steps can be run as a non-root user.

Step 1-Install AppScale

For the first two parts, we will run all commands as the root user. If you connect to the server as a sudo user, enter the root shell:

sudo su

First, update the apt-get package index:

apt-get update

We are now ready to install AppScale. We will compile AppScale from source code. Please note that compiling the source code can be very time consuming. It is expected that this process will take 15 minutes or more to complete.

Make sure you are in the /root directory:

cd /root

Install Git so you can use it to download the AppScale source code:

apt-get install -y git-core

Clone the AppScale source code from GitHub:

git clone git://github.com/AppScale/appscale.git

Change to the appscale/debian directory and run the build script.

**Note: **This process will take some time. The build script will install any missing dependencies and compile the AppScale source code.

cd appscale/debian
bash appscale_build.sh

Step 2-Install AppScale Tools

AppScale tools are used to manage AppScale clusters and deploy applications. These tools can be installed on the local computer or server. For simplicity, we will install these tools on our server. The installation process on Mac OS X and Windows is very similar. You need to use Cygwin on Windows. For more information, see GitHub Page.

Go back to the /root directory:

cd /root

Clone the AppScale Tools source code from GitHub:

git clone git://github.com/AppScale/appscale-tools.git

Change to the appscale-tools/debian directory and run the build script.

**Note: **This process will take some time. The build script will install any missing dependencies and compile the AppScale Tools source code.

cd appscale-tools/debian
bash appscale_build.sh

After the build script is complete, it is a good idea to restart.

reboot

Step 3-Configure AppScale deployment

For the rest of this tutorial, you can run AppScale Tools as any user. This does not need to be a sudo user. However, when you start AppScale for the first time, you need to know the password of the root user. AppScale will automatically create an authentication certificate, and the root password will no longer be required when using AppScale Tools in the future.

After the server reboots, you have established an SSH connection, and you need to configure the AppScale deployment. The AppScale tool requires a configuration file every time the tool set is run. In this step, we will create a configuration file named AppScalefile, start AppScale, and configure an administrator account.

Make sure you are in the user's home directory:

cd ~

Create the initial AppScalefile configuration file:

appscale init cluster

Now, we add the IP address of the server to the AppScalefile.

Open the file with nano:

nano AppScalefile

At the top of the file, you will see the following section:

# The deployment strategy(roles -> machines) that should be used inthis
# AppScale deployment.
# The following is a sample layout for running everything on one machine:
ips_layout :
 master : your_server_ip
 appengine : your_server_ip
 database : your_server_ip
 zookeeper : your_server_ip

Replace the default IP address with the IP address of the server. After editing the file, press CTRL-X, press Y to save, and then press ENTER to overwrite the existing file name.

Now we can start AppScale from the directory where the AppScalefile was just created:

appscale up

AppScale will ask you to verify the host fingerprint and root password.

The authenticity of host '111.111.111.111 (111.111.111.111)' can't be established.
ECDSA key fingerprint is ab:3a:f0:87:c8:4e:8c:ba:59:0e:06:64:1b:f6:fe:e8.
Are you sure you want to continueconnecting(yes/no)? yes

Type yes and press ENTER. Then, you will see the following:

[email protected]'s password:

Enter the root user password and press Enter.

After entering the correct root password, you will see the following:

Generated a newSSH key forthis deployment at /root/.appscale/appscale69de89364b624a8a9be1b7f45ac23d40
Starting AppScale 2.3.1 over a virtualized cluster.
Log in to your head node: ssh -i /root/.appscale/appscale69de89364b624a8a9be1b7f45ac23d40.key [email protected]
Head node successfully initialized at 111.111.111.111. It is now starting up cassandra.
Copying over deployment credentials
Starting AppController at 111.111.111.111
Please wait for the AppController to finish pre-processing tasks.
​
Please wait for AppScale to prepare your machines for use.
AppController just started

When starting AppScale, it seems to hang AppController just started. This is normal. It may take some time for all AppScale components to initialize.

Eventually, you will see the following:

UserAppServer is at 111.111.111.111
Enter your desired admin e-mail address:

Create an administrator user account. Enter the user’s email address and provide the password. Remember these details. You will need them to access the AppScale management panel.

After creating an administrator user account, you will see:

Creating newuser account [email protected]
Creating newuser account [email protected]
Your XMPP username is [email protected]
Granting admin privileges to [email protected]
AppScale successfully started!
View status information about your AppScale deployment at http://111.111.111.111:1080/status

AppScale will provide you with a link to the management panel. The following format is usually used. Usually, the http address will be automatically redirected to a secure https address.

http://your_server_ip:1080/status
https://your_server_ip:1443/status

Step 4-AppScale Management Panel

Open the AppScale management panel in your browser. It should provide you with a link after starting AppScale:

http://your_server_ip:1080/status

You may be prompted to accept the self-signed certificate.

In the AppScale management panel, users can create their own account by clicking "Create Account". However, you need to use an administrator account to change its permissions before you can upload and delete your apps.

Click the "Login" button in the upper right corner. The Login button may look different on the small screen, but it is still green.

Log in using the administrator email and password you set in the previous step. Then, you will see the AppScale status page.

The management panel allows you to access server statistics and application statistics. You can also deploy and delete applications. Deploying the application from the management panel is very simple. For the purpose of this tutorial, we will learn how to deploy an application from the command line. After you finish exploring the management panel, proceed to the next step.

Step 5-Deploy your first application

AppScale provides a set of sample applications that can be deployed. These applications are a great way to test AppScale clusters. They also familiarize you with the application deployment process.

You should use the same user account, and your current directory should contain AppScaleFile. This file contains all the configuration required for AppScale to manage the deployment.

Make sure we go back to the user's home directory:

cd ~

Clone the sample application source code from GitHub to create the Guestbook App:

git clone https://github.com/AppScale/sample-apps.git

You will see the following source code download:

Cloning into 'sample-apps'...
remote: Counting objects:15742, done.
remote: Total 15742(delta 0), reused 0(delta 0), pack-reused 15742
Receiving objects:100%(15742/15742),318.96 MiB |23.52 MiB/s, done.
Resolving deltas:100%(4944/4944), done.

Guestbook App is a great way to test data storage and authentication APIs.

Deploy the application:

appscale deploy sample-apps/go/go-guestbook/

You will be asked to assign an email address to the application. Enter the email address and press Enter.

Enter your desired e-mail address: [email protected]

This can be any email address. If the user does not exist in the database, the system will prompt you to set a password. For the purpose of this tutorial, we decided to use an administrator account.

Next, you will see the following:

Uploading initial version of app guestbookgo
We have reserved guestbookgo for your app
Tarring application
Copying over application
Please wait for your app to start serving.
Waiting 1second(s) to check on application...
Waiting 2second(s) to check on application...
Waiting 4second(s) to check on application...
Waiting 8second(s) to check on application...
Waiting 16second(s) to check on application...
Your app can be reached at the following URL: http://111.111.111.111:8080

Open the URL provided in the browser, and you will get the service of the guestbook application. If you are still logged into AppScale, the guestbook application will use your email address. If you return to the AppScale management panel and log out, it will sign the guestbook as an anonymous user.

To update the application, just use the appscale deploy command again. AppScale will automatically detect and update existing applications. You must use the same email address that already owns the application. If you want to change the ownership, you can delete and redeploy the application.

If you want to run multiple versions of the same application side by side, you need to change the name of the application in the app.yaml file. This is the main configuration file of the application and it is located in the root directory of the application.

To delete an application, you can use the following command (replace guestbookgo with the ID AppScale assigned to your application during deployment):

appscale remove guestbookgo

You can also delete and deploy applications from the AppScale management panel.

Troubleshooting

AppScale is a very complex platform, and things can go wrong. We will introduce some steps you can take to help resolve some of the most common mistakes. It is recommended that you read the official AppScale troubleshooting page for more detailed information.

If you can't find a solution to the problem, AppScale will have a very active mailing list. Make sure that when submitting a topic to the mailing list, you need to include as much detail as possible and a copy of the log file. You will be more likely to solve your problem quickly.

Mandatory cleanup of AppScale state

The appscale clean command is used to force the VM to a clean state, thus eliminating any configuration issues.

appscale clean

This script will also forcefully terminate all AppScale related processes. If you encounter problems during the initial deployment, please try this before contacting the mailing list. This command can usually solve any configuration problems. Then, you can run appscale up again to redeploy AppScale.

appscale up

AppScale log files

The appscale logs command will collect log files from all nodes in the AppScale deployment and copy them to the specified directory.

appscale logs directory/

The log files can be accessed directly in the /var/log/appscale directory.

cd /var/log/appscale

If the appscale logs command fails for some reason, you will want to access the logs in this way. However, for multi-node deployments, you need to do this on each server, which is why it is recommended that you use the AppScale tool to collect log files.

The appscale tail command will provide real-time readings of the AppScale logs in the deployment. This is useful for real-time monitoring of applications and connection issues.

appscale tail

Debug AppScale deployment

When debugging an AppScale deployment, we should be interested in three main logs.

in conclusion

We installed and configured AppScale for a single server deployment. We learned how to deploy and delete applications. We also tested our deployment by signing the guestbook application. Signing the Guestbook App proves that many APIs are working properly. We can now use this AppScale installation to deploy custom applications based on Google App Engine.

For more Ubuntu tutorials, please go to Tencent Cloud + Community to learn more.


Reference: "How To Install and Configure AppScale on Ubuntu 12.04" tu 12.04"

Recommended Posts

How to install and configure AppScale on Ubuntu 12.04
How to install and configure NATS on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure Ansible on Ubuntu 18.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install Pycharm and Ipython on Ubuntu 16.04/18.04
How to install and configure Elasticsearch on CentOS 7
How to install and use Docker on Ubuntu 20.04
How to install and configure VNC on CentOS 8
How to install and use Composer on Ubuntu 18.04
How to install and use Wine on Ubuntu 18.04
How to install and secure phpMyAdmin on Ubuntu 16.04
How to install and configure Redis on CentOS 8
How to install and use Composer on Ubuntu 20.04
How to install and use BaasBox on Ubuntu 14.04
How to install and use PostgreSQL on Ubuntu 16.04
How to install and configure phpMyAdmin on CentOS 6
How to install and configure Owncloud on CentOS 8
How to install and use Docker on Ubuntu 16.04
How to install and configure Redmine on CentOS 8
How to install Ruby on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
Install and configure MySQL on Ubuntu
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to install Anaconda3 on Ubuntu 18.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install KVM on Ubuntu 18.04
How to install KVM on Ubuntu 20.04
How to install opencv3.0.0 on ubuntu14.04
How to install Prometheus on Ubuntu 16.04
How to install Jenkins on Ubuntu 18.04
How to install R on Ubuntu 20.04
How to install Moodle on Ubuntu 16.04
How to install Solr 5.2.1 on Ubuntu 14.04
How to install Teamviewer on Ubuntu 16.04
How to install MariaDB on Ubuntu 20.04
How to install Nginx on Ubuntu 20.04