腾讯云安装Docker

一、安装Docker

1 先登录腾讯云后台

进入命令行客户端

2 使用sudo passwd root设置root的密码

ubuntu@VM-0-5-ubuntu:~$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
ubuntu@VM-0-5-ubuntu:~$

3 切换到root用户

ubuntu@VM-0-5-ubuntu:~$ su root
Password:
root@VM-0-5-ubuntu:/home/ubuntu#

4 在服务器下载Docker

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce

5 检测安装成功了没

root@VM-0-5-ubuntu:/home/ubuntu# docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:56 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:21 2018
  OS/Arch:          linux/amd64
  Experimental:     false
root@VM-0-5-ubuntu:/home/ubuntu#

6. 启动docker

root@VM-0-5-ubuntu:/home/ubuntu# sudo service docker start

恭喜,服务器Docker安装完毕~

二、安装elasticsearch6.3.2

1. 拉取镜像

docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2
docker pull docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2

2. 运行开发模式下的es

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2

如果内存不够用,可以换成如下命令,减少elasticsearch使用的内存大小:

docker run -d -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:6.3.2

或者可以增加max_map_count的值:

sudo sysctl -w vm.max_map_count=262144

2 安装IK分词器

https://github.com/medcl/elasticsearch-analysis-ik
进入ES6.3.2的CONTAINER,执行:

./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.3.2/elasticsearch-analysis-ik-6.3.2.zip

三、Docker GUI 的工具portainer

安裝方法可參考 https://portainer.io/install.html

docker volume create portainer_data
docker run --name=portainer -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

-d -p 在前面的 docker run 有介紹過代表的含意,--name 只是命名而已。

Note 1: The -v /var/run/docker.sock:/var/run/docker.sock option is available on Linux environments only.

Note 2: The -v portainer_data:/data portainer/portainer option will persist Portainer data in portainer_data on the host where Portainer is running. You can specify another location on your filesystem.

( 建立起來之後,就依照 container 的操作即可 )

之後查看 http://localhost:9000/ 就會看到下圖

你可能感兴趣的:(腾讯云安装Docker)