SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
go clean -modcache
del go.sum
go mod tidy
go env
- 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
- #!/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

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
- {
- "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.