This download does NOT match an earlier download recorded in go.sum.

SECURITY ERROR

This download does NOT match an earlier download recorded in go.sum.

Networking

go clean -modcache

del go.sum

go mod tidy

Go modules: checksum mismatch

go.sum security error

go env

bash 复制代码
set GO111MODULE=
set GOARCH=amd64
set GOBIN=E:\usr\local\golang\go1.13\bin
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOENV=C:\Users\xxxAppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=E:\usr\local\golang\code\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=E:\usr\local\golang\code
set GOPRIVATE=
set GOPROXY=https://goproxy.io
set GOROOT=E:\usr\local\golang\go1.13
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=E:\usr\local\golang\go1.13\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.10
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=M:\GolandProjects\mosn-1.6.0\go.mod
set GOWORK=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=E:\tmp\go-build2946792011=/tmp/go-build -gno-record-gcc-switches

设置本机http代理

M:\GolandProjects\mosn-1.6.0>echo %http_proxy%

127.0.0.1:8226

M:\GolandProjects\mosn-1.6.0>echo %https_proxy%

127.0.0.1:8226

go mod tidy

新增admin用户添加到gousers组

* admin.sh

bash 复制代码
#!/usr/bin/bash

set -x

USER=admin
PASSWD=admin

groupadd gousers
useradd ${USER} -g gousers

echo ${USER}:${PASSWD} | chpasswd
echo ${USER} | passwd --stdin ${PASSWD}

chmod g+r,g+x /home/${USER}

chmod a+x ./admin.sh

sudo ./admin.sh

mosn

make build-local

[admin@vultr mosn-1.6.0]$ ./build/bundles/v1.6.0/binary/mosnd start -c ./build/bundles/v1.6.0/binary/mosn_config.json

或者用这个./configs/mosn_config.json配置文件

防火墙https://blog.csdn.net/fareast_mzh/article/details/137462544

允许34901端口

mosn.json

javascript 复制代码
{
	"servers":[
		{
			"default_log_path":"stdout",
			"routers":[
				{
					"router_config_name":"server_router",
					"virtual_hosts":[{
						"name":"serverHost",
						"domains": ["*"],
						"routers": [
							{
								"match":{"prefix":"/"},
								"route":{"cluster_name":"serverCluster"}
							}
						]
					}]
				},
				{
					"router_config_name":"client_router",
					"virtual_hosts":[{
						"name":"clientHost",
						"domains": ["*"],
						"routers": [
							{
								"match":{"prefix":"/"},
								"route":{"cluster_name":"clientCluster"}
							}
						]
					}]
				},
				{
					"router_config_name":"application",
					"virtual_hosts":[{
						"name":"appHost",
						"domains": ["*"],
						"routers": [
							{
								"match":{"prefix":"/"},
								"direct_response":{
									"status": 200,
									"body": "Welcome to MOSN!\nThe Cloud-Native Network Proxy Platform.\n"
								}
							}
						]
					}]
				}
			],
			"listeners":[
				{
					"name":"appListener",
					"address": "127.0.0.1:2047",
					"bind_port": true,
					"filter_chains": [{
						"filters": [
							{
								"type": "proxy",
								"config": {
									"downstream_protocol": "Http1",
									"router_config_name":"application"
								}
							}
						]
					}]
				},
				{
					"name":"serverListener",
					"address": "127.0.0.1:2046",
					"bind_port": true,
					"filter_chains": [{
						"filters": [
							{
								"type": "proxy",
								"config": {
									"downstream_protocol": "Auto",
									"router_config_name":"server_router"
								}
							}
						]
					}]
				},
				{
					"name":"clientListener",
					"address": "127.0.0.1:2045",
					"bind_port": true,
					"filter_chains": [{
						"filters": [
							{
								"type": "proxy",
								"config": {
									"downstream_protocol": "Http1",
									"router_config_name":"client_router"
								}
							}
						]
					}]
				}
			]
		}
	],
	"cluster_manager":{
		"clusters":[
			{
				"name":"serverCluster",
				"type": "SIMPLE",
				"lb_type": "LB_RANDOM",
				"max_request_per_conn": 1024,
				"conn_buffer_limit_bytes":32768,
				"hosts":[
					{"address":"127.0.0.1:2047"}
				]
			},
			{
				"name": "clientCluster",
				"type": "SIMPLE",
				"lb_type": "LB_RANDOM",
				"max_request_per_conn": 1024,
				"conn_buffer_limit_bytes":32768,
				"hosts":[
					{"address":"127.0.0.1:2046"}
				]
			}
		]
	},
	"admin": {
		"address": {
			"socket_address": {
				"address": "0.0.0.0",
				"port_value": 34901
			}
		}
	}
}

[admin@vultr ~]$ curl -i http://127.0.0.1:2046

HTTP/1.1 200 OK

Date: Thu, 25 Apr 2024 01:42:00 GMT

Content-Type: text/plain; charset=utf-8

Content-Length: 58

Host: 127.0.0.1:2046

User-Agent: curl/7.29.0

Accept: */*

Welcome to MOSN!

The Cloud-Native Network Proxy Platform.

[admin@vultr ~]$ curl -i http://127.0.0.1:2045

HTTP/1.1 200 OK

Date: Thu, 25 Apr 2024 01:42:02 GMT

Content-Type: text/plain; charset=utf-8

Content-Length: 58

Host: 127.0.0.1:2045

User-Agent: curl/7.29.0

Accept: */*

Welcome to MOSN!

The Cloud-Native Network Proxy Platform.

[admin@vultr ~]$ curl -i http://127.0.0.1:2047

HTTP/1.1 200 OK

Date: Thu, 25 Apr 2024 01:42:04 GMT

Content-Type: text/plain; charset=utf-8

Content-Length: 58

Host: 127.0.0.1:2047

User-Agent: curl/7.29.0

Accept: */*

Welcome to MOSN!

The Cloud-Native Network Proxy Platform.

相关推荐
一点媛艺2 小时前
Kotlin函数由易到难
开发语言·python·kotlin
姑苏风2 小时前
《Kotlin实战》-附录
android·开发语言·kotlin
奋斗的小花生3 小时前
c++ 多态性
开发语言·c++
魔道不误砍柴功3 小时前
Java 中如何巧妙应用 Function 让方法复用性更强
java·开发语言·python
NiNg_1_2343 小时前
SpringBoot整合SpringSecurity实现密码加密解密、登录认证退出功能
java·spring boot·后端
闲晨3 小时前
C++ 继承:代码传承的魔法棒,开启奇幻编程之旅
java·c语言·开发语言·c++·经验分享
老猿讲编程4 小时前
一个例子来说明Ada语言的实时性支持
开发语言·ada
Chrikk5 小时前
Go-性能调优实战案例
开发语言·后端·golang
幼儿园老大*5 小时前
Go的环境搭建以及GoLand安装教程
开发语言·经验分享·后端·golang·go
canyuemanyue5 小时前
go语言连续监控事件并回调处理
开发语言·后端·golang