騰訊云安裝Docker

一、安裝Docker

1 先登錄騰訊云后臺

進(jìn)入命令行客戶端

2 使用sudo passwd root設(shè)置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 在服務(wù)器下載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

恭喜,服務(wù)器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. 運(yùn)行開發(fā)模式下的es

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

如果內(nèi)存不夠用,可以換成如下命令,減少elasticsearch使用的內(nèi)存大?。?/p>

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
進(jìn)入ES6.3.2的CONTAINER,執(zhí)行:

./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/ 就會看到下圖

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容