wordpress如何修改不用邮箱注册,常州市网站优化,游戏源代码交易平台,网站购买后如何做注意#xff1a;文章中提到的命令行工具即是Windows Terminal/PowerShell/cmd其中的一个#xff0c;推荐使用Windows Terminal运行命令行工具的时候建议以管理员身份#xff0c;避免踩坑为了保证操作顺畅#xff0c;建议使用PowerShell先执行一下set-ExecutionPolicy Remot… 注意文章中提到的命令行工具即是Windows Terminal/PowerShell/cmd其中的一个推荐使用Windows Terminal运行命令行工具的时候建议以管理员身份避免踩坑为了保证操作顺畅建议使用PowerShell先执行一下set-ExecutionPolicy RemoteSigned安装Docker因为Dapr CLI默认会在Docker内启动 redis、zipkin、placement。当然这些也不是必须要安装的只是推荐安装可以体验Dapr的完整能力方便后续章节的学习。下载并安装Docker Desktophttps://www.docker.com/products/docker-desktop安装WSL2使用命令行工具执行命令wsl --instal如果不能使用wsl直接安装的话可以手动安装运行PowerShell并执行下面两句命令dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart如果你再次遇到错误提示0x800f080c 功能名称 VirtualMachinePlatform 未知。请保证自己的操作系统版本在Windows 10 build 18917以上重启电脑后下载WSL2内核https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi运行命令行工具设置默认使用WSL2wsl --set-default-version 2下载Ubuntu 20.04https://www.microsoft.com/store/apps/9n6svws3rx71设置Docker使用WSL2你“可能”需要一个小工具不能说的秘密看文件名猜功能https://github.com.cnpmjs.org/dotnetcore/FastGithub/releases/download/2.0.4/fastgithub_win-x64.zip安装Dapr CLI官方解释Dapr CLI 是您用于各种 Dapr 相关任务的主要工具。您可以使用它来运行一个带有Dapr sidecar的应用程序 以及查看sidecar日志、列出运行中的服务、运行 Dapr 仪表板。CLI是必须要安装吗其实也不是但新手不建议去体验这些骚操作。后续文章会讲解脱离dapr cli工作。运行Windows Terminal或PowerShell执行命令这里要耐心等待一下iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex如果是cmd执行下面命令powershell -Command iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex验证安装重新打开命令行工具执行命令dapr看到下面的提示即安装正确______/ /___ _____ _____/ __ / __ / __ \/ ___// /_/ / /_/ / /_/ / /\__,_/\__,_/ .___/_//_/
Distributed Application RuntimeUsage:dapr [command]Available Commands:completion Generates shell completion scriptscomponents List all Dapr components. Supported platforms: Kubernetesconfigurations List all Dapr configurations. Supported platforms: Kubernetesdashboard Start Dapr dashboard. Supported platforms: Kubernetes and self-hostedhelp Help about any commandinit Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hostedinvoke Invoke a method on a given Dapr application. Supported platforms: Self-hostedlist List all Dapr instances. Supported platforms: Kubernetes and self-hostedlogs Get Dapr sidecar logs for an application. Supported platforms: Kubernetesmtls Check if mTLS is enabled. Supported platforms: Kubernetespublish Publish a pub-sub event. Supported platforms: Self-hostedrun Run Dapr and (optionally) your application side by side. Supported platforms: Self-hostedstatus Show the health status of Dapr services. Supported platforms: Kubernetesstop Stop Dapr instances and their associated apps. . Supported platforms: Self-hosteduninstall Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hostedupgrade Upgrades a Dapr control plane installation in a cluster. Supported platforms: KubernetesFlags:-h, --help help for dapr-v, --version version for daprUse dapr [command] --help for more information about a command.初始化Dapr使用命令行工具执行命令dapr init如此之外还有一个精简版的安装方式dapr init --slim看看官方解释slim在此模式下安装了两个不同的二进制文件 daprd 和 placement。placement是给actor用的之前有提到过。在此模式下不会为状态管理或发布/订阅安装任何默认组件如 Redis那就只能用服务调用。其他的需要用户自己设置环境和自定义组件。说白了你只用服务调用那slim是可以的否则的话你需要手动配置来解决CLI代替你做的那部分工作。验证Dapr版本dapr --version当前时间下我的版本是CLI version: 1.4.0
Runtime version: 1.4.3验证容器docker psdapr init的容器是包括dapr_placement, dapr_redis, dapr_zipkin验证组件目录打开目录%USERPROFILE%\.dapr\看到如下结构即代表安装完成运行一个示例代码看看效果运行环境准备vs 2022/2019建议直接上VS2022体验64位VShttps://visualstudio.microsoft.com/zh-hans/vs/preview/#download-preview.net 6如果你用的不是vs2022需要自行安装.net 6https://download.visualstudio.microsoft.com/download/pr/5bc3c525-d6d5-4370-8468-e44a1b948c03/fe758c9942966b88b52d92ce2823f6c0/dotnet-sdk-6.0.100-rc.2.21505.57-win-x64.exe从Github下载示例代码使用命令行工具克隆代码库到本地ssh推荐用下面的命令git clone gitgithub.com:doddgu/dapr-study-room.githttps用下面的命令git clone https://github.com/doddgu/dapr-study-room.git没有git的需要先安装一下git具体教程可以自行百度https://github.com/git-for-windows/git/releases/download/v2.33.1.windows.1/Git-2.33.1-64-bit.exe使用Dapr运行.Net示例代码使用命令行工具跳转到源码目录dapr-study-room\Assignment03\Assignment.ServerTips在资源管理器找到源码目录Win 11可以右键空白区域 - 在Windows终端中打开即可Win 11以下在资源管理器输入cmd执行命令dapr run --app-id assignment-server --app-port 5038 dotnet run可以先不用了解命令行的意思后续章节会讲解看到输入内容如下即运行成功 APP info: Microsoft.Hosting.Lifetime[14]APP Now listening on: https://localhost:7038APP info: Microsoft.Hosting.Lifetime[14]APP Now listening on: http://localhost:5038APP info: Microsoft.Hosting.Lifetime[0]APP Application started. Press CtrlC to shut down.APP info: Microsoft.Hosting.Lifetime[0]APP Hosting environment: DevelopmentAPP info: Microsoft.Hosting.Lifetime[0]APP Content root path: D:\Project\OpenSource\dapr-study-room\Assignment03\Assignment.Server
time2021-10-27T18:06:11.842260508:00 levelinfo msgapplication discovered on port 5038 app_idassignment-server instanceSSHZ014 scopedapr.runtime typelog ver1.4.3
time2021-10-27T18:06:11.878894908:00 levelinfo msgapplication configuration loaded app_idassignment-server instanceSSHZ014 scopedapr.runtime typelog ver1.4.3
time2021-10-27T18:06:11.880398208:00 levelinfo msgactor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s app_idassignment-server instanceSSHZ014 scopedapr.runtime.actor typelog ver1.4.3
time2021-10-27T18:06:11.884448508:00 levelinfo msgdapr initialized. Status: Running. Init Elapsed 1830.3305ms app_idassignment-server instanceSSHZ014 scopedapr.runtime typelog ver1.4.3
time2021-10-27T18:06:11.892083508:00 levelinfo msgplacement tables updated, version: 0 app_idassignment-server instanceSSHZ014 scopedapr.runtime.actor.internal.placement typelog ver1.4.3还有一个验证方式使用命令行工具执行命令dapr list其中APP IDAPP PORTCOMMAND是不变的其余都是变的APP ID HTTP PORT GRPC PORT APP PORT COMMAND AGE CREATED PIDassignment-server 49948 49949 5038 dotnet run 13m 2021-10-27 18:06.09 22596调用Dapr API重新打开一个命令行工具测试Dapr API再打开一个命令行工具dapr invoke --app-id assignment-server --method hello验证运行是否成功执行dapr inovoke的命令行窗口输出如下App invoked successfully执行dapr run的命令行窗口输出如下 APP Hello World!这个Hello World就是Assignment.Server的API /hello 打印出来的此时你的环境已经ok且第一个示例也运行成功了给自己点个赞吧在这个环境的搭建过程中可以看到dapr还有点“稚嫩”毕竟现在才1.4版本还有很长的路要走但是这并不妨碍他带来的一些思想的进步如果你错过了微服务的第一波浪潮也错过了Service Mesh那分布式应用运行时Dapr可以作为你新的起点本章源码Assignment03https://github.com/doddgu/dapr-study-room我们正在行动新的框架、新的生态我们的目标是自由的、易用的、可塑性强的、功能丰富的、健壮的。所以我们借鉴Building blocks的设计理念正在做一个新的框架MASA Framework它有哪些特点呢原生支持Dapr且允许将Dapr替换成传统通信方式架构不限单体应用、SOA、微服务都支持支持.Net原生框架降低学习负担除特定领域必须引入的概念坚持不造新轮子丰富的生态支持除了框架以外还有组件库、权限中心、配置中心、故障排查中心、报警中心等一系列产品核心代码库的单元测试覆盖率90%开源、免费、社区驱动还有什么我们在等你一起来讨论经过几个月的生产项目实践已完成POC目前正在把之前的积累重构到新的开源项目中目前源码已开始同步到Github文档站点在规划中会慢慢完善起来MASA.BuildingBlocksMASA.ContribMASA.UtilsMASA.EShopBlazorComponentMASA.BlazorQQ群7424099微信群加技术运营微信MasaStackTechOps备注来意邀请进群