diff --git a/Hadoop/ZKLT.Hadoop.API/Program.cs b/Hadoop/ZKLT.Hadoop.API/Program.cs index 4bd3f71..38f3a30 100644 --- a/Hadoop/ZKLT.Hadoop.API/Program.cs +++ b/Hadoop/ZKLT.Hadoop.API/Program.cs @@ -40,25 +40,25 @@ namespace ZKLT.Hadoop.API app.UseCors("all"); #endregion - //app.UseHadoop((c) => - //{ - // c.Host = "127.0.0.1"; - // c.Account = "root"; - // c.PassWord = "root"; - // c.Key = "devdb"; - // c.Port = 3306; - //}); - - app.UseHadoop((c) => { - c.Host = "172.17.0.1"; + c.Host = "127.0.0.1"; c.Account = "root"; c.PassWord = "root"; - c.Key = "testdb"; - c.Port = 4000; + c.Key = "hadoopdb"; + c.Port = 3306; }); + + //app.UseHadoop((c) => + //{ + // c.Host = "172.17.0.1"; + // c.Account = "root"; + // c.PassWord = "root"; + // c.Key = "testdb"; + // c.Port = 4000; + //}); + //app.UseHadoop((c) => //{ // c.Host = "118.195.165.218"; diff --git a/Hadoop/ZKLT.Hadoop/HadoopService.cs b/Hadoop/ZKLT.Hadoop/HadoopService.cs index d345032..79b77ba 100644 --- a/Hadoop/ZKLT.Hadoop/HadoopService.cs +++ b/Hadoop/ZKLT.Hadoop/HadoopService.cs @@ -127,13 +127,6 @@ namespace ZKLT.Hadoop { throw new Exception("初始化数据列失败"); } - - //var _file = HDP_Table.Class2Table(); - //_Tables.Add(_file); - //if (!_TableService.InitStruct(_Source, _file)) - //{ - // throw new Exception("初始化文件失败"); - //} } /// diff --git a/ZKLT.sln b/ZKLT.sln index d9ae477..375db1a 100644 --- a/ZKLT.sln +++ b/ZKLT.sln @@ -13,6 +13,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZKLT.Hadoop.Interface", "Ha EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZKLT.Hadoop.API", "Hadoop\ZKLT.Hadoop.API\ZKLT.Hadoop.API.csproj", "{398DF3E5-B94B-4B2E-9DC6-B6741D7CF4DB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker-compose", "docker-compose", "{1E26F2C2-6BCB-4E5D-ADC5-C6AD923155F9}" + ProjectSection(SolutionItems) = preProject + docker-compose\mysql.yml = docker-compose\mysql.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/docker-compose/mysql.yml b/docker-compose/mysql.yml new file mode 100644 index 0000000..9f2c6a0 --- /dev/null +++ b/docker-compose/mysql.yml @@ -0,0 +1,20 @@ +version: '3' +services: + hadoop_mysql: + restart: always + image: mysql:8 + container_name: hadoop_mysql + # volumes: + # - /apps/mysql/mydir:/mydir + # - /apps/mysql/datadir:/var/lib/mysql + # - /apps/mysql/conf/my.cnf:/etc/my.cnf + # # 数据库还原目录 可将需要还原的sql文件放在这里 + # - /apps/mysql/source:/docker-entrypoint-initdb.d + environment: + - "MYSQL_ROOT_PASSWORD=root" + - "MYSQL_DATABASE=hadoopdb" + - "TZ=Asia/Shanghai" + ports: + # 使用宿主机的3306端口映射到容器的3306端口 + # 宿主机:容器 + - 3306:3306 \ No newline at end of file