diff --git a/README.md b/README.md index 55383574..42c4999e 100644 --- a/README.md +++ b/README.md @@ -99,4 +99,12 @@ nginx不使用docker,物理机使用 docker compose port:port端口映射到 依赖:mysql redis srs influxdb docker compose port:port端口映射到本地 -服务:usercenter iotcenter jobserver docker compose port:port端口映射到本地 \ No newline at end of file +服务:usercenter iotcenter jobserver docker compose port:port端口映射到本地 + +##cockroachdb集群 + +cockroach start --insecure --host=localhost --http-port=8801 +cockroach start --insecure --store=node2 --host=localhost --port=26258 --http-port=8802 --join=localhost:26257 +cockroach start --insecure --store=node3 --host=localhost --port=26259 --http-port=8803 --join=localhost:26257 + +生成haproxy配置文件:cockroach gen haproxy --insecure \ No newline at end of file diff --git a/labs/CockRoachDBTest/CockRoachDBJPATest/src/main/resources/application.properties b/labs/CockRoachDBTest/CockRoachDBJPATest/src/main/resources/application.properties index dde7a8fc..983644bd 100644 --- a/labs/CockRoachDBTest/CockRoachDBJPATest/src/main/resources/application.properties +++ b/labs/CockRoachDBTest/CockRoachDBJPATest/src/main/resources/application.properties @@ -3,13 +3,15 @@ #生成环境,ddl-auto设置为validate,只在启动项目时只校验表结构 spring.jpa.hibernate.ddl-auto=create spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL94Dialect +spring.jpa.show-sql=true +spring.datasource.username=root +spring.datasource.password= +#insecure spring.datasource.url=jdbc:postgresql://localhost:26257/mytestj?sslmode=disable +#ssl #certs.path=D:/1.0/ZHXY/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/certs/ #spring.datasource.url=jdbc:postgresql://localhost:26257/mytestj?ssl=true\ # &sslfactory=org.postgresql.ssl.jdbc4.LibPQFactory\ # &sslcert=${certs.path}client.root.crt\ # &sslkey=${certs.path}client.root.pk8\ -# &sslrootcert=${certs.path}ca.crt -spring.jpa.show-sql=true -spring.datasource.username=root -spring.datasource.password= \ No newline at end of file +# &sslrootcert=${certs.path}ca.crt \ No newline at end of file diff --git a/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/.gitignore b/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/.gitignore index 4c324007..40c8821c 100644 --- a/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/.gitignore +++ b/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/.gitignore @@ -1 +1,3 @@ -cockroach-data \ No newline at end of file +cockroach-data +node2 +node3 \ No newline at end of file diff --git a/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/haproxy.cfg b/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/haproxy.cfg new file mode 100644 index 00000000..f0e14755 --- /dev/null +++ b/labs/CockRoachDBTest/cockroach-v2.0.5.windows-6.2-amd64/haproxy.cfg @@ -0,0 +1,23 @@ + +global + maxconn 4096 + +defaults + mode tcp + # Timeout values should be configured for your specific use. + # See: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4-timeout%20connect + timeout connect 10s + timeout client 1m + timeout server 1m + # TCP keep-alive on client side. Server already enables them. + option clitcpka + +listen psql + bind :26000 + mode tcp + balance roundrobin + option httpchk GET /health?ready=1 + server cockroach1 localhost:26257 check port 8801 + server cockroach2 localhost:26258 check port 8802 + server cockroach3 localhost:26259 check port 8803 + diff --git a/projects/IoT.Shared/Application/Models/EditSceneModel.cs b/projects/IoT.Shared/Application/Models/EditSceneModel.cs index 31ab0d7a..f212b83f 100644 --- a/projects/IoT.Shared/Application/Models/EditSceneModel.cs +++ b/projects/IoT.Shared/Application/Models/EditSceneModel.cs @@ -7,11 +7,6 @@ namespace Application.Models [Display(Name = "场景")] public class EditSceneModel : EditModel { - [DataType("SelectList")] - [Display(Name = "机构")] - [Required(ErrorMessage = nameof(RequiredAttribute))] - public Guid? OrganId { get; set; } - [DataType("SelectList")] [Display(Name = "节点")] [Required(ErrorMessage = nameof(RequiredAttribute))] diff --git a/projects/IoTCenter/appsettings.json b/projects/IoTCenter/appsettings.json index d578479c..53abbe93 100644 --- a/projects/IoTCenter/appsettings.json +++ b/projects/IoTCenter/appsettings.json @@ -56,7 +56,7 @@ "register": "/UserCenter/Account/Register" }, "ConnectionStrings": { - "postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotcenter;CommandTimeout=120", + "postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotcenter;CommandTimeout=600;TrustServerCertificate=true;", "sqlite": "Data Source=iotcenter.db", "mysql": "Server=localhost;Port=3306;Database=iotcenter;Uid=root;Pwd=root;", "redis": "localhost:6379,allowAdmin=true", diff --git a/projects/Version.cs b/projects/Version.cs index 2fd1479e..6b8a74ad 100644 --- a/projects/Version.cs +++ b/projects/Version.cs @@ -1,4 +1,4 @@ using System.Reflection; [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("1.0.0.802d1")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("1.0.0.805d1")] \ No newline at end of file