“This is the 12th day of my Participation in the August More Text Challenge. Check out the details:August is more challenging”
Note: ElasticSearch
Install ElasticSearch, Kibana, Elasticsearch-head
Related Setup details
1. Start with non-root permission
In the new ElasticSearch version, non-root users can be configured to create a user and authorize it. Or boot error!!
1.1 Creating an ElasticSearch User Group
Example Create a MOE user group
groupadd moe
Copy the code
1.2 Creating an ElasticSearch User
Create the MOE user and set the password
useradd moe
passwd es110
Copy the code
1.3 Adding a user MOE to user group MOE
usermod -G moe moe
Copy the code
1.4 Granting MOE rights to a User
chown -R /soft/es/
Copy the code
1.5 Setting sudo Permissions
User root runs the visudo command to grant the root permission to user MOE
moe ALL=(ALL) ALL
Copy the code
2. ElasticSearch access
Es access: http://ip:9200 Verify that the ES setup is ok
S201, S202, and S203 are the hostname of the node. Only after the hosts are configured can the following access ha!
Nodes201: http://s201:9200/
Nodes202: http://s202:9200/
Nodes203: http://s203:9200/
3. Kibana access
Visit http://ip:5601
http://s201:5601/
4. Visit es – head
Visit http://ip:9100
Es default index, Kibana related index
Master Node Master Node
Data Node Data Node
Primary Shard
Sub-fragment Replica Shard
2. ElasticSearch fragments
Three nodes, such as creating a moe_article index, specify three shards and two copies
PUT /moe_article
{
"mappings": {
"properties": {}},"settings": {
"number_of_shards": 3."number_of_replicas": 2}}Copy the code
Sharding distribution link
If you specify 3 shards and 2 replicas, how are they distributed? Imagine that!
Third, summary
The new VERSION of ES needs to pay attention to the user identity, non-root user, may encounter a lot of problems in the process of construction, diy solution is a very good self improvement.
Welcome to follow the wechat official account (MarkZoe) to learn from each other and communicate with each other.