vagrant와 함께 사용할 때 postgresql을 시작하지 못함

vagrant와 함께 사용할 때 postgresql을 시작하지 못함

Vagrant가 관리하는 Virtualbox VM에서 postgresql을 시작하려고 하면 다음 오류가 발생합니다.

LOG:  could not link file "pg_xlog/xlogtemp.29" to "pg_xlog/000000010000000000000001" (initialization of log file): Operation not permitted
FATAL:  could not open file "pg_xlog/000000010000000000000001": No such file or directory

````

답변1

이는 postgresql의 데이터 디렉터리가 Vagrant 공유 폴더( /vagrant예를 들어)에 있고 Vagrant 호스트가 Windows일 때 발생합니다. 이 경우 권한은 Unix 방식으로 설정할 수 없습니다.

해당 폴더를 다른 위치(예: 방랑자 사용자의 홈 디렉토리)로 이동하면 postgresql이 시작됩니다.

해결책은 다음에서 찾을 수 있습니다.https://gitlab.com/gitlab-org/gitlab-development-kit/issues/20

답변2

이에 대한 근본적인 원인은 vboxsf가 파일 시스템 링크(하드 링크나 기호 링크 모두)를 지원하지 않기 때문입니다. VirtualBox 게스트 내에 호스트 폴더를 탑재하고 다음을 수행하여 문제를 재현할 수 있습니다. ln /path/to/mounted/share/existingfile.txt /some/path/link-to-file.txt

예를 들어 (/var/data가 vboxsf 공유로 마운트됨) jim@a55a005fc5a5:/~ ln /var/data/foo.txt ~/data/link-to-foo ln: failed to create hard link ‘/users/jim/data/link-to-foo’ => ‘/var/data/foo.txt’: Operation not permitted

virtualbox.org에는 이에 대한 수많은 티켓이 있습니다(#818,#10085) 하지만 7년 전으로 돌아가 보면 아직 해결되기까지 시간이 더 걸릴 수도 있습니다!

관련 정보