8
头图

This is why's original article 107

Hello, I am why.

What did you do this past weekend, did you roll it up or lie flat?

I actually wanted to lie flat, but I accidentally found a learning website. I was attracted by this website, and then I rolled up with the website.

It's really a very good website, good stuff, I want everyone to share it, so I decided to "expose" it.

Before introducing this website, let me ask you a question:

Arthas, a Java program diagnostic tool, do you know?

I believe that most of the students know this, but there are also a large number of students who are only at the stage of "talking on paper".

I haven't actually operated it myself.

why?

I guess when you first learned about Arthas, you must have been attracted by its various cool operations and pages.

I thought: Damn it, so 6?

.png)

I was enthusiastic about preparing for practical exercises, and I saw the results: I need to build a demo by myself, throw the demo on the server and run it, and then install Arthas on the server to analyze it.

This set of operations is no problem for most people.

But there are still quite a few students who don't have a server of their own.

It is difficult for a clever woman to cook without rice.

The first step was stuck.

There are limited conditions for practical exercises.

So this matter was stranded and left alone. Since I hadn't done it in practice, I almost forgot about the various sorrows of Arthas.

There is no demo, no server, no server with a good environment.

This kind of problem often occurs, and it can be regarded as the "last mile" problem encountered in learning.

The website I came across was to solve the "last mile" problem.

Maybe it is not perfect, but at least the support on Arthas is already impeccable, real hand-to-hand teaching.

After so much foreshadowing, what is a website?

It is the following website:

https://start.aliyun.com/

Know Action Lab is a cloud-native open source technology experience platform developed by Alibaba Cloud, a subsidiary of Alibaba.

It comes with its own operating environment.

Users only need to care about the content of the tutorial itself, without wasting time for tedious preparations for the operating environment. All experiments are run in a container with a pre-prepared operating environment.

It has an immersive learning experience.

The three windows of interactive document, terminal, and editor are integrated into one browser page, so there is no need to copy and paste back and forth in multiple windows.

It can automatically execute commands and code automatically with one key.

The document can be interactive in real time, and you can automatically execute commands and code automatically modify operations with one click of the mouse; you can also choose to manually enter in the terminal or editor to view the effect.

I know that the style of painting here looks a lot like an advertisement.

But I swear, I really do tap water, I really recommend it.

Do it, do it more

Know the action hand laboratory, look at the name, you know that the emphasis is on "the unity of action and knowledge", it is "hands".

I once saw an article by Ali called "I See the Growth Path of Technical People".

A 721 original was proposed in the article:

70% do middle school, 20% learn from others, 10% self-study

But as for the actual situation, we have to admit that self-study takes up a considerable proportion.

When everyone learns on their own, there is a common problem: just look, just think, and basically don't do it.

Regarding hands-on, what impressed me most was when I read this book:

I remember reading this book when I just graduated for more than a year.

At that time, I thought that technical books were quite expensive, and they were bought together with colleagues. One person paid half of the money, and the books were kept in the office for everyone to take a look at.

When I had time, I would look through this book.

The first time I read it, I felt: Wow, this is really a good book. It is full of knowledge points that I don't know.

But after reading it, not long after, I encountered a problem and thought for a long time: Uh, this problem seems to be mentioned in the book, why can't I remember it?

So I asked my colleagues: how do you read this book? I turned every page of the book some time ago, but now I can’t remember a lot of things.

He told me: First of all, read more. The amount of information in the book is still too large for you. It is normal for you to read it once and not to absorb it completely. Also, have you followed so many hands-on examples in the book? I did it all over and encountered various pits. The impression is naturally a little deeper.

It can be said to wake up the person in the dream in one word, I really haven't practiced it.

Not only I haven't done it before, but even when I see the specific commands in the actual operation part, I just glanced at it, because I don't think this part is important.

Later I watched it again. While watching this time, I started a few servers, followed the book and typed all the above commands.

The progress has been much slower, but the absorption has also been much more.

Over the past few years, and to this day, I still remember the scene when I went to the company to read this book during the weekend. I remember all kinds of weird problems I encountered when I followed the book to build a cluster. I still remember the 16,384 slots, and the redis-trib.rb that I couldn't run.

I remember that a few years later, the interviewer asked me: Do you know about Redis clusters? Have you ever set up clusters yourself?

Of course I remember. After all, when the guy with only one year of experience bit his head and set up a group, his mentality was broken several times.

There are also recent intermittently watching "45 Lectures on MySQL Practice", "How MySQL Works", and "High Performance MySQL".

There are actually a lot of examples in it, especially 45 lectures, good things, the teacher is all based on cases.

When I watched it, it was very slow. Regardless of whether I understood it or not, I first opened a few windows, then prepared the SQL for the experiment and followed the teacher step by step.

In short, it is to do it. Hands-on is the only way to learn new technologies.

To learn by doing is to do it and learn by doing.

However, most of the time when I started it was spent preparing for the environment, which resulted in a slight inefficiency.

And this website, on some projects, solved this problem.

Know Action Hand Lab

Go back to the Know Action Hand Lab and take everyone to visit this website.

To be honest, there are not too many things on this website at present, which means it took me a weekend to research a circle.

The main reason is that there are some open source projects that I don't know much about. I learned about it and broadened my horizons.

The main ones are some technology stacks under the Alibaba ecosystem. There are currently 16 tutorials:


As you can see, the first thing that catches the eye is Arthas, a diagnostic tool. After all, it is one of Ali's sons that is more promising.

Fully promote, not too much.

Arthas is divided into four tutorials, from introduction to practice.

Then comes the Spring Cloud Alibaba series of experiences:

