From 9658b06d5a46f7d214f934ebae4c295be2ba7be4 Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 14:41:10 +0000 Subject: [PATCH 01/26] update codis proxy to accept tls connection --- codis/config/proxy.toml | 11 +++++---- codis/pkg/models/proxy.go | 3 +++ codis/pkg/proxy/config.go | 6 +++++ codis/pkg/proxy/proxy.go | 49 ++++++++++++++++++++++++++++++++------- 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index 5f46885413..1cee0cf056 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -21,6 +21,9 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" +#proxy_tls = true +#proxy_tls_cert = "./cert.pem" +#proxy_tls_key = "./key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout @@ -105,10 +108,10 @@ session_break_on_failure = false # Slowlog-log-slower-than(us), from receive command to send response, 0 is allways print slow log slowlog_log_slower_than = 100000 -# quick command list e.g. get, set -quick_cmd_list = "" -# slow command list e.g. hgetall, mset -slow_cmd_list = "" +# quick command list +quick_cmd_list = "get,set" +# slow command list +slow_cmd_list = "mget, mset" # Set metrics server (such as http://localhost:28000), proxy will report json formatted metrics to specified server in a predefined period. metrics_report_server = "" diff --git a/codis/pkg/models/proxy.go b/codis/pkg/models/proxy.go index 69e308adef..b4d3a965ab 100644 --- a/codis/pkg/models/proxy.go +++ b/codis/pkg/models/proxy.go @@ -11,6 +11,9 @@ type Proxy struct { ProtoType string `json:"proto_type"` ProxyAddr string `json:"proxy_addr"` + ProxyTLS bool `json:"proxy_tls"` + ProxyTLSCert string `json:"proxy_tls_cert"` + ProxyTLSKey string `json:"proxy_tls_key"` JodisPath string `json:"jodis_path,omitempty"` diff --git a/codis/pkg/proxy/config.go b/codis/pkg/proxy/config.go index 50e218450a..e066d31e39 100644 --- a/codis/pkg/proxy/config.go +++ b/codis/pkg/proxy/config.go @@ -37,6 +37,9 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" +#proxy_tls = true +#proxy_tls_cert = "./cert.pem" +#proxy_tls_key = "./key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout @@ -166,6 +169,9 @@ type Config struct { ProxyDataCenter string `toml:"proxy_datacenter" json:"proxy_datacenter"` ProxyMaxClients int `toml:"proxy_max_clients" json:"proxy_max_clients"` + ProxyTLS bool `toml:"proxy_tls" json:"proxy_tls"` + ProxyTLSCert string `toml:"proxy_tls_cert" json:"proxy_tls_cert"` + ProxyTLSKey string `toml:"proxy_tls_key" json:"proxy_tls_key"` ProxyMaxOffheapBytes bytesize.Int64 `toml:"proxy_max_offheap_size" json:"proxy_max_offheap_size"` ProxyHeapPlaceholder bytesize.Int64 `toml:"proxy_heap_placeholder" json:"proxy_heap_placeholder"` diff --git a/codis/pkg/proxy/proxy.go b/codis/pkg/proxy/proxy.go index 31ebb344dd..17e99e8ccd 100644 --- a/codis/pkg/proxy/proxy.go +++ b/codis/pkg/proxy/proxy.go @@ -4,6 +4,7 @@ package proxy import ( + "crypto/tls" "fmt" "net" "net/http" @@ -103,17 +104,49 @@ func New(config *Config) (*Proxy, error) { func (p *Proxy) setup(config *Config) error { proto := config.ProtoType - if l, err := net.Listen(proto, config.ProxyAddr); err != nil { - return errors.Trace(err) - } else { - p.lproxy = l - x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) + if config.ProxyTLS { + + cert, err := tls.LoadX509KeyPair(config.ProxyTLSCert, config.ProxyTLSKey) if err != nil { - return err + return errors.Trace(err) + } + + // Set up TLS configuration to use TLS 1.3 + tlsConfig := &tls.Config{ + Certificates: []tls.Certificate{cert}, + MinVersion: tls.VersionTLS12, + } + + l, err := tls.Listen(proto, config.ProxyAddr, tlsConfig) + if err != nil { + return errors.Trace(err) + } + + p.lproxy = l + + x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) + if err != nil { + return err + } + p.model.ProtoType = proto + p.model.ProxyAddr = x + + }else{ + + if l, err := net.Listen(proto, config.ProxyAddr); err != nil { + return errors.Trace(err) + } else { + p.lproxy = l + + x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) + if err != nil { + return err + } + p.model.ProtoType = proto + p.model.ProxyAddr = x } - p.model.ProtoType = proto - p.model.ProxyAddr = x + } proto = "tcp" From 6ec04e30430f222a6094cc3d75c0f3d2ad31bc0c Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 16:30:06 +0000 Subject: [PATCH 02/26] tls for proxy works, tls for fe in progress --- codis/Makefile | 10 +++++----- codis/admin/codis-fe-admin.sh | 6 ++++-- codis/cert.pem | 21 +++++++++++++++++++++ codis/cmd/fe/main.go | 2 +- codis/config/dashboard.toml | 6 ++++-- codis/config/proxy.toml | 10 +++++----- codis/key.pem | 28 ++++++++++++++++++++++++++++ codis/pkg/proxy/.proxy.go.swo | Bin 0 -> 36864 bytes codis/pkg/proxy/config.go | 4 ++-- codis/pkg/proxy/proxy.go | 4 +++- codis/pkg/topom/config.go | 6 ++++-- 11 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 codis/cert.pem create mode 100644 codis/key.pem create mode 100644 codis/pkg/proxy/.proxy.go.swo diff --git a/codis/Makefile b/codis/Makefile index ef20162da3..5c00c2ca30 100644 --- a/codis/Makefile +++ b/codis/Makefile @@ -12,25 +12,25 @@ codis-deps: codis-dashboard: codis-deps $(info build codis-dashboard) - @cd ${PRJ_ROOT}/cmd/dashboard && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-dashboard . + @cd ${PRJ_ROOT}/cmd/dashboard && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-dashboard . @${PRJ_ROOT}/bin/codis-dashboard --default-config > ${PRJ_ROOT}/config/dashboard.toml codis-proxy: codis-deps $(info build codis-proxy) - @cd ${PRJ_ROOT}/cmd/proxy && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-proxy . + @cd ${PRJ_ROOT}/cmd/proxy && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-proxy . @${PRJ_ROOT}/bin/codis-proxy --default-config > ${PRJ_ROOT}/config/proxy.toml codis-admin: codis-deps $(info build codis-admin) - @cd ${PRJ_ROOT}/cmd/admin && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-admin . + @cd ${PRJ_ROOT}/cmd/admin && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-admin . codis-ha: codis-deps $(info build codis-ha) - @cd ${PRJ_ROOT}/cmd/ha && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-ha . + @cd ${PRJ_ROOT}/cmd/ha && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-ha . codis-fe: codis-deps $(info build codis-fe) - @cd ${PRJ_ROOT}/cmd/fe && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-fe . + @cd ${PRJ_ROOT}/cmd/fe && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-fe . @rm -rf ${PRJ_ROOT}/bin/assets && cp -rf ${PRJ_ROOT}/cmd/fe/assets ./bin/ clean: diff --git a/codis/admin/codis-fe-admin.sh b/codis/admin/codis-fe-admin.sh index b9e6872446..ef1bd63e0e 100755 --- a/codis/admin/codis-fe-admin.sh +++ b/codis/admin/codis-fe-admin.sh @@ -15,8 +15,10 @@ CODIS_FE_ASSETS_DIR=$CODIS_BIN_DIR/assets CODIS_FE_LOG_FILE=$CODIS_LOG_DIR/codis-fe.log CODIS_FE_DAEMON_FILE=$CODIS_LOG_DIR/codis-fe.out -COORDINATOR_NAME="filesystem" -COORDINATOR_ADDR="/tmp/codis" +#COORDINATOR_NAME="filesystem" +#COORDINATOR_ADDR="/tmp/codis" +COORDINATOR_NAME="etcd" +COORDINATOR_ADDR="127.0.0.1:2379" CODIS_FE_ADDR="0.0.0.0:9090" echo $CODIS_FE_CONF_FILE diff --git a/codis/cert.pem b/codis/cert.pem new file mode 100644 index 0000000000..8c6dbf1382 --- /dev/null +++ b/codis/cert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIUC/IGKPPBWnAG7MZNPhCUaPmg0oEwDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDAyMDExNTI0MDBaFw0zNDAx +MjkxNTI0MDBaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQClOgprziC/+nQeHXV5qJA9gdttnx7NV9Cbfc7xox6w +HRCaavLxdKh//E2o6F492U0i+GSqRYWrQKqWix0myLiZwXEL16mkhL7ANLFSnA8C +qsMIJf3u6+rN1OtlIVoKP1zWMFRV0inVCZMC0W6KFeVpuTqewc/FC5w/Zh3shPj1 +FJQCOas5SNbpxp9jQQsInur+NeP71r2GcZWD6+H2TCGouMTLFxdL62dbMOGLfm3a +Yq2d+HVhSMmEkuxXEgaIzxJ04toqQntnq4fnRkkFB7CoXG7AQqHIxKb4bjjnD100 +qDTTPc1wDEhlye/kUbxztF6dv58AUH1ayg1N7pz3EwazAgMBAAGjUzBRMB0GA1Ud +DgQWBBQtXOfPGePViVYEkHUujTcdtU8RuDAfBgNVHSMEGDAWgBQtXOfPGePViVYE +kHUujTcdtU8RuDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA5 +HMCZGl8a/fkG8O8XfdNpKvpb7WWINW5pqNf/Ep1wiqx3Y5/2I+NaCn7NhvxkliPU +hF/m3ijJ1eXLVjADMwBuW0vaqS0U29c5k/vWto2xx2Uv7dVffvbGTDUitAygGBTi +9r7A1GnU3PLdA96kUb5RT80tILOSakQYj+KN5QuV4LYmIoUIPlJfn0DOT4D/AoIC +vn/L77gctOQUfzu/l9saN1uwhgBZ06eQv14BJKnUdpmmMDREiP7lAJtQet1dukh6 +DvS3QUqf91pkOC6tXMHTAAFQ/op+eJVKUMKfFo1oRkXU1sg1/fD25FKO1xaS6afy +/nr/PY00p+k4s6jw+Fif +-----END CERTIFICATE----- diff --git a/codis/cmd/fe/main.go b/codis/cmd/fe/main.go index 663cc47086..5b884f6a27 100644 --- a/codis/cmd/fe/main.go +++ b/codis/cmd/fe/main.go @@ -56,7 +56,7 @@ func init() { func main() { const usage = ` Usage: - codis-fe [--ncpu=N] [--log=FILE] [--log-level=LEVEL] [--assets-dir=PATH] [--pidfile=FILE] (--dashboard-list=FILE|--zookeeper=ADDR [--zookeeper-auth=USR:PWD]|--etcd=ADDR [--etcd-auth=USR:PWD]|--filesystem=ROOT) --listen=ADDR + codis-fe [--ncpu=N] [--log=FILE] [--log-level=LEVEL] [--assets-dir=PATH] [--pidfile=FILE] (--dashboard-list=FILE|--zookeeper=ADDR [--zookeeper-auth=USR:PWD]|--etcd=ADDR [--etcd-auth=USR:PWD]|--filesystem=ROOT) --listen=ADDR [--tls-cert=FILE] [--tls-key=FILE] [--tls=BOOL] codis-fe --version Options: diff --git a/codis/config/dashboard.toml b/codis/config/dashboard.toml index ebd910ec62..217cf0e785 100644 --- a/codis/config/dashboard.toml +++ b/codis/config/dashboard.toml @@ -8,8 +8,10 @@ # Set Coordinator, only accept "zookeeper" & "etcd" & "filesystem". # for zookeeper/etcd, coorinator_auth accept "user:password" # Quick Start -coordinator_name = "filesystem" -coordinator_addr = "/tmp/codis" +coordinator_name = "etcd" +coordinator_addr = "127.0.0.1:2379" +#coordinator_name = "filesystem" +#coordinator_addr = "/tmp/codis" #coordinator_name = "zookeeper" #coordinator_addr = "127.0.0.1:2181" #coordinator_auth = "" diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index 1cee0cf056..054b0d4aea 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -21,9 +21,9 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" -#proxy_tls = true -#proxy_tls_cert = "./cert.pem" -#proxy_tls_key = "./key.pem" +proxy_tls = true +proxy_tls_cert = "/usr/local/src/pika/codis/cert.pem" +proxy_tls_key = "/usr/local/src/pika/codis/key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout @@ -35,8 +35,8 @@ proxy_addr = "0.0.0.0:19000" # /zk/codis/db_{PRODUCT_NAME}/proxy-{HASHID} (compatible with Codis2.0) # or else # /jodis/{PRODUCT_NAME}/proxy-{HASHID} -jodis_name = "" -jodis_addr = "" +jodis_name = "etcd" +jodis_addr = "127.0.0.1:2379" jodis_auth = "" jodis_timeout = "20s" jodis_compatible = false diff --git a/codis/key.pem b/codis/key.pem new file mode 100644 index 0000000000..ca0a096252 --- /dev/null +++ b/codis/key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQClOgprziC/+nQe +HXV5qJA9gdttnx7NV9Cbfc7xox6wHRCaavLxdKh//E2o6F492U0i+GSqRYWrQKqW +ix0myLiZwXEL16mkhL7ANLFSnA8CqsMIJf3u6+rN1OtlIVoKP1zWMFRV0inVCZMC +0W6KFeVpuTqewc/FC5w/Zh3shPj1FJQCOas5SNbpxp9jQQsInur+NeP71r2GcZWD +6+H2TCGouMTLFxdL62dbMOGLfm3aYq2d+HVhSMmEkuxXEgaIzxJ04toqQntnq4fn +RkkFB7CoXG7AQqHIxKb4bjjnD100qDTTPc1wDEhlye/kUbxztF6dv58AU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pR0xmaHRfguM8bohv+Rh6yD0CgYAfEVhTk+fXshrMeH9qdEwH +AzfQaQtPpQISgoTADT2ZDkZSSDOuVtMK0L/ZvAAeL+jbQh3RJayARfp2o8BnD12U +YIaBq9OC8JUZbG71e93zY/zv4HmZdK/RymmwM2jv9UxTnQPpnHRuVcYF0HZpZSWJ +Xf12eCJQmM/HGdynEvZtcw== +-----END PRIVATE KEY----- diff --git a/codis/pkg/proxy/.proxy.go.swo b/codis/pkg/proxy/.proxy.go.swo new file mode 100644 index 0000000000000000000000000000000000000000..d688c56659c64646ee4e4d3a842b2703533e320c GIT binary patch literal 36864 zcmeI53zTG4d8iBHgGxZ+gSZrxVYm@Xiit1?k=aQ zPI1nunQn#=5pPtKXh@72P(W5lBncWGFaUX8R(Qq{^`PJb#Dh)R(`~BfkSgypwjr}vjjVPR(H~$xB!sUh7 z_tlp`UjoaQ!11{=HmqMK{!bZrh4+HzU%dQR`#$>;=u4n4fxZO#66i~yFM+-U`V#0% z;3r-JN#i-WYskejY))$S_c0y6pJ~6JX@9!~y7Tue`}{il8})(yIQM7U@1yqjsn)@{ zKgT}5*8Yw<+>f=-Z?V6h>Tv%V`~0o;_l-6~E`0mA|En*7z6AOb=u4n4fxZO#66i~y zFM+-U`V#0%pf7=+N(uPoT<%U5?^nqJoc({d{{P|$x!ecf{ct_J1Ktb~?1wV!g>l#p zXTht$gA?I+cosYpo_uaD_gVN|xE}Vy1@J037M=~yf`2_em-{As1HJ+ez^C9YxEVeG z?}BUKO;Cr+VK?l8v*DF+3j6~6__$o|+wcVZ9sDgk47b3CAcpgy0H?w?elC~$G&}&G zg1g`*I0XCPWOz9|6TbPgx!ga(eeiau!5EwXU(b_%xC3s7H^Vh>30wfLg;&Fw@HC2z zAHcnE58Mhjz`Ni8Tn6XC2%HHUU_JZ{JV}{70e=lre*55Z*a_>P0H?vfp?vuVxEFo} zZh&{eMesT}1x|vOz>ld5{|-07A=nGs;HB_1N}wOW_u$XqGjJWuz&;p-o$y1HF^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a*Dj6em31!T$S4wTk z=~&ohmUI%XQ*Fr1-5FS^wXjX$%GQ*ff2~ET!GfvEE?~R`l9lyCb+^qzG+ymX$21?= z7qTm{j+7aJ>EBDpl(dPVU9IP|O}&mli87B>ttj&d5EYg&PL*b_4S*VGch`-5Go1u| zrF0B(%OR%Vu7$`O<`t)^MEvrsyC2Bd0ym1;)+u4w20~gi#9)>hCY28-(`e*qgXv<( zyMF0v)l%?a+H;;DkhWguuh*-q3yY&ca=bvTm7GyNT&Gy#zWKT_yVO4p(Pq0VAvnFi z4wRB+5t~^}S(EjQHom)a(vet4D9w|c!EiNhtK>lcYipL~Xu)cmrFnZr%~C3bz9t1? z%40U>k8v=`C{*RytWnL%?dRrkbm)Bk*hDpmHhQy?n^`V=mG9W4(_rht!7Yu7z8@7D zs@v5P()YE#5%OqrPK3Eo5z~{dq*!gP7b#ZtVNJ4+Rj|bUfHC2n;E7y0o!1XAhTw!-I2zwjA{=c zJsy>_GrLk>-9!BGt<__@zOLBXn(X@98Pb1EB3tQmBEQZJ|EOA+z}hK}jqYgY+a)M2 NnAqB9*R3tn{|B0IHDv$* literal 0 HcmV?d00001 diff --git a/codis/pkg/proxy/config.go b/codis/pkg/proxy/config.go index e066d31e39..82b75cabfc 100644 --- a/codis/pkg/proxy/config.go +++ b/codis/pkg/proxy/config.go @@ -51,8 +51,8 @@ proxy_addr = "0.0.0.0:19000" # /zk/codis/db_{PRODUCT_NAME}/proxy-{HASHID} (compatible with Codis2.0) # or else # /jodis/{PRODUCT_NAME}/proxy-{HASHID} -jodis_name = "" -jodis_addr = "" +jodis_name = "etcd" +jodis_addr = "127.0.0.1:2379" jodis_auth = "" jodis_timeout = "20s" jodis_compatible = false diff --git a/codis/pkg/proxy/proxy.go b/codis/pkg/proxy/proxy.go index 17e99e8ccd..4fa69c896d 100644 --- a/codis/pkg/proxy/proxy.go +++ b/codis/pkg/proxy/proxy.go @@ -106,6 +106,7 @@ func (p *Proxy) setup(config *Config) error { proto := config.ProtoType if config.ProxyTLS { + log.Printf("ufsdigushdgisdghfdg = %s = %s", config.ProxyTLSCert, config.ProxyTLSKey) cert, err := tls.LoadX509KeyPair(config.ProxyTLSCert, config.ProxyTLSKey) if err != nil { @@ -133,10 +134,11 @@ func (p *Proxy) setup(config *Config) error { p.model.ProxyAddr = x }else{ + log.Printf("fgdusgifhfdgfgfidudsfgi") if l, err := net.Listen(proto, config.ProxyAddr); err != nil { return errors.Trace(err) - } else { + }else{ p.lproxy = l x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) diff --git a/codis/pkg/topom/config.go b/codis/pkg/topom/config.go index 4d7234b662..98bb0eb561 100644 --- a/codis/pkg/topom/config.go +++ b/codis/pkg/topom/config.go @@ -25,8 +25,10 @@ const DefaultConfig = ` # Set Coordinator, only accept "zookeeper" & "etcd" & "filesystem". # for zookeeper/etcd, coorinator_auth accept "user:password" # Quick Start -coordinator_name = "filesystem" -coordinator_addr = "/tmp/codis" +coordinator_name = "etcd" +coordinator_addr = "127.0.0.1:2379" +#coordinator_name = "filesystem" +#coordinator_addr = "/tmp/codis" #coordinator_name = "zookeeper" #coordinator_addr = "127.0.0.1:2181" #coordinator_auth = "" From 10b22fce8e5c726c44945df989fff0a0cfac1504 Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 17:24:11 +0000 Subject: [PATCH 03/26] codis fe tls done --- codis/admin/codis-fe-admin.sh | 5 +++- codis/cmd/fe/main.go | 44 +++++++++++++++++++++++++++++++---- codis/config/proxy.toml | 6 ++--- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/codis/admin/codis-fe-admin.sh b/codis/admin/codis-fe-admin.sh index ef1bd63e0e..fa84ef91f3 100755 --- a/codis/admin/codis-fe-admin.sh +++ b/codis/admin/codis-fe-admin.sh @@ -20,6 +20,9 @@ CODIS_FE_DAEMON_FILE=$CODIS_LOG_DIR/codis-fe.out COORDINATOR_NAME="etcd" COORDINATOR_ADDR="127.0.0.1:2379" CODIS_FE_ADDR="0.0.0.0:9090" +CODIS_FE_TLS=1 +CODIS_FE_TLS_KEY="/usr/local/src/pika/codis/key.pem" +CODIS_FE_TLS_CERT="/usr/local/src/pika/codis/cert.pem" echo $CODIS_FE_CONF_FILE @@ -38,7 +41,7 @@ start) fi fi nohup "$CODIS_FE_BIN" "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \ - "--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null & + "--tls=$CODIS_FE_TLS" "--tls-key=$CODIS_FE_TLS_KEY" "--tls-cert=$CODIS_FE_TLS_CERT" "--log=$CODIS_FE_LOG_FILE" "--pidfile=$CODIS_FE_PID_FILE" "--log-level=INFO" "--listen=$CODIS_FE_ADDR" > "$CODIS_FE_DAEMON_FILE" 2>&1 < /dev/null & ;; start-foreground) $CODIS_FE_BIN "--assets-dir=${CODIS_FE_ASSETS_DIR}" "--$COORDINATOR_NAME=$COORDINATOR_ADDR" \ diff --git a/codis/cmd/fe/main.go b/codis/cmd/fe/main.go index 5b884f6a27..9e5601b23d 100644 --- a/codis/cmd/fe/main.go +++ b/codis/cmd/fe/main.go @@ -4,6 +4,7 @@ package main import ( + "crypto/tls" "encoding/json" "fmt" "io/ioutil" @@ -56,7 +57,7 @@ func init() { func main() { const usage = ` Usage: - codis-fe [--ncpu=N] [--log=FILE] [--log-level=LEVEL] [--assets-dir=PATH] [--pidfile=FILE] (--dashboard-list=FILE|--zookeeper=ADDR [--zookeeper-auth=USR:PWD]|--etcd=ADDR [--etcd-auth=USR:PWD]|--filesystem=ROOT) --listen=ADDR [--tls-cert=FILE] [--tls-key=FILE] [--tls=BOOL] + codis-fe [--ncpu=N] [--log=FILE] [--log-level=LEVEL] [--assets-dir=PATH] [--pidfile=FILE] (--dashboard-list=FILE|--zookeeper=ADDR [--zookeeper-auth=USR:PWD]|--etcd=ADDR [--etcd-auth=USR:PWD]|--filesystem=ROOT) --listen=ADDR [--tls-cert=FILE] [--tls-key=FILE] [--tls=N] codis-fe --version Options: @@ -196,10 +197,45 @@ Options: m.MapTo(r, (*martini.Routes)(nil)) m.Action(r.Handle) - l, err := net.Listen("tcp", listen) - if err != nil { - log.PanicErrorf(err, "listen %s failed", listen) + + var l net.Listener + //var err error + + if n, ok := utils.ArgumentInteger(d, "--tls"); ok { + if n == 1 { + + log.Warnf("nfyDFUSIUDSH") + //listen := ":443" // Replace with your listening address and port + // Load server certificate and key + cert, err := tls.LoadX509KeyPair(utils.ArgumentMust(d, "--tls-cert"), utils.ArgumentMust(d, "--tls-key")) + if err != nil { + log.PanicErrorf(err, "failed to load key pair: %s", err) + } + + // Create a TLS config + tlsConfig := &tls.Config{ + Certificates: []tls.Certificate{cert}, + } + + // Create a TLS listener + l, err = tls.Listen("tcp", listen, tlsConfig) + if err != nil { + log.PanicErrorf(err, "listen %s failed", listen) + } + + + } + }else{ + + log.Warnf("SDNAUDHDKSAJDHSD") + l, err = net.Listen("tcp", listen) + if err != nil { + log.PanicErrorf(err, "listen %s failed", listen) + } + } + + defer l.Close() if s, ok := utils.Argument(d, "--pidfile"); ok { diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index 054b0d4aea..11418bffe0 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -21,9 +21,9 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" -proxy_tls = true -proxy_tls_cert = "/usr/local/src/pika/codis/cert.pem" -proxy_tls_key = "/usr/local/src/pika/codis/key.pem" +#proxy_tls = true +#proxy_tls_cert = "./cert.pem" +#proxy_tls_key = "./key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout From 083b737910df113510fd44b1d081160d80952881 Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 17:25:55 +0000 Subject: [PATCH 04/26] codis tls fe minor update --- codis/config/proxy.toml | 4 ++-- codis/pkg/proxy/config.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index 11418bffe0..b403e70e1a 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -22,8 +22,8 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" #proxy_tls = true -#proxy_tls_cert = "./cert.pem" -#proxy_tls_key = "./key.pem" +#proxy_tls_cert = "/usr/local/src/pika/codis/cert.pem" +#proxy_tls_key = "/usr/local/src/pika/codis/key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout diff --git a/codis/pkg/proxy/config.go b/codis/pkg/proxy/config.go index 82b75cabfc..79c75b49e5 100644 --- a/codis/pkg/proxy/config.go +++ b/codis/pkg/proxy/config.go @@ -38,8 +38,8 @@ admin_addr = "0.0.0.0:11080" # Set bind address for proxy, proto_type can be "tcp", "tcp4", "tcp6", "unix" or "unixpacket". proto_type = "tcp4" #proxy_tls = true -#proxy_tls_cert = "./cert.pem" -#proxy_tls_key = "./key.pem" +#proxy_tls_cert = "/usr/local/src/pika/codis/cert.pem" +#proxy_tls_key = "/usr/local/src/pika/codis/key.pem" proxy_addr = "0.0.0.0:19000" # Set jodis address & session timeout From 4517f87ae6dc03cce6a01eea98d9e66fefd1c797 Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 17:34:05 +0000 Subject: [PATCH 05/26] codis fe minor update --- codis/admin/.codis-fe-admin.sh.swo | Bin 0 -> 12288 bytes codis/cmd/fe/main.go | 37 ++++++++++++----------------- 2 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 codis/admin/.codis-fe-admin.sh.swo diff --git a/codis/admin/.codis-fe-admin.sh.swo b/codis/admin/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b-2*iBD#3IFc5q`<{XCmyCDliKMr+9y{TF l!t-FM(t5MqYHT%^t8%Vzgx#E)3Or|1as&l9&Jh literal 0 HcmV?d00001 diff --git a/codis/cmd/fe/main.go b/codis/cmd/fe/main.go index 9e5601b23d..964d121766 100644 --- a/codis/cmd/fe/main.go +++ b/codis/cmd/fe/main.go @@ -197,37 +197,30 @@ Options: m.MapTo(r, (*martini.Routes)(nil)) m.Action(r.Handle) - var l net.Listener - //var err error - if n, ok := utils.ArgumentInteger(d, "--tls"); ok { - if n == 1 { + if n, ok := utils.ArgumentInteger(d, "--tls"); ok && n == 1 { - log.Warnf("nfyDFUSIUDSH") - //listen := ":443" // Replace with your listening address and port - // Load server certificate and key - cert, err := tls.LoadX509KeyPair(utils.ArgumentMust(d, "--tls-cert"), utils.ArgumentMust(d, "--tls-key")) - if err != nil { - log.PanicErrorf(err, "failed to load key pair: %s", err) - } + // Load server certificate and key + cert, err := tls.LoadX509KeyPair(utils.ArgumentMust(d, "--tls-cert"), utils.ArgumentMust(d, "--tls-key")) + if err != nil { + log.PanicErrorf(err, "failed to load key pair: %s", err) + } - // Create a TLS config - tlsConfig := &tls.Config{ - Certificates: []tls.Certificate{cert}, - } + // Create a TLS config + tlsConfig := &tls.Config{ + Certificates: []tls.Certificate{cert}, + } - // Create a TLS listener - l, err = tls.Listen("tcp", listen, tlsConfig) - if err != nil { - log.PanicErrorf(err, "listen %s failed", listen) - } + // Create a TLS listener + l, err = tls.Listen("tcp", listen, tlsConfig) + if err != nil { + log.PanicErrorf(err, "listen %s failed", listen) + } - } }else{ - log.Warnf("SDNAUDHDKSAJDHSD") l, err = net.Listen("tcp", listen) if err != nil { log.PanicErrorf(err, "listen %s failed", listen) From 342d8931b69d27b4f49f5e6db275060275ec1ada Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 18:36:09 +0000 Subject: [PATCH 06/26] @chenmin1992 remove my own topom --- codis/pkg/models/store.go | 13 +++++++++++++ codis/pkg/models/topom.go | 8 ++++++++ codis/pkg/topom/topom.go | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/codis/pkg/models/store.go b/codis/pkg/models/store.go index aceb5bc83a..00f20e214f 100644 --- a/codis/pkg/models/store.go +++ b/codis/pkg/models/store.go @@ -123,6 +123,19 @@ func (s *Store) Release() error { return s.client.Delete(s.LockPath()) } +func (s *Store) ReleaseByToken(token string) error { + if b, err := s.client.Read(s.LockPath(),false); err != nil { + return err + } else if b != nil { + if t, err := Decode(b); err != nil { + return err + } else if t.Token == token { + return s.Release() + } + } + return nil +} + func (s *Store) LoadTopom(must bool) (*Topom, error) { return LoadTopom(s.client, s.product, must) } diff --git a/codis/pkg/models/topom.go b/codis/pkg/models/topom.go index 746141fbae..63aa1c8d5a 100644 --- a/codis/pkg/models/topom.go +++ b/codis/pkg/models/topom.go @@ -18,3 +18,11 @@ type Topom struct { func (t *Topom) Encode() []byte { return jsonEncode(t) } + +func Decode(b []byte) (*Topom, error) { + s := &Topom{} + if err := jsonDecode(s, b); err != nil { + return nil,err + } + return s,nil +} diff --git a/codis/pkg/topom/topom.go b/codis/pkg/topom/topom.go index 582452aa1d..4bf2e98c89 100644 --- a/codis/pkg/topom/topom.go +++ b/codis/pkg/topom/topom.go @@ -168,7 +168,7 @@ func (s *Topom) Close() error { defer s.store.Close() if s.online { - if err := s.store.Release(); err != nil { + if err := s.store.ReleaseByToken(s.model.Token); err != nil { log.ErrorErrorf(err, "store: release lock of %s failed", s.config.ProductName) return errors.Errorf("store: release lock of %s failed", s.config.ProductName) } From 8ad0b61b05564aec18f53b9590b7e9d8d162c6df Mon Sep 17 00:00:00 2001 From: Kolin Fluence Date: Thu, 1 Feb 2024 18:43:07 +0000 Subject: [PATCH 07/26] optimize code --- codis/pkg/proxy/proxy.go | 55 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/codis/pkg/proxy/proxy.go b/codis/pkg/proxy/proxy.go index 4fa69c896d..6d5762b0c0 100644 --- a/codis/pkg/proxy/proxy.go +++ b/codis/pkg/proxy/proxy.go @@ -105,52 +105,53 @@ func New(config *Config) (*Proxy, error) { func (p *Proxy) setup(config *Config) error { proto := config.ProtoType + var l net.Listener + var err error + if config.ProxyTLS { - log.Printf("ufsdigushdgisdghfdg = %s = %s", config.ProxyTLSCert, config.ProxyTLSKey) + log.Printf("TLS configuration: cert = %s, key = %s", config.ProxyTLSCert, config.ProxyTLSKey) + // Load the TLS certificate cert, err := tls.LoadX509KeyPair(config.ProxyTLSCert, config.ProxyTLSKey) if err != nil { return errors.Trace(err) - } + } - // Set up TLS configuration to use TLS 1.3 + // Set up TLS configuration to use TLS 1.2 or higher tlsConfig := &tls.Config{ Certificates: []tls.Certificate{cert}, MinVersion: tls.VersionTLS12, } - l, err := tls.Listen(proto, config.ProxyAddr, tlsConfig) + // Create a TLS listener + l, err = tls.Listen(proto, config.ProxyAddr, tlsConfig) if err != nil { return errors.Trace(err) - } - - p.lproxy = l - - x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) - if err != nil { - return err - } - p.model.ProtoType = proto - p.model.ProxyAddr = x - - }else{ - log.Printf("fgdusgifhfdgfgfidudsfgi") + } + } else { + log.Printf("Setting up a non-TLS listener") - if l, err := net.Listen(proto, config.ProxyAddr); err != nil { + // Create a non-TLS listener + l, err = net.Listen(proto, config.ProxyAddr) + if err != nil { return errors.Trace(err) - }else{ - p.lproxy = l - - x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) - if err != nil { - return err - } - p.model.ProtoType = proto - p.model.ProxyAddr = x } + } + + // Common setup for both TLS and non-TLS + p.lproxy = l + // Replace unspecified IP address with the specific host proxy address + x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) + if err != nil { + return err } + // Update proxy model + p.model.ProtoType = proto + p.model.ProxyAddr = x + + proto = "tcp" if l, err := net.Listen(proto, config.AdminAddr); err != nil { return errors.Trace(err) From e233d106105031dc7b86a23dc07b15c39cb98883 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:05:46 -0400 Subject: [PATCH 08/26] Delete codis/pkg/proxy/.proxy.go.swo --- codis/pkg/proxy/.proxy.go.swo | Bin 36864 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 codis/pkg/proxy/.proxy.go.swo diff --git a/codis/pkg/proxy/.proxy.go.swo b/codis/pkg/proxy/.proxy.go.swo deleted file mode 100644 index d688c56659c64646ee4e4d3a842b2703533e320c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36864 zcmeI53zTG4d8iBHgGxZ+gSZrxVYm@Xiit1?k=aQ zPI1nunQn#=5pPtKXh@72P(W5lBncWGFaUX8R(Qq{^`PJb#Dh)R(`~BfkSgypwjr}vjjVPR(H~$xB!sUh7 z_tlp`UjoaQ!11{=HmqMK{!bZrh4+HzU%dQR`#$>;=u4n4fxZO#66i~yFM+-U`V#0% z;3r-JN#i-WYskejY))$S_c0y6pJ~6JX@9!~y7Tue`}{il8})(yIQM7U@1yqjsn)@{ zKgT}5*8Yw<+>f=-Z?V6h>Tv%V`~0o;_l-6~E`0mA|En*7z6AOb=u4n4fxZO#66i~y zFM+-U`V#0%pf7=+N(uPoT<%U5?^nqJoc({d{{P|$x!ecf{ct_J1Ktb~?1wV!g>l#p zXTht$gA?I+cosYpo_uaD_gVN|xE}Vy1@J037M=~yf`2_em-{As1HJ+ez^C9YxEVeG z?}BUKO;Cr+VK?l8v*DF+3j6~6__$o|+wcVZ9sDgk47b3CAcpgy0H?w?elC~$G&}&G zg1g`*I0XCPWOz9|6TbPgx!ga(eeiau!5EwXU(b_%xC3s7H^Vh>30wfLg;&Fw@HC2z zAHcnE58Mhjz`Ni8Tn6XC2%HHUU_JZ{JV}{70e=lre*55Z*a_>P0H?vfp?vuVxEFo} zZh&{eMesT}1x|vOz>ld5{|-07A=nGs;HB_1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8Mz%(14tXH;VbkfstYpzuG)97Kot_a*Dj6em31!T$S4wTk z=~&ohmUI%XQ*Fr1-5FS^wXjX$%GQ*ff2~ET!GfvEE?~R`l9lyCb+^qzG+ymX$21?= z7qTm{j+7aJ>EBDpl(dPVU9IP|O}&mli87B>ttj&d5EYg&PL*b_4S*VGch`-5Go1u| zrF0B(%OR%Vu7$`O<`t)^MEvrsyC2Bd0ym1;)+u4w20~gi#9)>hCY28-(`e*qgXv<( zyMF0v)l%?a+H;;DkhWguuh*-q3yY&ca=bvTm7GyNT&Gy#zWKT_yVO4p(Pq0VAvnFi z4wRB+5t~^}S(EjQHom)a(vet4D9w|c!EiNhtK>lcYipL~Xu)cmrFnZr%~C3bz9t1? z%40U>k8v=`C{*RytWnL%?dRrkbm)Bk*hDpmHhQy?n^`V=mG9W4(_rht!7Yu7z8@7D zs@v5P()YE#5%OqrPK3Eo5z~{dq*!gP7b#ZtVNJ4+Rj|bUfHC2n;E7y0o!1XAhTw!-I2zwjA{=c zJsy>_GrLk>-9!BGt<__@zOLBXn(X@98Pb1EB3tQmBEQZJ|EOA+z}hK}jqYgY+a)M2 NnAqB9*R3tn{|B0IHDv$* From e99e5870ba3353ec5ee35e0e448951fa652716dc Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:07:13 -0400 Subject: [PATCH 09/26] Delete codis/admin/.codis-fe-admin.sh.swo --- codis/admin/.codis-fe-admin.sh.swo | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 codis/admin/.codis-fe-admin.sh.swo diff --git a/codis/admin/.codis-fe-admin.sh.swo b/codis/admin/.codis-fe-admin.sh.swo deleted file mode 100644 index 0f231cafe3770a2e09dbdd0d2ab7702a43b4de98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2&u`;I6vt=xz|Sp<;0&6&QQ0Ed`LPn+wxlAh(-O8#s-#6i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fluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:13:42 -0400 Subject: [PATCH 10/26] Update store.go --- codis/pkg/models/store.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/codis/pkg/models/store.go b/codis/pkg/models/store.go index 00f20e214f..2ec683accd 100644 --- a/codis/pkg/models/store.go +++ b/codis/pkg/models/store.go @@ -124,15 +124,21 @@ func (s *Store) Release() error { } func (s *Store) ReleaseByToken(token string) error { - if b, err := s.client.Read(s.LockPath(),false); err != nil { + b, err := s.client.Read(s.LockPath(),false) + if err != nil { return err - } else if b != nil { - if t, err := Decode(b); err != nil { + } + + if b != nil { + t, err := Decode(b); + if err != nil { return err - } else if t.Token == token { + } + if t.Token == token { return s.Release() } } + return nil } From 7b765b76e99bd9ce8c01168e0e7d9db0f41c1a89 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:16:44 -0400 Subject: [PATCH 11/26] Update config.go --- codis/pkg/topom/config.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/codis/pkg/topom/config.go b/codis/pkg/topom/config.go index 98bb0eb561..d1e0d44e5f 100644 --- a/codis/pkg/topom/config.go +++ b/codis/pkg/topom/config.go @@ -25,10 +25,8 @@ const DefaultConfig = ` # Set Coordinator, only accept "zookeeper" & "etcd" & "filesystem". # for zookeeper/etcd, coorinator_auth accept "user:password" # Quick Start -coordinator_name = "etcd" -coordinator_addr = "127.0.0.1:2379" -#coordinator_name = "filesystem" -#coordinator_addr = "/tmp/codis" +coordinator_name = "filesystem" +coordinator_addr = "/tmp/codis" #coordinator_name = "zookeeper" #coordinator_addr = "127.0.0.1:2181" #coordinator_auth = "" @@ -52,9 +50,10 @@ migration_async_numkeys = 500 migration_timeout = "30s" # Set configs for redis sentinel. -sentinel_check_server_state_interval = "5s" -sentinel_check_master_failover_interval = "1s" -sentinel_master_dead_check_times = 5 +sentinel_check_server_state_interval = "10s" +sentinel_check_master_failover_interval = "2s" +sentinel_master_dead_check_times = 10 +sentinel_check_offline_server_interval = "2s" sentinel_client_timeout = "10s" sentinel_quorum = 2 sentinel_parallel_syncs = 1 @@ -88,6 +87,7 @@ type Config struct { SentinelCheckServerStateInterval timesize.Duration `toml:"sentinel_check_server_state_interval" json:"sentinel_client_timeout"` SentinelCheckMasterFailoverInterval timesize.Duration `toml:"sentinel_check_master_failover_interval" json:"sentinel_check_master_failover_interval"` SentinelMasterDeadCheckTimes int8 `toml:"sentinel_master_dead_check_times" json:"sentinel_master_dead_check_times"` + SentinelCheckOfflineServerInterval timesize.Duration `toml:"sentinel_check_offline_server_interval" json:"sentinel_check_offline_server_interval"` SentinelClientTimeout timesize.Duration `toml:"sentinel_client_timeout" json:"sentinel_client_timeout"` SentinelQuorum int `toml:"sentinel_quorum" json:"sentinel_quorum"` SentinelParallelSyncs int `toml:"sentinel_parallel_syncs" json:"sentinel_parallel_syncs"` From 6eb8e3a004ff14c4007679e2a8a31af8ec73be1f Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:23:05 -0400 Subject: [PATCH 12/26] Update Makefile --- codis/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/codis/Makefile b/codis/Makefile index 5c00c2ca30..ef20162da3 100644 --- a/codis/Makefile +++ b/codis/Makefile @@ -12,25 +12,25 @@ codis-deps: codis-dashboard: codis-deps $(info build codis-dashboard) - @cd ${PRJ_ROOT}/cmd/dashboard && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-dashboard . + @cd ${PRJ_ROOT}/cmd/dashboard && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-dashboard . @${PRJ_ROOT}/bin/codis-dashboard --default-config > ${PRJ_ROOT}/config/dashboard.toml codis-proxy: codis-deps $(info build codis-proxy) - @cd ${PRJ_ROOT}/cmd/proxy && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-proxy . + @cd ${PRJ_ROOT}/cmd/proxy && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-proxy . @${PRJ_ROOT}/bin/codis-proxy --default-config > ${PRJ_ROOT}/config/proxy.toml codis-admin: codis-deps $(info build codis-admin) - @cd ${PRJ_ROOT}/cmd/admin && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-admin . + @cd ${PRJ_ROOT}/cmd/admin && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-admin . codis-ha: codis-deps $(info build codis-ha) - @cd ${PRJ_ROOT}/cmd/ha && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-ha . + @cd ${PRJ_ROOT}/cmd/ha && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-ha . codis-fe: codis-deps $(info build codis-fe) - @cd ${PRJ_ROOT}/cmd/fe && go mod tidy && go build -ldflags "-w -s" -o ${PRJ_ROOT}/bin/codis-fe . + @cd ${PRJ_ROOT}/cmd/fe && go mod tidy && go build -o ${PRJ_ROOT}/bin/codis-fe . @rm -rf ${PRJ_ROOT}/bin/assets && cp -rf ${PRJ_ROOT}/cmd/fe/assets ./bin/ clean: From f2cfcee0ce3e5b178527368da21dcbb3c25fd85c Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:24:47 -0400 Subject: [PATCH 13/26] Update config.go --- codis/pkg/proxy/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codis/pkg/proxy/config.go b/codis/pkg/proxy/config.go index 79c75b49e5..f9ef6b9f7d 100644 --- a/codis/pkg/proxy/config.go +++ b/codis/pkg/proxy/config.go @@ -51,8 +51,8 @@ proxy_addr = "0.0.0.0:19000" # /zk/codis/db_{PRODUCT_NAME}/proxy-{HASHID} (compatible with Codis2.0) # or else # /jodis/{PRODUCT_NAME}/proxy-{HASHID} -jodis_name = "etcd" -jodis_addr = "127.0.0.1:2379" +jodis_name = "" +jodis_addr = "" jodis_auth = "" jodis_timeout = "20s" jodis_compatible = false From b8bda63c109f02cd6f2450b6de52eb08835fbfe7 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:26:43 -0400 Subject: [PATCH 14/26] Update proxy.toml --- codis/config/proxy.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index b403e70e1a..134cf0c357 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -108,10 +108,10 @@ session_break_on_failure = false # Slowlog-log-slower-than(us), from receive command to send response, 0 is allways print slow log slowlog_log_slower_than = 100000 -# quick command list -quick_cmd_list = "get,set" -# slow command list -slow_cmd_list = "mget, mset" +# quick command list e.g. get, set +quick_cmd_list = "" +# slow command list e.g. hgetall, mset +slow_cmd_list = "" # Set metrics server (such as http://localhost:28000), proxy will report json formatted metrics to specified server in a predefined period. metrics_report_server = "" From 6a8a404145eddc0d37f61dfd77f6f5a7ccfd0ed2 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:27:04 -0400 Subject: [PATCH 15/26] Update proxy.toml --- codis/config/proxy.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codis/config/proxy.toml b/codis/config/proxy.toml index 134cf0c357..0a28d77dae 100644 --- a/codis/config/proxy.toml +++ b/codis/config/proxy.toml @@ -35,8 +35,8 @@ proxy_addr = "0.0.0.0:19000" # /zk/codis/db_{PRODUCT_NAME}/proxy-{HASHID} (compatible with Codis2.0) # or else # /jodis/{PRODUCT_NAME}/proxy-{HASHID} -jodis_name = "etcd" -jodis_addr = "127.0.0.1:2379" +jodis_name = "" +jodis_addr = "" jodis_auth = "" jodis_timeout = "20s" jodis_compatible = false From 10038c36c2da202b26ebee95f19ccadcda7573ee Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:28:31 -0400 Subject: [PATCH 16/26] Update codis-fe-admin.sh --- codis/admin/codis-fe-admin.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/codis/admin/codis-fe-admin.sh b/codis/admin/codis-fe-admin.sh index fa84ef91f3..7ca15d76ea 100755 --- a/codis/admin/codis-fe-admin.sh +++ b/codis/admin/codis-fe-admin.sh @@ -15,10 +15,8 @@ CODIS_FE_ASSETS_DIR=$CODIS_BIN_DIR/assets CODIS_FE_LOG_FILE=$CODIS_LOG_DIR/codis-fe.log CODIS_FE_DAEMON_FILE=$CODIS_LOG_DIR/codis-fe.out -#COORDINATOR_NAME="filesystem" -#COORDINATOR_ADDR="/tmp/codis" -COORDINATOR_NAME="etcd" -COORDINATOR_ADDR="127.0.0.1:2379" +COORDINATOR_NAME="filesystem" +COORDINATOR_ADDR="/tmp/codis" CODIS_FE_ADDR="0.0.0.0:9090" CODIS_FE_TLS=1 CODIS_FE_TLS_KEY="/usr/local/src/pika/codis/key.pem" From 7f78d000ae7fc5fad91022b81b7dd69d7f987864 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:29:15 -0400 Subject: [PATCH 17/26] Update dashboard.toml --- codis/config/dashboard.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/codis/config/dashboard.toml b/codis/config/dashboard.toml index 217cf0e785..ebd910ec62 100644 --- a/codis/config/dashboard.toml +++ b/codis/config/dashboard.toml @@ -8,10 +8,8 @@ # Set Coordinator, only accept "zookeeper" & "etcd" & "filesystem". # for zookeeper/etcd, coorinator_auth accept "user:password" # Quick Start -coordinator_name = "etcd" -coordinator_addr = "127.0.0.1:2379" -#coordinator_name = "filesystem" -#coordinator_addr = "/tmp/codis" +coordinator_name = "filesystem" +coordinator_addr = "/tmp/codis" #coordinator_name = "zookeeper" #coordinator_addr = "127.0.0.1:2181" #coordinator_auth = "" From 8d00a6fae698c3325fa266b3baca0993c7c389e6 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:30:43 -0400 Subject: [PATCH 18/26] Update topom.go --- codis/pkg/topom/topom.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codis/pkg/topom/topom.go b/codis/pkg/topom/topom.go index 4bf2e98c89..a11380556c 100644 --- a/codis/pkg/topom/topom.go +++ b/codis/pkg/topom/topom.go @@ -168,7 +168,8 @@ func (s *Topom) Close() error { defer s.store.Close() if s.online { - if err := s.store.ReleaseByToken(s.model.Token); err != nil { + err := s.store.ReleaseByToken(s.model.Token); + if err != nil { log.ErrorErrorf(err, "store: release lock of %s failed", s.config.ProductName) return errors.Errorf("store: release lock of %s failed", s.config.ProductName) } From e8f24ebba7512b5759efa4b97486fd941dc005df Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:40:21 -0400 Subject: [PATCH 19/26] Update main.go --- codis/cmd/fe/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codis/cmd/fe/main.go b/codis/cmd/fe/main.go index 964d121766..c7e04879c9 100644 --- a/codis/cmd/fe/main.go +++ b/codis/cmd/fe/main.go @@ -202,7 +202,11 @@ Options: if n, ok := utils.ArgumentInteger(d, "--tls"); ok && n == 1 { // Load server certificate and key - cert, err := tls.LoadX509KeyPair(utils.ArgumentMust(d, "--tls-cert"), utils.ArgumentMust(d, "--tls-key")) + certFile, keyFile := utils.ArgumentMust(d, "--tls-cert"), utils.ArgumentMust(d, "--tls-key") + if certFile == "" || keyFile == "" { + log.Panic("TLS certificate or key file path must be provided") + } + cert, err := tls.LoadX509KeyPair(certFile, keyFile) if err != nil { log.PanicErrorf(err, "failed to load key pair: %s", err) } From 86afbe7c50fb3163df33c04febfc66e20e8ee641 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:41:31 -0400 Subject: [PATCH 20/26] Update store.go --- codis/pkg/models/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codis/pkg/models/store.go b/codis/pkg/models/store.go index 2ec683accd..44f65ad6af 100644 --- a/codis/pkg/models/store.go +++ b/codis/pkg/models/store.go @@ -130,11 +130,11 @@ func (s *Store) ReleaseByToken(token string) error { } if b != nil { - t, err := Decode(b); + t, err := Decode(b) if err != nil { return err } - if t.Token == token { + if t != nil && t.Token == token { return s.Release() } } From 1a4e5c41986fbb194331138d07ad8cfe42811850 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:42:10 -0400 Subject: [PATCH 21/26] Update proxy.go --- codis/pkg/proxy/proxy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/codis/pkg/proxy/proxy.go b/codis/pkg/proxy/proxy.go index 6d5762b0c0..8aba5c8fbc 100644 --- a/codis/pkg/proxy/proxy.go +++ b/codis/pkg/proxy/proxy.go @@ -144,6 +144,7 @@ func (p *Proxy) setup(config *Config) error { // Replace unspecified IP address with the specific host proxy address x, err := utils.ReplaceUnspecifiedIP(proto, l.Addr().String(), config.HostProxy) if err != nil { + log.Errorf("Failed to replace unspecified IP: %s", err) return err } From b9cf0ae9687ac7e41e52dbf2c03e2993c2f94ab2 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:47:48 -0400 Subject: [PATCH 22/26] Update topom.go --- codis/pkg/models/topom.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codis/pkg/models/topom.go b/codis/pkg/models/topom.go index 63aa1c8d5a..83530119e4 100644 --- a/codis/pkg/models/topom.go +++ b/codis/pkg/models/topom.go @@ -22,7 +22,7 @@ func (t *Topom) Encode() []byte { func Decode(b []byte) (*Topom, error) { s := &Topom{} if err := jsonDecode(s, b); err != nil { - return nil,err + return nil, fmt.Errorf("json decode error: %w", err) } return s,nil } From a592cc60e0e9e028f28a468f3348705537c787ff Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:48:19 -0400 Subject: [PATCH 23/26] Rename cert.pem to cert.pem-dummy --- codis/{cert.pem => cert.pem-dummy} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codis/{cert.pem => cert.pem-dummy} (100%) diff --git a/codis/cert.pem b/codis/cert.pem-dummy similarity index 100% rename from codis/cert.pem rename to codis/cert.pem-dummy From b7c8ba10a3a233c4fdcade5331677a0cbd48e2c3 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:48:36 -0400 Subject: [PATCH 24/26] Rename key.pem to key.pem-dummy --- codis/{key.pem => key.pem-dummy} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codis/{key.pem => key.pem-dummy} (100%) diff --git a/codis/key.pem b/codis/key.pem-dummy similarity index 100% rename from codis/key.pem rename to codis/key.pem-dummy From 5cfa14226819f2362d7b336a2abeb75da791b09b Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:49:06 -0400 Subject: [PATCH 25/26] Delete codis/key.pem-dummy --- codis/key.pem-dummy | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 codis/key.pem-dummy diff --git a/codis/key.pem-dummy b/codis/key.pem-dummy deleted file mode 100644 index ca0a096252..0000000000 --- a/codis/key.pem-dummy +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQClOgprziC/+nQe -HXV5qJA9gdttn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3NU2xae8um3YrCBtqrh -CS1VtXji+rV/vzNvKqZHaVRt/BwNrBRqO9ddYGWNhE9kZp9vpS+nVUTt6FsiIA/P -5wKZCcQEhus9U6VtpHG0dwhsd6rsaCdESvjY9exR/93/JVDsIXsPY4JtAoGAXCjg -lkzcHBpuf2YMRpqXnLxuRT05D3jLgAcuaAcjwCeu/5U8GvjuiQc/k5H0Q1bghbhn -0hD91Cgq3/LY1jxR73id7v0/vCqPxndF5f7p7+xydPbOTwwPqC7M9xJZiO1SqkVN -o0kM/I8x/GNCw9HpR0xmaHRfguM8bohv+Rh6yD0CgYAfEVhTk+fXshrMeH9qdEwH -AzfQaQtPpQISgoTADT2ZDkZSSDOuVtMK0L/ZvAAeL+jbQh3RJayARfp2o8BnD12U -YIaBq9OC8JUZbG71e93zY/zv4HmZdK/RymmwM2jv9UxTnQPpnHRuVcYF0HZpZSWJ -Xf12eCJQmM/HGdynEvZtcw== ------END PRIVATE KEY----- From 0d607faabbc230632f3a9b76dc5eec35a4b305c6 Mon Sep 17 00:00:00 2001 From: Kol Influence <104323920+kolinfluence@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:49:17 -0400 Subject: [PATCH 26/26] Delete codis/cert.pem-dummy --- codis/cert.pem-dummy | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 codis/cert.pem-dummy diff --git a/codis/cert.pem-dummy b/codis/cert.pem-dummy deleted file mode 100644 index 8c6dbf1382..0000000000 --- a/codis/cert.pem-dummy +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDazCCAlOgAwIBAgIUC/IGKPPBWnAG7MZNPhCUaPmg0oEwDQYJKoZIhvcNAQEL -BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM -GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDAyMDExNTI0MDBaFw0zNDAx -MjkxNTI0MDBaMEUxCzAJBgNVBAYTAkFVMRMw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