This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git
The following commit(s) were added to refs/heads/master by this push: new dbac344 SCB-330 fix guide of mysql dbac344 is described below commit dbac344f6e7a6e904dc6c0642c72c9539d4e5fe4 Author: Eric Lee <dagang...@huawei.com> AuthorDate: Mon Mar 12 12:54:03 2018 +0800 SCB-330 fix guide of mysql Signed-off-by: Eric Lee <dagang...@huawei.com> --- docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md | 13 +++++++++---- docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md | 13 +++++++++---- saga-demo/booking/README.md | 11 +++++++++-- saga-demo/booking/docker-compose.yaml | 8 ++++---- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md b/docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md index f241b36..0ef18ab 100644 --- a/docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md +++ b/docs/faq/cn/how_to_use_mysql_as_alpha_backend_database.md @@ -11,15 +11,20 @@ 2. 安装Saga ```bash - mvn clean install -Pdocker -DskipTests + mvn clean package -Pdocker -DskipTests ``` 在命令执行完成后,会生成名为alpha-server的镜像和可执行文件`alpha/alpha-server/target/saga/alpha-server-${version}-exec.jar`。 - **注意**: 如果不需要生成docker镜像,则直接运行`mvn clean install -DskipTests`即可。 - **注意**: 如果您之前已生成了alpha-server的docker镜像,则需要在运行命令前将其删除。 + + **注意**: 如果不需要生成docker镜像,则直接运行`mvn clean package -DskipTests`即可。 + + **注意**: 如果您之前已生成了alpha-server的docker镜像,则需要先执行以下命令将其删除: + ```bash + docker rmi -f $(docker images | grep alpha-server | awk '{print $3}') + ``` 3. 运行MySQL ```bash - docker run -d -e "MYSQL_ROOT_PASSWORD=password" "-e "MYSQL_DATABASE=saga" -e "MYSQL_USER=saga" -e "MYSQL_PASSWORD=password" -p 3306:3306 mysql/mysql-server:5.7 + docker run -d -e "MYSQL_ROOT_PASSWORD=password" -e "MYSQL_DATABASE=saga" -e "MYSQL_USER=saga" -e "MYSQL_PASSWORD=password" -p 3306:3306 mysql/mysql-server:5.7 ``` 4. 运行alpha。请确保MySQL在此前已成功启动。alpha的运行可通过docker或可执行文件的方式。 diff --git a/docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md b/docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md index 2bb2954..14fd598 100644 --- a/docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md +++ b/docs/faq/en/how_to_use_mysql_as_alpha_backend_database.md @@ -11,15 +11,20 @@ 2. install Saga ```bash - mvn clean install -Pdocker -DskipTests + mvn clean package -Pdocker -DskipTests ``` After that, you will find the generated docker image `alpha-server` and executable file `alpha/alpha-server/target/saga/alpha-server-${version}-exec.jar`. - **Notice**: If you do not want to build the docker image, run `mvn clean install -DskipTests` is enough. + + **Notice**: If you do not want to build the docker image, run `mvn clean package -DskipTests` is enough. + **Notice**: If you have installed saga with docker before, you need to remove the alpha-server's docker image first. + ```bash + docker rmi -f $(docker images | grep alpha-server | awk '{print $3}') + ``` 3. run MySQL ```bash - docker run -d -e "MYSQL_ROOT_PASSWORD=password" "-e "MYSQL_DATABASE=saga" -e "MYSQL_USER=saga" -e "MYSQL_PASSWORD=password" -p 3306:3306 mysql/mysql-server:5.7 + docker run -d -e "MYSQL_ROOT_PASSWORD=password" -e "MYSQL_DATABASE=saga" -e "MYSQL_USER=saga" -e "MYSQL_PASSWORD=password" -p 3306:3306 mysql/mysql-server:5.7 ``` 4. Run alpha. Please make sure MySQL is up before this step. You can run alpha through docker or executable file. @@ -31,4 +36,4 @@ ```bash java -Dspring.profiles.active=mysql -D"spring.datasource.url=jdbc:mysql://${host_address}:3306/saga?useSSL=false" -jar alpha-server-${saga_version}-exec.jar ``` - **Notice**: Please change `${saga_version}` and `${host_address}` to the actual value before you execute the command. \ No newline at end of file + **Notice**: Please change `${saga_version}` and `${host_address}` to the actual value before you execute the command. diff --git a/saga-demo/booking/README.md b/saga-demo/booking/README.md index 6a97537..8e2dfc3 100644 --- a/saga-demo/booking/README.md +++ b/saga-demo/booking/README.md @@ -35,8 +35,15 @@ You will need: <artifactId>mysql-connector-java</artifactId> </dependency> ``` - - 2. start application up in `saga-demo/booking` with the following command + 2. remove alpha server's docker image + ```bash + docker rmi -f $(docker images | grep alpha-server | awk '{print $3}') + ``` + 3. re-generate saga's docker images + ```bash + mvn package -DskipTests -Pdocker -Pdemo + ``` + 4. start application up in `saga-demo/booking` with the following command ``` docker-compose -f docker-compose.yaml -f docker-compose.mysql.yaml up ``` diff --git a/saga-demo/booking/docker-compose.yaml b/saga-demo/booking/docker-compose.yaml index e528c83..e1e3e30 100644 --- a/saga-demo/booking/docker-compose.yaml +++ b/saga-demo/booking/docker-compose.yaml @@ -32,7 +32,7 @@ services: retries: 5 alpha: - image: "alpha-server:0.0.3-SNAPSHOT" + image: "alpha-server:0.1.0" hostname: alpha-server links: - "database:postgresql.servicecomb.io" @@ -48,7 +48,7 @@ services: condition: service_healthy pack-hotel: - image: "pack-hotel:0.0.3-SNAPSHOT" + image: "pack-hotel:0.1.0" hostname: pack-hotel links: - "alpha:alpha-server.servicecomb.io" @@ -59,7 +59,7 @@ services: condition: service_healthy pack-car: - image: "pack-car:0.0.3-SNAPSHOT" + image: "pack-car:0.1.0" hostname: pack-car links: - "alpha:alpha-server.servicecomb.io" @@ -70,7 +70,7 @@ services: condition: service_healthy pack-booking: - image: "pack-booking:0.0.3-SNAPSHOT" + image: "pack-booking:0.1.0" hostname: pack-booking links: - "alpha:alpha-server.servicecomb.io" -- To stop receiving notification emails like this one, please contact ningji...@apache.org.