较旧版本的Docker被称为docker或docker-engine。若是已安装这些,请卸载它们以及相关的依赖项。html
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
保留/var/lib/docker/的内容,包括图像,容器,卷和网络。
Docker Engine - 社区包如今称为docker-ce。node
您能够根据须要以不一样方式安装Docker Engine。linux
这次演示,咱们选择社区推荐的方法,也就是设置存储库的方法。git
`sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2`github
`sudo yum-config-manager \
--add-repo \
https://download.docker.com/l...`docker
你能够安装最新版yum install docker-ce docker-ce-cli containerd.io
bootstrap
也能够经过命令查看支持的版本号,进行特定版本安装ubuntu
yum list docker-ce --showduplicates | sort -r
centos
sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
bash
sudo systemctl start docker
经过运行hello-world映像验证Docker Engine - 社区是否已正确安装。
sudo docker run hello-world
[root@VM_0_11_centos ~]# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ ```
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
version: '2.2' services: cerebro: image: lmenezes/cerebro:0.8.3 container_name: cerebro ports: - "9000:9000" command: - -Dhosts.0.host=http://elasticsearch:9200 networks: - es7net kibana: image: docker.elastic.co/kibana/kibana:7.2.0 container_name: kibana7 environment: - I18N_LOCALE=zh-CN - XPACK_GRAPH_ENABLED=true - TIMELION_ENABLED=true - XPACK_MONITORING_COLLECTION_ENABLED="true" ports: - "5601:5601" networks: - es7net elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0 container_name: es7_01 environment: - cluster.name=geektime - node.name=es7_01 - bootstrap.memory_lock=true - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - discovery.seed_hosts=es7_01 - cluster.initial_master_nodes=es7_01 ulimits: memlock: soft: -1 hard: -1 volumes: - es7data1:/usr/share/elasticsearch/data ports: - 9200:9200 networks: - es7net volumes: es7data1: driver: local networks: es7net: driver: bridge
在腾讯云上面,想搭建一套elasticsearch集群,发现discover的时候,获取不到集群信息。
后面发现是因为 network.host这个配置也包含了network.publish_host这个配置了。
那么在腾讯云上面,就会出现这两个地址同时指向了腾讯云服务器的内网ip,致命的是两台服务器的内网IP并不能互通,致使了这个问题。
解决这个问题也很简单
network.host: $内网IP$ network.publish_host: $公网IP$
另外附上官网network配置说明
docker-compose up
docker-compose down
docker-compose down -v
docker ps docker stop Name/ContainerId docker start Name/ContainerId
-f, –force=false; -l, –link=false Remove the specified link and not the underlying container; -v, –volumes=false Remove the volumes associated to the container
rm docker ps -a -q
start Name/ID kill Name/ID restart name/ID