forked from skywalker-nick/DevSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevswift-centos.sh
executable file
·75 lines (59 loc) · 1.59 KB
/
devswift-centos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# load the common functions
source common.sh
# add swift user
add_user_centos() {
userdel $user
groupdel $group
groupadd --gid $gid --force $group
useradd --gid $gid --uid $uid $user
}
add_user_centos
# installing software packages and their dependencies
install_env_centos() {
yum -y install curl gcc memcached rsync sqlite xfsprogs git-core libffi-devel xinetd wget zlib*
yum -y install python-coverage python-devel python-nose python-simplejson python-setuptools
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz
tar zxvf pip-1.4.1.tar.gz
cd pip-1.4.1
python setup.py install
cd ..
pip install -U xattr eventlet greenlet pastedeploy netifaces dnspython mock
}
install_env_centos
prepare_loop_dev
prepare_boot_script
setup_rsync
config_rsync_service_centos() {
# enable rsync service
sed -i -e "/disable/{ s/yes/no/ }" /etc/xinetd.d/rsync
# disable SELinux for rsync
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce Permissive
service xinetd restart
}
config_rsync_service_centos
# start memcached
setup_memcached_centos() {
service memcached start
chkconfig memcached on
}
setup_memcached_centos
# setup rsyslog for individual logging
setup_rsyslog
config_rsyslog_service_centos() {
chown -R root:adm /var/log/swift
chmod -R g+w /var/log/swift
service rsyslog restart
}
config_rsyslog_service_centos
# get the code and setting the environment
install_swift
# configure swift
config_swift
# setting up scripts for running swift
create_swift_scripts
# run unit tests for swift
init_test
# start swift processes
start_swift