Installing es under Linux

ghc_ two thousand and eighteen 2022-06-24 06:40:28 阅读数:572

installingeslinux

         I haven't summarized it for a long time , I've been a bit lazy recently .

Recently, big brother asked the whole es Do user data analysis , There was no summary after the last installation , Today, let's sum up , These days, I will also summarize es Usage situation . Here's the thing , Leaders should know app Daily activity and some users use app Mainly use those functions , A user data analysis is required . When I first received the task, I said I would do a daily workload , I thought it was simple , Direct use redis Just make a daily living statistics, and you can't even use the database , The whole day is over . Then this morning, big brother came to say that there was a change , Leaders need to see what users use app Mainly use those functions , How many days a user has logged in continuously , The most common operations are those pages or interfaces .... I lost , This is not to do data analysis , Then I discussed with my eldest brother how to fix it , The final plan given is redis + mq + mysql + es. First use redis save app Daily activity , Then put the behavior data required by the behavior into mq, Spend every night mq Save the data to mysql Do a daily statistical analysis , Then save the data to es, The reason for saving to es The main reason is that the leaders are afraid to make statements at any time , Save in this way es I'm not afraid of the leaders' statements . This is the general demand . No more nonsense , First install es The steps of .

11-1. Need to install jdk1.8 And above
11-2.es By default, it is not allowed to use root Account allowed , You need to set up your own account , Otherwise it will prompt :can not run elasticsearch as root
Query the user cat /etc/passwd
Add users useradd esuser
Set the password passwd 12345678
Delete user userdel esuser
Switching users su esuser
11-3. download tar.gz package ,linux sha asc edition , I use it 7.9.3 Version of , Address :https://www.elastic.co/cn/products/elasticsearch
11-4. Upload, install and unzip mkdir es We will upload the installation package to :/home/es Catalog
decompression :tar -zxvf elasticsearch-7.9.3-linux-x86_64.tar.gz
Directory rename :mv elasticsearch-7.9.3 elasticsearch
11-5. Modify the configuration file , Get into elasticsearch/config Catalog find elasticsearch.yml file
vim elasticsearch.yml
node.name: node-1 # Configuration of the current es The name of the node
cluster.name: my-application
path.data: /home/es/data # Data directory location
path.logs: /home/es/logs # Log directory location
network.host: 0.0.0.0 # The binding of ip: Only local access is allowed by default , It is amended as follows 0.0.0.0 Then you can access it remotely
cluster.initial_master_nodes: "node-1" # Set up master The node list Separate with commas
11-6. stay es Add under directory logs and data Folder
mkdir data
mkdir logs
11-7. modify /etc/security/limits.conf file
vim /etc/security/limits.conf Add the following two lines at the end
* soft nofile 65536
* hard nofile 65536
11-8. modify /etc/sysctl.conf file
stay /etc/sysctl.conf Add a line at the end of the file vm.max_map_count=655360 After modification , Carry out orders : sysctl -p
11-9. take es All file permissions under the file are given to esuser user
Get into home Directory operation
chgrp -R esuser ./es
chown -R esuser ./es
chmod 777 es
11-10. Add open port
firewall-cmd --zone=public --add-port=9300/tcp --permanent
firewall-cmd --zone=public --add-port=9200/tcp --permanent
firewall-cmd --reload
11-11. start-up
su esuser
Get into home/es Directory operation
nohup elasticsearch/bin/elasticsearch >logs/log.log 2>&1 &
11-12. Browser input access address :http:// Your server extranet ip:9200/

copyright:author[ghc_ two thousand and eighteen],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/175/202206240016598820.html