Kunpeng came, .NETCore-3.1 in EulerOS trial

In EulerOS trial .NETCore-3.1

Foreword

EulerOS actually come out for some time, has been concerned about, just stay single is just waiting to see the stage, there is no access plan; after the garden just to see the brothers shared activities Huawei cloud free trial, hard to press excitement, I immediately tried to apply a single server. Let's look at the official presentation (chuixu)

EulerOS是具备高安全性、高可扩展性、高性能、开放的企业级Linux操作系统平台,能够满足客户从传统IT基础设施到云计算服务的各种需求。EulerOS对ARM64架构提供全栈支持,打造完善的从芯片到应用的一体化生态系统。

For a server operating system, it can be said that this introduction is in place, and secure, high-performance, open (said to be the end of the open-source?), Based on Linux, coupled with the Huawei family bucket, in fact, still looks pretty tempting a.

Apply for trial

Try to apply the address is: https: //activity.huaweicloud.com/free_test/index.html, I actually try to see the prize? After reading the detailed description is to write trial experience, it does not matter, that winning is the way of things, say Mate20 not quite fragrant.

If you are going to write the students experience report, be sure to choose KCl, and then select the operating system: EulerOS, these preparations are completed, to pay directly into the console after waiting for the host created it

The process of waiting a bit boring, we can go and see the installation documentation EulerOS: https: //obs.cn-north-1.myhuaweicloud.com/hweuleros/doc/cn/2.3/EulerOS%20V2.0SP3%20%E5% AE% 89% E8% A3% 85% E6% 8C% 87% E5% 8D% 97% EF% BC% 88for% 20ARM64% EF% BC% 89.pdf

Once the host is created, it will update the list of hosts, there will be a remote IP address and remote login button will become available.

Remote Login

Management console interface, a Web console login by clicking on the "Remote Login" button, enter the account password will appear the properties of black console command line interface, there is a good habit we going to do, that is, after the installation is complete, take a look at system-related information

Enter cat / proc / version

cat /proc/version 
Linux version 4.19.36-vhulk1905.1.0.h276.eulerosv2r8.aarch64 (abuild@szxrtosci10000) (gcc version 7.3.0 (GCC)) #1 SMP Mon Apr 1 00:00:00 UTC 2019

Enter the CentOS command: hostnamectl

[root@ecs-kc1-small-1-linux-20191213102631 ~]# hostnamectl 
 Static hostname: ecs-kc1-small-1-linux-20191213102631
       Icon name: computer-vm
         Chassis: vm
      Machine ID: 678c78faca6d40c283240a5da1680b2c
         Boot ID: 665694f713614100b7b86dd8550eb92a
  Virtualization: kvm
Operating System: EulerOS 2.0 (SP8)
          Kernel: Linux 4.19.36-vhulk1905.1.0.h276.eulerosv2r8.aarch64
    Architecture: arm64

好奇怪,全支持各种 CentOS 命令,具体原因是什么,咱也不知道咱也不敢问,挺好,不用学习新命令。既然如此,那就先来一个: yum update ,也很好,完全支持!
既然看起来一切和CentOS差不太多,那安装 .NETCore 应该也是可以安装CentOS来了,下面试试:

[root@ecs-kc1-small-1-linux-20191213102631 ~]# rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
Retrieving https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:packages-microsoft-prod-1.0-1    ################################# [100%]

安装SDK

[root@ecs-kc1-small-1-linux-20191213102631 ~]# yum install dotnet-sdk-3.1
packages-microsoft-com-prod                                                                                                                                                                                      294 kB/s | 762 kB     00:02    
Last metadata expiration check: 0:00:01 ago on Fri 13 Dec 2019 02:51:13 PM CST.
Error: 
 Problem: conflicting requests
  - package dotnet-sdk-3.1-3.1.100-1.x86_64 does not have a compatible architecture
  - nothing provides aspnetcore-runtime-3.1 needed by dotnet-sdk-3.1-3.1.100-1.x86_64
  - nothing provides dotnet-runtime-3.1 needed by dotnet-sdk-3.1-3.1.100-1.x86_64
  - nothing provides aspnetcore-targeting-pack-3.1 needed by dotnet-sdk-3.1-3.1.100-1.x86_64
  - nothing provides dotnet-targeting-pack-3.1 needed by dotnet-sdk-3.1-3.1.100-1.x86_64
  - nothing provides dotnet-apphost-pack-3.1 needed by dotnet-sdk-3.1-3.1.100-1.x86_64
  - nothing provides netstandard-targeting-pack-2.1 >= 2.1.0 needed by dotnet-sdk-3.1-3.1.100-1.x86_64

卧槽出错了,不过没关系,手动档我贼溜。

手动安装

执行下面的命令,下载 Linux arm64 包包后进行解压安装

mkdir /opt/dotnet31
cd /opt/dotnet31
wget https://download.visualstudio.microsoft.com/download/pr/5a4c8f96-1c73-401c-a6de-8e100403188a/0ce6ab39747e2508366d498f9c0a0669/dotnet-sdk-3.1.100-linux-arm64.tar.gz
tar -zxvf dotnet-sdk-3.1.100-linux-arm64.tar.gz

检查是否成功

[root@ecs-kc1-small-1-linux-20191213102631 dotnet31]# /opt/dotnet31/dotnet --version
3.1.100

这回真的是Euler。你看都到这一步了,干脆就弄个环境变量是吧,执行命令

vi /etc/profile
// 定位到文件末尾,加入下面的命令

PATH=$PATH:/opt/dotnet31
export PATH

保存,执行 source /etc/profile 使其生效

创建一个.NETCore项目

mkdir /home/dotnetDemo
cd /home/dotnetDemo
dotnet new webapi

由于默认启用了https,为了避免不要的麻烦,我们需要手动关闭https,编辑 vi Properties/launchSettings.json,将sslPort设置为0,applicationUrl中只保留 http 的地址即可。

{
   ...
  "iisSettings": {
    "iisExpress": {
      "sslPort":0
    }
  },
  "profiles": {
     ...
    "dotnetDemo": {
      ...
      "applicationUrl": "http://localhost:5000",
    }
  }
}

运行项目dotnet run

访问项目接口

.NETCore3.1生成的webapi项目自带了天气预报的demo,再也不是2.0中那种无意义的valu1/value2了(比心)

结束语

整体来说,在终端上的操作体验,和CentOS几乎没有差别,我就是找不到包管理的官方文档,所以只好手动安装了,EulerOS作为鲲鹏的标配,感觉还是有所期待的,但是从OS的技术层面来说,EulerOS还需努力,广大的程序员们不用太担心,国产操作系统已在持续发力中,给点时间,我们应该可以做得更好。

Guess you like

Origin www.cnblogs.com/viter/p/12036815.html