The six small experiments in it, including distributed configuration, service registration and discovery, are all based on Nacos. RPC calls are based on Dubbo Spring Cloud, current limiting and fusing are based on Sentinel, distributed transactions are based on Seata, and distributed messaging is based on RocketMQ.

Basically covers the main modules of microservice development.

It is a complete experience.

Of course, there are some other practical tutorials for RocketMQ, Dapr, Dubbogo, ChaosBlade, and k8s, so I won't explain them one by one.

Everyone knows that there are these things in it at the moment.

Everyone mentioned above may be a little unfamiliar with Dapr and ChaosBlade.

Let me just say it briefly.

The full name of Dapr is Distributed Application Runtime, which translates to Distributed Application Runtime.

It is mainly for cloud-native services.

It should be a technology in the service grid. It is a runtime that supports k8s. The purpose is to better isolate the business and make the business less aware of infrastructure such as middleware.

In fact, it should be the istio architecture.

It should be noted that Dapr is an open source project initiated by Microsoft, not Ali.

Ali is an in-depth participant and early adopter of the Dapr open source project, which is equivalent to an endorsement of a major domestic manufacturer of Dapr.

ChaosBlade is an open-source experimental injection tool developed by Alibaba that follows the principles of chaos engineering and chaos experimental models to help companies improve the fault tolerance of distributed systems and guarantee business continuity during the process of companies going to the cloud or migrating to cloud-native systems.

Quoting its description on git:

https://github.com/chaosblade-io/chaosblade/blob/master/README_CN.md

The ecology of the project is as follows:

Currently supports so many scenarios:

For example, there are three experimental scenes in the Zhi Action Hand Lab:

In short, about ChaosBlade you have to remember one sentence:

It is here to destroy. Inject various faults into the system or the environment in which the system operates to test and improve the stability and high availability of the system.

In the Action Lab, in addition to the official tutorials mentioned earlier, it also supports everyone to upload tutorials by themselves.

The following situations are very suitable for posting tutorials on it:

  • Open source and developer communities publish introductory tutorials on open source projects in Zhixing to help your community users get started better
  • Authors of technical books publish your experiments with books on Zhixing, to make up for the shortcomings of technical books that can only be read but cannot be implemented.
  • The training institution publishes the first-of-course tutorials in Zhixing, and in conjunction with the existing course videos, your trainees can practice in Zhixing.

Think about it, if the experiment with the book in the "Redis Development and Operation and Maintenance" book I mentioned earlier can be published here, wouldn't it be beautiful?

The learning efficiency must have risen again.

Tutorials are one of the core functions of the laboratory.

However, it has another major function:

The Java project scaffolding, the following slogan is:

Java engineering scaffolding more suitable for developers in the Asia-Pacific region.

Although I still don't understand why it is "more suitable for the Asia-Pacific region", it sounds great anyway.

The page looks like this, isn't it familiar?

At first glance, the target is more familiar to everyone:

https://start.spring.io/

But through my actual use, I have to say that Ali's scaffolding is better to use.

For example, I use Ali's scaffolding and choose a sample code of a web project when building:

The project structure is as follows:

And this web project doesn't need to change a line of code, or even you don't need to start the database, it can run directly.

Because of the h2 database it uses:

After running, access the h2 console as follows:

Although I found a few bugs during the running of the Demo project, they are harmless and easy to modify. For beginners, it is still very friendly.

On this page I also found a project structure called COLA:

What is COLA?

https://github.com/alibaba/COLA/

I pulled a COLA demo on the official website and ran it. The project structure is as follows:

The official gave such a code structure diagram:

When I saw this, I probably understood that there are App layer, Domain layer, and Infrastructure layer. This architecture is actually a kind of implementation of DDD thinking.

After two days of brief understanding, I found that if I want to understand the abstract DDD idea, then the COLA architecture, I feel it is a good entry point.

Arthas tutorial

I have introduced so many things before, but I'll take you to practice it. The golden tutorial inside:

In fact, I don't think this is necessary, because the tutorial above is already a step-by-step teaching.

For example, if you look at this Arthas basic tutorial, I will record a screen for you:

On the left is the operating document, and on the right is the operating environment. What you get is what you get, how sweet it is.

I strongly recommend that you read all four tutorials by yourself and operate them.

But the focus can be placed in this tutorial:

Take a look at the 14 experiments in this tutorial:

They are all practical hand-to-hand teaching. The environment, scenes, and tools of others are prepared for you. You only need to pay attention to how to use this tool.

For example, the "Arthas Hot Update Code Case" is actually a problem often encountered in a production environment:

There is a problem with the judgment logic. I don't want to modify the code, repackage it, and then go online. What should I do?

What about Arthas hot update?

For example, the following code:

@GetMapping(value={"/user/{id}"})
public User findUserById(@PathVariable Integer id) {
    logger.info("id: {}", (Object)id);
    if (id != null && id < 1) {
        throw new IllegalArgumentException("id < 1");
    }
    return new User(id.intValue(), "name" + id);
}

Now an exception will be thrown when the requested id is less than 1. But after going online, we found that this place may return a default value after evaluation, and it would be better not to throw an exception.

Then we can use Arthas to hot update this code.

The left is after modification, and the right is before modification:

Specifically how to modify, how to use ClassLoader to load the modified code, there are detailed instructions for use in this case:

Of course, if you understand the working principle behind the hot update after the actual operation, then it would be great.

Know how to use it and master the principle of implementation. Congratulations, I will give my own set of a production case. There is an extra bonus point in the interview inadvertently.

In addition, quietly say a show operation.

You can find a tutorial, get a window, and...

For example, I install Redis:

It is also good to use:

And it also supports file upload and download:

Hey, it's just for fun anyway. You should be familiar with Linux commands.


why技术
2.2k 声望6.8k 粉丝