Skip to content

Can't start redis server in Apple M1 chips #6

@pinxiong

Description

@pinxiong

Environment

  • Operating System: Mac OS X
  • OS version: 10.16
  • Chip: Apple M1
  • Arch: x86_64
  • Java version: 11.0.9

Problem

see #7421

Suggestion

I think the best way to solve this problem is to upgrade the redis from 2.8.19 to 6.0.10 or 6.2 RC2 (see #8062, #8195)

We can get some more details from redis releases 6.0.10

Bug fixes:

  • Fix setproctitle related crashes. (#8150, #8088)
    Caused various crashes on startup, mainly on Apple M1 chips or under instrumentation

As @martin-g described, I believe this problem can be solved if I do as follows

  1. downloads the Redis 6.x binary for Mac ARM64 M1
  2. sets system property embedded.redis.executable, and the value is the absolute path of the Redis instance
  3. use ExecutableProvider.newSystemPropertyProvider() to obtain ExecutableProvider for building Redis instance

However, I will update the code if I do like that.

In my opinion, there are two ways to solve it.

  • The one is that we can make customized Redis path first, and the call ExecutableProvider#newEmbeddedRedis2_8_19Provider
  • The other is that we can make the default redis version as 6.0.10, because it's stable, unlikely to change
static Map<OsArchitecture, String> newRedis2_8_19Map() {
        final Map<OsArchitecture, String> map = new HashMap<>();
        map.put(WINDOWS_x86, "/redis-server-2.8.19.exe");
        map.put(WINDOWS_x86_64, "/redis-server-2.8.19.exe");
        map.put(UNIX_x86, "/redis-server-2.8.19-32");
        map.put(UNIX_x86_64, "/redis-server-2.8.19");
        map.put(UNIX_AARCH64, "/redis-server-2.8.19-linux-aarch64");
        map.put(MAC_OS_X_x86, "/redis-server-2.8.19.app");
        map.put(MAC_OS_X_x86_64, "/redis-server-2.8.19.app");
        return map;
    }

In the long term, I think we should support these two options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions