小编Shi*_*raj的帖子

Docker安装在Linux Mint 19 Tara上

我试图在Linux上安装docker详情如下 -

    Mint version 19, 
    Code name : Tara,
    PackageBase : Ubuntu Bionic
    Cinnamon (64-bit)
Run Code Online (Sandbox Code Playgroud)

参考链接:https://docs.docker.com/install/linux/docker-ce/ubuntu/

脚步:

1. sudo apt-get remove docker docker-engine docker.io

2. sudo apt-get update

3. sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

4. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

5. sudo apt-key fingerprint 0EBFCD88

6. sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

7. sudo apt-get update

8. sudo apt-get install docker-ce
Run Code Online (Sandbox Code Playgroud)

对于第6步,我检查了lsb_release -cs

xxxxxxxxx:~$ lsb_release -cs
tara
Run Code Online (Sandbox Code Playgroud)

我在第7步看到了问题. …

linux ubuntu linux-mint docker cinnamon

20
推荐指数
1
解决办法
1万
查看次数

Eureka 的 Springboot 错误,浏览器显示 xml 而不是 json

我使用 Java8 和 SpringBoot 使用 Maven 创建了一个微服务。让我们称之为 MicroServiceA

它具有返回 ResponseEntity 对象的控制器,如下所示:

    @RestController
    @RequestMapping("/api")
    public class MicroserviceAController {  


        @GetMapping(value = "/all")
        public ResponseEntity<ServiceAResponseWrapper<List<ServiceADto>>> getAll() {

ServiceAResponseWrapper<List<ServiceADto>> wrapper = 
    new ServiceAResponseWrapper<List<ServiceADto>>(ServiceAResponseStatus.SUCCESS,findAll());

return new ResponseEntity<ServiceAResponseWrapper<List<ServiceADto>>>(wrapper,HttpStatus.OK);

        }

      public static List<ServiceADto> findAll() {
        //returns list of ServiceADto objects
    }

    }
Run Code Online (Sandbox Code Playgroud)

当我启动此服务并在任何浏览器中验证它时:http://localhost:8073/api/all/,我得到显示的 JSON 响应。

现在,如果我想将我的服务引入 EUREKA 服务注册中心,那么我需要进行以下更改。

  1. 创建 EUREKA 服务器微服务。我启动它 - http://localhost:8761/
  2. 对 MicroserviceA 进行如下更改 -

转到 pom.xml 并添加依赖项

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

转到 application.yml 并添加以下内容:

eureka:
  client:
    registerWithEureka: true …
Run Code Online (Sandbox Code Playgroud)

java xml json spring-boot netflix-eureka

2
推荐指数
1
解决办法
1154
查看次数

标签 统计

cinnamon ×1

docker ×1

java ×1

json ×1

linux ×1

linux-mint ×1

netflix-eureka ×1

spring-boot ×1

ubuntu ×1

xml ×1