Docker deploys elasticsearch stand-alone in the window environment

Raku

docker pull elasticsearch:7.7.0

Create three folders on the D drive config, dataand pluginsthe path for mounting

elasticsearch.ymlUse the file that comes with the image , xpack.security.http.sslbecause the authentication trueis enabled , access will not be accessible, you can change it or create a file in the folder , and add the following configurationsslhttp://localhost:9200/falseconfigelasticsearch.yml

# Cluster name 
cluster.name: docker-cluster 
# Node name 
node.name: node 
# Listening ip 
network.host: 0.0.0.0 
# Open the x-pack plug-in, used to add account password, change to false to avoid login 
xpack.security .enabled: true

Execute the following code to generate the container and mount the previously created folder

ES_JAVA_OPTSThe startup memory of ES is set, if it is not set, it will explode

discovery.type=single-nodeIndicates that the es is a single node. If you do not add this, your ES health status will be displayed in yellow

restart=always means booting automatically

docker run -d --name elasticsearch -v D:\elasticsearch\config\elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml -v D:\elasticsearch\plugins:/usr/share/elasticsearch/plugins -v D:\elasticsearch\data:/usr/share/elasticsearch/data -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 --restart=always elasticsearch:7.7.0
​

Enter elasticsearchthe container to set the password. You need to enter multiple times to add passwords to multiple systems. The default user name is elastic

docker exec -it elasticsearch bash
elasticsearch-setup-passwords interactive

2. Install Chinese word segmentation ik

Enter the container, install the ik Chinese word segmentation version must be the same as the es version, otherwise the installation will report an error, if the Chinese word segmentation is not used, do not install it, enter the container and execute the following statement, and the following result indicates that the installation is complete

./bin/elasticsearch-plugin install https://git.xfj0.cn/https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.7.0/elasticsearch-analysis-ik-7.7.0.zip

3. Install Kibana

Kibana is a free and open front-end application based on Elastic Stackproviding search and data visualization capabilities for data indexed in Elasticsearch. Although commonly Kibanaseen as Elastic Stacka graphing tool for (formerly known as ELK Stack, standing for Elasticsearch, Logstash, and Kibana respectively), it can also be used Kibanaas user interface to monitor, manage Elastic Stackand secure clusters, and as Elastic Stackan A hub for developing built-in solutions.

Let's pull down the image of kibana first

docker pull kibana:7.7.0

Create kibana.ymlthe file as follows elasticsearch.usernameand use the last elasticsearch.passwordconfigured in es above . The account is the default account. If it is , it is not needed. Configured as the address of the host host of es.xpack.security.http.ssltruefalseelasticsearch.hosts

server.host: "0.0.0.0"
server.shutdownTimeout: "5s"
elasticsearch.hosts: [ "http://10.10.1.61:9200" ]
monitoring.ui.container.elasticsearch.enabled: true
elasticsearch.username: "kibana" 
elasticsearch.password: "qwe123"

Then create a container to kibana.ymlmount the configuration file

docker run -d --name kibana -v D:\elasticsearch\kibana\config\kibana.yml:/usr/share/kibana/config/kibana.yml  -p 5601:5601 kibana:7.7.0

Wait for a while, http://localhost:5601/the following login page will appear when we visit, at this time we enter the account password of es, here is elasticand 123456, we can log in

Fourth, install elasticsearch -head

#Pull image 
docker pull mobz/elasticsearch-head:5 
​#Create
container 
docker create --name elasticsearch-head -p 9100:9100 mobz/elasticsearch-head:5 
​#Start
container 
docker run -d --name es_admin - p 9100:9100 mobz/elasticsearch-head: 
5

The configuration of elasticSearch-head is not modified during operation, and a 406 error code will be reported by default

#Copy vendor.js to external 
docker cp 03535c8ba51b:/usr/src/app/_site/vendor.js D:\IDM download 
#
Modify vendor.js 
vim vendor.js 
modification is completed and copied back to the container 
docker cp D:\IDM Download\vendor.js 03535c8ba51b:/usr/src/app/_site

Guess you like

Origin blog.csdn.net/weixin_53336463/article/details/129450904