Loading views...
mount and mysql

mount and mysql

Date
Date
2019 Dec 24 0:0
Created by
Created by
Seonglae ChoSeonglae Cho
Created time
Created time
2023 Feb 28 12:39
Last edited by
Last edited by
Seonglae ChoSeonglae Cho
Last edited time
Last edited time
2023 Apr 15 16:56
Refs
Refs

mount startup issue


[Centos] 서비스 등록 /etc/init.d/ 사용법
etc/init.d/ 는 /etc/rc.d/init.d/ 심볼릭 링크(바로가기) 로 같은 폴더이다 /etc/rc.d/내에는 rc1.d , rc2.d ,rc3.d rc4.d rc5.d ,rc6.d init.d 각 부트레벨을 포함한다 서비스 확인 방법 # service crond # /etc/init.d/crond status # chkconfig list /etc/init.d 내에 스크립트 작성 # vi /etc/init.d/test # chkconfig: 234 90 90 ※ chkconfig 등록하기 위해 반드시 필요 # description: test service ※ chkconfig 등록하기 위해 반드시 필요 echo "Usage:{start|stop}" # chmod 755 test # chwon root.root test # chkconfig --add test # service test start # service test stop 참고 사이트 http://lesstif.com/pages/viewpage.action?pageId=6979609
[Centos] 서비스 등록 /etc/init.d/ 사용법
How to do multiline shell script in Ansible
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great answers.
How to do multiline shell script in Ansible
How to output a multiline string in Bash?
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great answers.
How to output a multiline string in Bash?
 
 
mount #!/bin/sh # chkconfig: 234 90 90 # description: mount nas drive mount -t cifs //10.0.0.148/smms_output /mnt/nas/smms_output -o user=Sln_Server_Account,pass=Tmxmfltm!234,rw,vers=1.0 || echo
요건 /etc/init.d/mount
- name: make script shell: echo "mount -t cifs //10.0.0.148/smms_output /mnt/nas/smms_output -o user=Sln_Server_Account,pass=Tmxmfltm\!234,rw,vers=1.0" > /etc/init.d/mount.sh || echo - name: make script shell:
이건 앤서블
 

mysql issue


큰게 두가지 문제였는데
 
  1. php mysqli 연결 설정 필요
yum install php-mysqli
centOS php 에서 mysqli 설치
centOS에서 php, mysql 이 모두 설치되어 있다고 해서 php의 mysql 관련 API들을 기본으로 사용할수있는 것은 아니다. 예를 들어 mysqli 를 사용하게 되면 Fatal error: Class 'mysqli' not found in 과 같은 에러..
centOS php 에서 mysqli 설치
 
2. cent os selinux external db
Failed to connect to MySQL: Permission denied 에러 - Steemit
Failed to connect to MySQL: Permission denied 에러 음... 서버를 셋팅하는 도중에 Cent OS7 에서 Failed to connect to MySQL: Permission denied 라는 에러를 띄우더라.. 왜 연결이 안되지 ..?? 하고 확인한 결과 SELinux policy 때문이라고 한다.. setsebool -P httpd_can_network_connect 1 setsebool -P httpd_can_network_connect_db 1 해당 명령어로 보안부분을 해제하니, 잘 접속 된다.
Failed to connect to MySQL: Permission denied 에러 - Steemit
setsebool -P httpd_can_network_connect 1 setsebool -P httpd_can_network_connect_db 1
 

완료!

 
 

var 추가


Variables
http://docs.ansible.com/playbooks_variables.html Ansible에서는 변수를 사용하여 공통된 내용 속에 시스템 간의 차이를 표현할 수 있음. 예> letters, numbers, underscores로 구성해야 하며, letter로 시작해야 함 # OK foo_port foo5 # NOT OK foo port foo.port 12 아래와 같이 YAML dictionary 지원됨 foo: field1: one field2: two 참조할 때는 아래와 같이 하면 됨(둘다 가능) 하지만, 되도록이면 전자를 택하는 것이 좋음.
notion image
참고해서 all.yaml 돌리는 거까지 해서 완료해따
 
 
 

Recommendations