2

Following AWS documents, I'm attempting to get a basic LAMP server up and running. Everything appears to be working fine. Logging into MySQL either through the terminal or phpMyAdmin (GUI) works.

However, when I check the status of MariaDB, I'm given an error and unsure how to tackle it.

[ec2-user@ip-172-31-30-51 ~]$ sudo systemctl status mariadb● mariadb.service - 

MariaDB 10.2 database server   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)  Drop-In: /etc/systemd/system/mariadb.service.d           └─override.conf        /usr/lib/systemd/system/mariadb.service.d           └─tokudb.conf   Active: active (running) since Sat 2021-11-13 16:52:39 UTC; 37s ago  Process: 3087 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
  Process: 2837 ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n (code=exited, status=0/SUCCESS)
  Process: 2801 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
 Main PID: 2943 (mysqld)
   Status: "Taking your SQL requests now..."
   CGroup: /system.slice/mariadb.service
           └─2943 /usr/libexec/mysqld --basedir=/usr

Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal mysql-check-upgrade[3087]: ERROR: ld.so: object '/usr/lib64/libjemalloc.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Nov 13 16:52:39 ip-172-31-30-51.ec2.internal systemd[1]: Started MariaDB 10.2 database server.

It's not a problem yet, but I've only just done the installation of everything. So I would imagine problems would arise in the future from this?

EDIT: I'm testing this on a t2.micro EC2 instance with 30GB of storage space.

2 Answers 2

5

I was in the same situation.

To fix, I installed the jemalloc package: sudo yum install jemalloc

Symptoms:

sudo find / -name "libjemalloc*" returned nothing, telling me there was no jemalloc package on my system (perhaps an oversight in the AWS LAMP instructions?), and I found the same log messages when restarting mariadb with systemctl.

I considered ignoring it, but I found these notes that make me believe having jemalloc installed will make my system run smoother (hopefully stopping the mariadb crashes that are plaguing my WordPress site).

To verify:

sudo find / -name "libjemalloc*" now returns /usr/lib64/libjemalloc.so.1 and that's the same path that cat /etc/my.cnf.d/tokudb.cnf refers to in the malloc-lib variable. And now sudo systemctl restart mariadb does not produce the error messages in the question above.

3
  • I created an account only to thank you
    – Salem
    Jan 13, 2022 at 18:58
  • @Salem That's a huge complement. (:
    – jg3
    Jan 13, 2022 at 20:07
  • This worked for me Feb 27 at 3:47
0

Somewhere, there is an environment variable setting

LD_PRELOAD=/usr/lib64/libjemalloc.so.1

while the libjemalloc.so.1 is not actually present.

If you don't have any particular reason to replace the standard malloc(3) implementation with jemalloc, run grep -r jemalloc /etc to find where LD_PRELOAD is getting set, and comment it out or remove it, since the setting will not be effective without the actual library being installed, and will just cause noise in the logs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .