redhat7 MongoDB install with yum error_1
2022. 8. 1. 17:38ㆍ웹개발
// repo 파일 만들기
sudo vi /etc/yum.repos.d/mongodb-org.repo
// 파일 안에 내용 채우기
[MongoDB]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
설치하려니 에러가 뜨면서 진행이 안되는 상황 발생.
// 몽고 설치
sudo yum install mongodb-org
# Err
// 몽고문제인지 확인 위해 레포지토리와 잘 연결되어있는지 확인
yum repolist
# Err
문제는 yum
<전체 에러>
$ yum install mongodb-org
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
https://repo.mongodb.org/yum/redhat/7Server/mongodb-org/4.2/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could n ot resolve host: repo.mongodb.org; Unknown error"
Trying other mirror.
One of the configured repositories failed (MongoDB Repository),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=mongodb-org-ex-4.2 ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable mongodb-org-ex-4.2
or
subscription-manager repos --disable=mongodb-org-ex-4.2
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=mongodb-org-ex-4.2.skip_if_unavailable=true
failure: repodata/repomd.xml from mongodb-org-ex-4.2: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/7Server/mongodb-org/4.2/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could n ot resolve host: repo.mongodb.org; Unknown error"
뭐가 문제인지 모르겠어서 일단 네트워크 전송은 잘 되는지 확인
ping 8.8.8.8
nmcli d
em2는 찾아도 안나와서 다시 제대로 찾아봐야 할 듯.
그래도 핵심 두개 다 연결되어있고 전송보내기 받기 모두 잘 된다.
구글링을 해보니 레포지토리 제거하고 yum을 클린하거나 exclude 하라는 등 뭐 많이 있어서 다 해봤다.
// clean all
sudo rm -rf /etc/yum.repos.d/mongod*
rm -fr /var/cache/yum/*
sudo yum clean all
// create again
sudo vi /etc/yum.repos.d/mongodb-org-4.2.repo
# 아직 에러
// 구글링해보고 마지막 이거밖에 안남은 상황
dhclient
# 해결!!!!!!!!!!!!!!!!
yum repolist
/*
Loaded plugins: langpacks, product-id, search-disabled-repos
mongodb-org-4.2 | 2.5 kB 00:00:00
mongodb-org-4.2/7Server/primary_db | 98 kB 00:00:00
repo id repo name status
mongodb-org-4.2/7Server MongoDB Repository 51+105
repolist: 51
*/
no more mirror는 해결
no package mongodb-org available나왔다
sudo yum install mongodb-org
/*
Loaded plugins: langpacks, product-id, search-disabled-repos
No package mongodb-org available.
Error: Nothing to do
*/
// 내가 붙였던 exclude문제인것같아서 /etc/yum.conf에서 주석처리
sudo yum install -y mongodb-org
# 해결!!!!!
/*
Loaded plugins: langpacks, product-id, search-disabled-repos
mongodb-org-4.2 | 2.5 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:4.2.21-1.el7 will be installed
--> Processing Dependency: mongodb-org-shell = 4.2.21 for package: mongodb-org-4.2.21-1.el7.x86_64
--> Processing Dependency: mongodb-org-tools = 4.2.21 for package: mongodb-org-4.2.21-1.el7.x86_64
...
*/
설치는 완료, 근데 data/db가 없다고 한다. 만들었는데?
연결이 안 된 것
나는 원격으로 진행중이었고 데이터도 ec2 내부에 둘거라 C:\관련된 내용은 의미없었다.
// 심볼릭링크 연결
// mongod.conf에서 지정한 데이터경로는 -f 흐름 이후 진행
mongod -f /etc/mongod.conf
상기 코드 실행시 디비 경로 연결은 완료
아직 에러 다 못잡았는데 이건 내일 하기로하자.
728x90
'웹개발' 카테고리의 다른 글
AWS EC2 생성 및 연결 확인_Ubuntu (0) | 2022.08.08 |
---|---|
redhat7 MongoDB install with SELinux error_2 (0) | 2022.08.02 |
netstat, ss (0) | 2022.07.29 |
nodemon (0) | 2022.07.21 |
--save vs --save-dev (0) | 2022.07.21 |