How to install Swift on MXLinux Latest

Swift is an open-source object storage system designed to provide scalability, durability, and performance. In this tutorial, we will guide you through the installation process of Swift from the official website http://docs.openstack.org/developer/swift/ on MXLinux latest.

Prerequisites

  • Linux MXLinux Latest 64bit
  • Root access

Step 1: Install Dependencies

Before installing Swfit, we need to install some dependencies:

sudo apt update && sudo apt upgrade
sudo apt install curl gcc memcached rsync sqlite3 xfsprogs \
swift swift-proxy swift-account swift-container swift-object

Once the packages are installed, you need to start the services.

sudo systemctl start memcached
sudo systemctl enable memcached
sudo systemctl start swift-proxy
sudo systemctl enable swift-proxy
sudo systemctl start swift-account
sudo systemctl enable swift-account
sudo systemctl start swift-container
sudo systemctl enable swift-container
sudo systemctl start swift-object
sudo systemctl enable swift-object

Step 2: Configure Swift

We need to modify the configuration files for swift.

sudo nano /etc/swift/swift.conf

Uncomment the following lines:

[swift-hash]
swift_hash_path_suffix = random_gibberish_here

Save and Exit.

Next, edit proxy-server.conf:

sudo nano /etc/swift/proxy-server.conf

Update the following lines (make sure that you replace 127.0.0.1 with your own IP address):

[DEFAULT]
bind_port = 8080
user = swift
log_facility = LOG_LOCAL1
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache tempauth proxy-server
[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = True
set log_name = swift-proxy
set log_facility = LOG_LOCAL1
set log_level = INFO
set log_headers = X-Auth-Token,X-Storage-Token,X-Container-Write,X-Container-Read,X-Container-Sync-Key,X-Container-Meta-*
set account_listing_limit = 10000
set container_listing_limit = 10000
set object_account_cache_time = 60
set strict_cors_mode = false
set obj_cacher_cache_time = 10
set obj_cacher_cache_size = 10000
set concurrency = 20
set workers = auto
set send_timeout = 600
set client_timeout = 86400
set max_containers_per_extraction = 665
set cors_origin =
set cors_max_age = 86400
set cors_allow_methods = GET,PUT,HEAD,DELETE,COPY#,OPTIONS;
set cors_allow_headers = content-type,origin,x-requested-with,accept,authorization
[filter:tempauth]
account = system
user_admin_admin = admin .admin .reseller_admin
user_test_tester = testing .admin
user_test2_tester2 = testing2 .admin
user_test_tester3 = testing3

Save and Exit.

Step 3: Start and Test Swift

Start the Swift services:

sudo systemctl start swift-all
sudo systemctl enable swift-all

Check the status of the services:

swift-init status

Test Swift by running a couple of commands:

swift -A http://127.0.0.1:8080/auth/v1.0/ -U account:user -K password stat
swift -A http://127.0.0.1:8080/auth/v1.0/ -U account:user -K password list

You should receive a response for both commands.

Conclusion

Congratulations! You have successfully installed Swift on MXLinux latest. You can now configure and use it to store and retrieve objects as per your requirements.