Quickly learn programming skills

foreword

When learning a technology, everyone is accustomed to running and testing in the local environment, which can meet most of the needs. However, in advanced learning or actual work, we often encounter some problems and need to use When using an external network or a stable environment, such as:

  1. In the development stage, conduct joint debugging interface with colleagues in other places; receive receipt information, etc.
  2. Test the performance of the interface, test the stability of the interface under high concurrency conditions, etc.

At this time, if you have one or more cloud servers, you can easily solve the problem.
However, cloud servers are expensive, and it must be stressful to pay for them yourself. Here is a way to solve the problem quickly and at a low cost.
I often use Alibaba Cloud's ECS preemptive instances , which are cheap. For example, a 2cpu+16G server costs only 10 cents an hour. When it is used up, it is released. It only costs a few days for breakfast.

premise

When using preemptible instances, there are two prerequisites:

  1. Have an Alibaba Cloud account
  2. There needs to be no less than 100 yuan in the account (don’t be reluctant to give up these few dollars, believe in yourself, if you spend a few hundred yuan, you will get far more than you paid.)

Create steps

1. Create a preemptive instance

insert image description here

Enter the home page, click login

insert image description here

Enter the account password and click Login

insert image description here

Click on the console

insert image description here

First click the option button on the upper left of the console page, and then select the ECS server in the cloud server to enter the server control page

insert image description here

Click to create an instance

insert image description here

1. Choose preemptible instances (much cheaper than Pay-As-You-Go and Subscription).
2. Select the required configuration (I often use it, and found that the 2U16G configuration is the cheapest and sufficient)
3. Select the configuration (choose different configurations, different specifications of servers have different configurations, not in the production environment, mainly focus on cpu and memory that is Yes, remember not to choose a burst instance)
4. Display the current price.

insert image description here

5. Select the unusable duration, otherwise the instance will be released when you are not paying attention. Of course, if you choose Unable to confirm the duration, the price will be lowered again.
6. Choose the system version, most of them will use centos7, of course you can also use windows or ubuntu
7, the default selection is to release the hard disk with the instance.
8. Select the next step and select the network

insert image description here

9. Select the network, use it for the first time, you need to create a network, go to the console to create
10, public network ip, this is selected according to needs. It is best to select it, because if you create a cloud service and connect through a proxy, it will be too troublesome.
Note here: To choose a plan to use traffic billing, the cost of 1G is 0.8 yuan, Alibaba Cloud's traffic billing is: inbound traffic is free, and there is no bandwidth limit, outbound traffic is billed, and the bandwidth size is the set bandwidth. In layman's terms: the traffic sent to the server is free, and the server responds with traffic billing.
11. Select a security group. If it is a new account, you also need to create a new security group. Click New Security Group to create a new one.
12. Select an elastic network card. If it is a new account, you also need to add an elastic network card.
13. The cost of the current configuration. 0.081 yuan per hour, 1G external network traffic: 0.8 yuan
14. Enter the system settings

insert image description here

15. Set a password, enter the password of root, and use it for ssh login, or you can log in directly using the web console without setting it.
16. Confirm order

insert image description here

17. Check the service agreement, there is no way, you must agree to use it.
18. Create an instance, and click Management Console.

insert image description here

2. Connect to the cloud server

insert image description here

1. The external network ip address of the cloud server (when you read this article, the server has been released, haha)
2. The internal network ip address of the cloud server
3. Remote connection

insert image description here

4. Click Login Now. Log in from this entrance, you can use the intranet to log in, and there will be no charges for using public network traffic (of course, this fee can be ignored)

insert image description here

5. Select intranet login
6. Enter password

insert image description here

This completes the login and use of the server. Of course, you can also use other ssh connection tools, just use the public network ip, root and password.

3. release

After use, it needs to be released, or if you don’t have time for the time being, you can study it after two days. If you don’t want to throw away half of the things you have studied, it can also be operated.

  • First teach you how to suspend (if you suspend, restart, the public network ip may change, but the internal network ip will not change)
    insert image description here

1. Select the instance
2. Click stop
3. Select the saving shutdown mode in the pop-up window (the original shutdown is free of charge). At this time, there will be a fee, but the fee is very low and can be ignored

In this way, the current environment can be saved, and the research can be continued when there is time, and the cost can also be saved.

  • release instance
    insert image description here

Just choose to force stop directly, so that you will not be charged.

Summarize

In this way, a low-cost, convenient and fast cloud environment can be obtained. Of course, it is best to buy your own server during the event. It can be used by yourself for a long time, especially in daily use. For example: 1. Build your own database and use it in the local
environment Building a database will slow down your computer.
2. Build intranet penetration, so that you can access company computers and servers at home. Of course, you can also map the test environment of the intranet to the public network environment for other people to use.
3. Use the Internet in a civilized manner.
4. Research advanced technical solutions: build a k8s platform, build a devops process environment, remotely locate and solve system bugs, etc.

Guess you like

Origin blog.csdn.net/zhijiesmile/article/details/127253633