PrefaceToday I found that es logs were not recorded. After checking filebeat, elasticsearch, and logstash, I found that the es indexes had become read-only. After manually modifying the index mode, it became read-only again after a few minutes. After further reading, I found out that the reason is that once any index of one or more shards is allocated on a node that stores more than 95% of the disk, the index will be forced into read-only mode. So the only option is to expand the disk space. The following briefly describes the steps for disk expansion. stepThe disk already had two partitions, but the allocated space was not large. Add a disk and mount the new disk sdc through the management terminal; Use fdisk /dev/sdc to create a new partition; [root@localhost indices]# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x5799aeba. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: The size of this disk is 2.2 TB (2199023255552 bytes). DOS partition table format can not be used on drives for volumes larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID partition table format (GPT). WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u'). Command (m for help): n #new new partition Command action e extended p primary partition (1-4) p #Select the primary sector Partition number (1-4): 1 #Starting sector First cylinder (1-267349, default 1): #Press Enter here to take the default value 1 Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-267349, default 267349): #Since es requires a large amount of storage space, I have added 2T of space. Normally, the sector size can be modified as required. Using default value 267349 Command (m for help): w #Save and exit The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. Then create a physical volume using the pvcreate /dev/sdc1 command. Note: Many articles here require you to restart the system, but you don’t actually need to restart the system here. You can do it directly without affecting the normal operation of the server. [root@localhost indices]# pvcreate /dev/sdc1 Physical volume "/dev/sdc1" successfully created Use vgscan to view the physical volume group name; [root@localhost indices]# vgscan Reading all physical volumes. This may take a while... Found volume group "VolGroup" using metadata type lvm2 #The physical volume group name here is VolGroup Load the newly added physical sectors into the volume group, here use vgextend VolGroup /dev/sdc1; [root@localhost indices]# vgextend VolGroup /dev/sdc1 Volume group "VolGroup" successfully extended Increase the size of the volume group. Here, use lvextend -L +2048G /dev/mapper/VolGroup-lv_root. [root@localhost indices]# lvextend -L +2048G /dev/mapper/VolGroup-lv_root Size of logical volume VolGroup/lv_root changed from 135.47 GiB (34681 extents) to 2.13 TiB (558848 extents). Logical volume lv_root successfully resized. Use df -h to check the space expansion status and find that the space has not been expanded. This is because the file system has not been synchronized. [root@localhost indices]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 134G 119G 8.4G 94% / tmpfs 32G 72K 32G 1% /dev/shm /dev/sda1 477M 41M 411M 10% /boot Synchronize the file system. Use xfs_growfs or resize2fs to synchronize the file system. Do the following: [root@localhost indices]# resize2fs -f /dev/mapper/VolGroup-lv_root resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/mapper/VolGroup-lv_root is mounted on /; on-line resizing required old_desc_blocks = 9, new_desc_blocks = 137 Performing an on-line resize of /dev/mapper/VolGroup-lv_root to 572260352 (4k) blocks. The filesystem on /dev/mapper/VolGroup-lv_root is now 572260352 blocks long. Then use df -h to view the space expansion status [root@localhost indices]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup-lv_root 2.1T 125G 1.9T 7% / tmpfs 32G 72K 32G 1% /dev/shm /dev/sda1 477M 41M 411M 10% /boot Since the file system formats of the default root file systems of CentOS6 and CentOS7 are different, it is necessary to determine whether it is xfs. If it is xfs, xfs_growfs should be used instead of resize2fs. This is the end of this article about how to expand the disk space of a Linux server. For more information about how to expand the disk space of a Linux server, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of commonly used CSS encapsulation methods
>>: Two methods to stretch the background image of a web page
Table of contents Preface 1. The request content ...
When you see a class, what information do you wan...
Table of contents Preface 1. With vue-cli 1. Defi...
We can set a background image for the cell, and w...
In fact, we wonder every day when IE6 will really...
The PC version of React was refactored to use Ama...
Introduction In orm frameworks, such as hibernate...
First, let me show you the finished effect Main i...
Table of contents Component Design Defining the f...
Achieve results Implementation ideas The melting ...
This article introduces an example of using HTML+...
<br />Original source: http://www.a-xuan.cn/...
Hi, everyone; today is Double 12, have you done a...
Redis Introduction Redis is completely open sourc...
Table of contents Scenario Analysis Development S...