![Elasticsearch 7.0 Cookbook(Fourth Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/645/36698645/b_36698645.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it…
Before installing ECE, the following prerequisities are to be checked:
- Your user must be a Docker enabled one. In the case of an error due to a non-Docker user, add your user with sudo usermod -aG docker $USER.
- In the case of an error when you try to access /mnt/data, give your user permission to access this directory.
- You need to add the following line to your /etc/sysctl.conf (a reboot is required): vm.max_map_count = 262144.
- To be able to use the ECE, it must initially be installed on the first host, as follows:
bash <(curl -fsSL https://download.elastic.co/cloud/elastic-cloud-enterprise.sh) install
The installation process should manage these steps automatically, as shown in the following screenshot:
![](https://epubservercos.yuewen.com/EB79F5/19470379208811306/epubprivate/OEBPS/Images/a149fa91-7a6d-40a4-9a5f-a9878beb72f7.png?sign=1739002702-DPXmzSIogUsCQp9zylb5ARRpeHrSKp70-0-a2d35198ddc9854eb2a1fb0949e6778f)
At the end, the installer should provide your credentials so that you can access your cluster in a similar output, as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elastic Cloud Enterprise installation completed successfully
Ready to copy down some important information and keep it safe?
Now you can access the Cloud UI using the following addresses:
http://192.168.1.244:12400
https://192.168.1.244:12443
Admin username: admin
Password: OCqHHqvF0JazwXPm48wfEHTKN0euEtn9YWyWe1gwbs8
Read-only username: readonly
Password: M27hoE3z3v6x5xyHnNleE5nboCDK43X9KoNJ346MEqO
Roles tokens for adding hosts to this installation:
Basic token (Don't forget to assign roles to new runners in the Cloud UI after installation.)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiZDI3NjZjZi1iNWExLTQ4YTYtYTRlZi1iYzE4NTlkYjQ5ZmEiLCJyb2xlcyI6W10sImlzcyI6ImN1cnJlbnQiLCJwZXJzaXN0ZW50Ijp0cnVlfQ.lbh9oYPiJjpy7gI3I-_yFBz9T0blwNbbwtWF_-c_D3M
Allocator token (Simply need more capacity to run Elasticsearch clusters and Kibana? Use this token.)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjYTk4ZDgyNi1iMWYwLTRkZmYtODBjYS0wYWYwMTM3M2MyOWYiLCJyb2xlcyI6WyJhbGxvY2F0b3IiXSwiaXNzIjoiY3VycmVudCIsInBlcnNpc3RlbnQiOnRydWV9.v9uvTKO3zgaE4nr0SDfg6ePrpperIGtvcGVfZHtmZmY
Emergency token (Lost all of your coordinators? This token will save your installation.)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI5N2ExMzg5Yi1jZWE4LTQ2MGItODM1ZC00MDMzZDllNjAyMmUiLCJyb2xlcyI6WyJjb29yZGluYXRvciIsInByb3h5IiwiZGlyZWN0b3IiXSwiaXNzIjoiY3VycmVudCIsInBlcnNpc3RlbnQiOnRydWV9._0IvJrBQ7RkqzFyeFGhSAQxyjCbpOO15qZqhzH2crZQ
To add hosts to this Elastic Cloud Enterprise installation, include the following parameters when you install the software
on additional hosts: --coordinator-host 192.168.1.244 --roles-token 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJiZDI3NjZjZi1iNWExLTQ4YTYtYTRlZi1iYzE4NTlkYjQ5ZmEiLCJyb2xlcyI6W10sImlzcyI6ImN1cnJlbnQiLCJwZXJzaXN0ZW50Ijp0cnVlfQ.lbh9oYPiJjpy7gI3I-_yFBz9T0blwNbbwtWF_-c_D3M'
These instructions use the basic token, but you can substitute one of the other tokens provided. You can also generate your own tokens. For example:
curl -H 'Content-Type: application/json' -u
admin: OCqHHqvF0JazwXPm48wfEHTKN0euEtn9YWyWe1gwbs8 http://192.168.1.244:12300/api/v1/platform/configuration/security/enrollment-tokens -d '{ "persistent": true, "roles": [ "allocator"] }'
To learn more about generating tokens, see Generate Role Tokens in the documentation.
System secrets have been generated and stored in /mnt/data/elastic/bootstrap-state/bootstrap-secrets.json.
Keep the information in the bootstrap-secrets.json file secure by removing the file and placing it into secure storage, for example.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- In my case, I can access the installed interface at http://192.168.1.244:12400.
After logging into the admin interface, you will see your actual cloud state, as follows:
![](https://epubservercos.yuewen.com/EB79F5/19470379208811306/epubprivate/OEBPS/Images/0acbe23e-22fb-4902-9976-1d92a1a90ac9.png?sign=1739002702-Zd2jE3dENcjQsbCKJoLygZywLKjRHdVD-0-c3bf9801d3d298560483e5b789f42235)
- You can now press on Create Deployment to fire your first Elasticsearch cluster, as follows:
![](https://epubservercos.yuewen.com/EB79F5/19470379208811306/epubprivate/OEBPS/Images/9c96a56c-2da3-49f5-89b4-28069fc7d45f.png?sign=1739002702-yyYXcbOjGtoxuYsKF4elbTxN1uJpOYCI-0-92451722e5fc0b1b75cd7fddb89ce93f)
- You need to define a name (that is, a book-cluster). Using standard options for this is okay. After pressing Create Deployment, ECE will start to build your cluster, as follows:
![](https://epubservercos.yuewen.com/EB79F5/19470379208811306/epubprivate/OEBPS/Images/e356a8b1-b9fa-48e0-8ff5-69798c8a0268.png?sign=1739002702-ViQQilqxcbYW2tFiTG4Nh8Q99ylf3tKZ-0-13684ccbaeae6809087cd659bf2d0eac)
- After a few minutes, the cluster should be up and running, as follows:
![](https://epubservercos.yuewen.com/EB79F5/19470379208811306/epubprivate/OEBPS/Images/a061b3d7-81b7-4e3f-bfaf-2bd38d197e7d.png?sign=1739002702-JAzfCwEx9cBcgBYyriE6PTVIrYPW5B8h-0-7f8d6cfad1857f8c45243bf86716825a)