一疮薇、安裝Docker
1 先登錄騰訊云后臺(tái)
進(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 檢測(cè)安裝成功了沒
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. 啟動(dòng)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)存大幸ā:
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
有介紹過(guò)代表的含意币励,--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.
( 建立起來(lái)之後珊拼,就依照 container 的操作即可 )
之後查看 http://localhost:9000/ 就會(huì)看到下圖